Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoWWWInline.h
Go to the documentation of this file.
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Gavin Bell (MMM yyyy)
25** Modified by : David Mott (MMM yyyy)
26** Modified by : Jim Kent (MMM yyyy)
27**=======================================================================*/
28/*=======================================================================
29 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
30 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
31 *** ***
32 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
33 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
34 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
35 *** ***
36 *** RESTRICTED RIGHTS LEGEND ***
37 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
38 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
39 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
40 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
41 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
42 *** ***
43 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
44 *** BORDEAUX, FRANCE ***
45 *** ALL RIGHTS RESERVED ***
46**=======================================================================*/
47/*=======================================================================
48** Modified by : VSG (MMM YYYY)
49**=======================================================================*/
50
51
52#ifndef _SO_WWWINLINE_
53#define _SO_WWWINLINE_
54
60
62
63class SoWWWInline;
64class SoGroup;
65class SoWriteAction;
66
72 const SbString &url, void *userData, SoWWWInline *node);
73
74
76//
77// Class: SoWWWInline
78//
80
117class SoWWWInline : public SoNode {
118
120
121 public:
126
142
167
175 void setFullURLName(const SbString &url) { fullURL = url; }
181
187
194 { if (! kidsRequested) requestChildrenFromURL(); }
198 SbBool isURLDataRequested() const { return kidsRequested; }
203 SbBool isURLDataHere() const { return kidsAreHere; }
208 { if (!kidsAreHere) kidsRequested = FALSE; }
209
214 void setChildData(SoNode *urlData);
219
226 static void setFetchURLCallBack(SoWWWInlineFetchURLCB *f, void *userData);
227
239
243 static void setBoundingBoxColor(SbColor &c) ;
247 static const SbColor &getBoundingBoxColor() ;
248
254 static void setReadAsSoFile(SbBool onOff) { readAsSoFile = onOff; };
258 static SbBool getReadAsSoFile() { return readAsSoFile; };
259
260
261 private:
262 // Traversal methods for all the actions:
263 virtual void doAction(SoAction *action);
264 virtual void doActionOnKidsOrBox(SoAction *action);
265 virtual void callback(SoCallbackAction *action);
266 virtual void GLRender(SoGLRenderAction *action);
267 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
268 virtual void getMatrix(SoGetMatrixAction *action);
269 virtual void handleEvent(SoHandleEventAction *action);
270 virtual void search(SoSearchAction *action);
271 virtual void pick(SoPickAction *action);
272 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
273
274 private:
275 static void initClass();
276 static void exitClass();
277 const SbString & getBasePath() { return basePath; }
278 void setBasePath( const SbString &path ) { basePath = path; }
279
280 // Returns pointer to children, or NULL if none
281 virtual SoChildList *getChildren() const;
282
283 // Copies the child data as well as the rest of the node (if
284 // the child data has been set)
285 virtual void copyContents(const SoFieldContainer *fromFC,
286 SbBool copyConnections);
287
288 private:
289 virtual ~SoWWWInline();
290
291 virtual void addBoundingBoxChild(SbVec3f center, SbVec3f size);
292
293 // Reads into instance of SoWWWInline. Returns FALSE on error.
294 virtual SbBool readInstance(SoInput *in, unsigned short flags);
295
296 private:
297 SbString basePath;
298 void requestChildrenFromURL();
299
300 SoChildList *children;
301 SbBool kidsRequested;
302 SbBool kidsAreHere;
303 SbString fullURL;
304
305 static SbColor bboxColor;
306 static BboxVisibility bboxVisibility;
307
308 // Static methods
309 static SoWWWInlineFetchURLCB *fetchURLcb;
310 static void *fetchURLdata;
311
312 // static variable for whether to read "name" as if this
313 // was an SoFile node
314 static SbBool readAsSoFile;
315};
316
317#endif /* _SO_WWWINLINE_ */
318
319
#define FALSE
Possible value of SbBool.
Definition SbBase.h:75
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
void SoWWWInlineFetchURLCB(const SbString &url, void *userData, SoWWWInline *node)
This is the format for callbacks that will get URL data for us.
Definition SoWWWInline.h:71
Color vector class.
Definition SbColor.h:82
Class for smart character strings.
Definition SbString.h:202
3D vector class.
Definition SbVec.h:932
Abstract base class for all actions.
Definition SoAction.h:132
Performs a generic traversal of a scene graph or path.
Abstract base class for objects that contain fields.
Renders a scene graph using Open Inventor's Render Engine.
Computes bounding box of a scene.
Computes transformation matrix for a subgraph.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
Base class for all group nodes.
Definition SoGroup.h:122
Allows nodes in a graph to receive input events.
Used to read Open Inventor data files.
Definition SoInput.h:363
Abstract base class for all database nodes.
Definition SoNode.h:145
friend class SoChildList
Definition SoNode.h:472
Abstract base class for picking objects in a scene.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Field containing a a node.
Definition SoSFNode.h:97
Field containing a three-dimensional vector.
Definition SoSFVec3f.h:80
Searches for nodes in a scene graph.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Node that refers...
const SbString & getFullURLName()
Returns the fullURL set by setFullURLName, or if not set, returns the contents of the name field.
SoGroup * copyChildren() const
Return a copy of the hidden children as a Group.
static const SbColor & getBoundingBoxColor()
Queries the color of bounding boxes displayed.
BboxVisibility
BboxVisibility.
@ NEVER
Do not show bounding box.
@ ALWAYS
Show bounding box along with data.
@ UNTIL_LOADED
Show bounding box (if specified) until data is loaded.
static void setReadAsSoFile(SbBool onOff)
Sets the ReadAsSoFile flag.
void requestURLData()
Requests that URL data be fetched.
static SbBool getReadAsSoFile()
Queries the ReadAsSoFile flag.
static void setBoundingBoxColor(SbColor &c)
Specifies the color of bounding boxes displayed.
void setChildData(SoNode *urlData)
Sets the child data the inline should display.
SoSFNode alternateRep
Specifies child data that can be used instead of fetching data from the URL.
static void setFetchURLCallBack(SoWWWInlineFetchURLCB *f, void *userData)
Application callbacks invoked when the inline needs its URL data fetched.
SoSFFilePathString name
Specifies the URL which the application should fetch as child data to this node (e....
SoNode * getChildData() const
Gets the child data the inline should display.
void cancelURLDataRequest()
Cancels the active URL data fetch request.
static BboxVisibility getBoundingBoxVisibility()
Queries when bounding boxes are displayed.
SoWWWInline()
Creates an inline node with default settings.
SbBool isURLDataRequested() const
Returns whether URL data has been requested.
SoSFVec3f bboxCenter
Defines the center of the bounding box surrounding the URL child data.
SbBool isURLDataHere() const
Returns whether URL data is here (i.e. whether setChildData() has been called.)
void setFullURLName(const SbString &url)
If the name field contains a relative URL (e.g. "foo.wrl" instead of "http://bogus....
SoSFVec3f bboxSize
Defines the size of the bounding box surrounding the URL child data.
static void setBoundingBoxVisibility(BboxVisibility b)
Specifies when bounding boxes are displayed.
Writes a scene graph to a file.
int SbBool
Boolean type.
Definition SbBase.h:87
size_t size() const