| 1 |
NAME SoWWWInline "" "" { node that refers to children through a URL } |
| 2 |
|
| 3 |
INCLUDE nodes/SoWWWInline.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
This node refers to children through a URL (Universal Resource Locator). |
| 7 |
The application is responsible for actually fetching data from the URL |
| 8 |
for an SoWWWInline node to display. |
| 9 |
} |
| 10 |
|
| 11 |
TYPEDEF void SoWWWInlineFetchURLCB "(const SbString &url, void *userData, SoWWWInline *node)" |
| 12 |
|
| 13 |
ENUM BboxVisibility { |
| 14 |
NEVER "Do not show bounding box", |
| 15 |
UNTIL_LOADED "Show bounding box (if specified) until data is loaded", |
| 16 |
ALWAYS "Show bounding box along with data" |
| 17 |
} |
| 18 |
|
| 19 |
FIELD name { |
| 20 |
Specifies the URL which the application should fetch as child data to this node |
| 21 |
(e.g. "http://bogus.com/homeWorld.wrl.gz"). |
| 22 |
} |
| 23 |
|
| 24 |
FIELD bboxCenter { |
| 25 |
Defines the center of the bounding box surrounding the URL child data. |
| 26 |
} |
| 27 |
|
| 28 |
FIELD bboxSize { |
| 29 |
Defines the size of the bounding box surrounding the URL child data. |
| 30 |
} |
| 31 |
|
| 32 |
FIELD alternateRep { |
| 33 |
Specifies child data that can be used instead of fetching data from the URL. |
| 34 |
On read, if this field is set and there is no fetch URL callback registered, |
| 35 |
the alternateRep will be used as the child data. Otherwise, it is the applications |
| 36 |
responsibility to set the child data (see \ksetChildData()\.). |
| 37 |
} |
| 38 |
|
| 39 |
METHOD "" SoWWWInline() { |
| 40 |
Creates an inline node with default settings. |
| 41 |
} |
| 42 |
|
| 43 |
METHOD "" static SoType getClassTypeId() { |
| 44 |
Returns type identifier for this class. |
| 45 |
} |
| 46 |
|
| 47 |
METHOD "" void setFullURLName(const SbString &url) {} |
| 48 |
METHOD "" const SbString & getFullURLName() { |
| 49 |
If the name field contains a relative URL (e.g. "foo.wrl" |
| 50 |
instead of "http://bogus.com/foo.wrl"), the inline cannot |
| 51 |
resolve the URL reference. This method allows the application |
| 52 |
to tell the anchor what it's full URL should be. |
| 53 |
\kgetFullURLName()\. returns the fullURL set here, or if not set, returns |
| 54 |
the contents of the name field. |
| 55 |
} |
| 56 |
|
| 57 |
METHOD "" SoGroup * copyChildren() const { |
| 58 |
Return a copy of the hidden children as a Group. The children |
| 59 |
are set by the application through \ksetChildData()\.. |
| 60 |
} |
| 61 |
|
| 62 |
METHOD reqURLData void requestURLData() { |
| 63 |
Request that URL data be fetched. This will invoke the |
| 64 |
application callback to actually fetch the data and can be called |
| 65 |
before the inline does this for itself (see \ksetFetchURLCallBack()\.). |
| 66 |
} |
| 67 |
|
| 68 |
METHOD isURLDataReq SbBool isURLDataRequested() const {} |
| 69 |
METHOD "" SbBool isURLDataHere() const { |
| 70 |
Return whether URL data has been requested and whether that data |
| 71 |
is here (i.e. whether \ksetChildData()\. has been called.) |
| 72 |
} |
| 73 |
|
| 74 |
METHOD cancelURLDataReq void cancelURLDataRequest() { |
| 75 |
Cancel the active URL data fetch request. |
| 76 |
} |
| 77 |
|
| 78 |
METHOD "" void setChildData(SoNode *urlData) {} |
| 79 |
METHOD "" SoNode * getChildData() const { |
| 80 |
Set/get the child data the inline should display. The application should set |
| 81 |
child data after it has fetched data for an inline node. |
| 82 |
} |
| 83 |
|
| 84 |
METHOD setFetchCB static void setFetchURLCallBack(SoWWWInlineFetchURLCB *f, void *userData) { |
| 85 |
Application callbacks invoked when the inline needs its URL data fetched. |
| 86 |
This happens the first time the inline is rendered, or if it needs to compute |
| 87 |
a bounding box and the bboxSize field is not set, or when \krequestURLData()\. is called. |
| 88 |
} |
| 89 |
|
| 90 |
METHOD setBboxVis static void setBoundingBoxVisibility(BboxVisibility b) {} |
| 91 |
METHOD getBboxVis static BboxVisibility getBoundingBoxVisibility() { |
| 92 |
This allows the application to specify when bounding boxes are displayed. |
| 93 |
The bounding box can be rendered along with the |
| 94 |
children (\kALWAYS\.), only until the child data is loaded (\kUNTIL_LOADED\.), |
| 95 |
or not at all (\kNEVER\.). Default is \kUNTIL_LOADED\. |
| 96 |
} |
| 97 |
|
| 98 |
METHOD setBboxCol static void setBoundingBoxColor(SbColor &c) {} |
| 99 |
METHOD getBboxCol static const SbColor &getBoundingBoxColor() { |
| 100 |
This allows the application to specify the color of bounding boxes displayed. |
| 101 |
} |
| 102 |
|
| 103 |
ACTION SoGLRenderAction { |
| 104 |
This renders the child data if it has been set by the application. |
| 105 |
It will render a wireframe bounding box as specified by the \kbboxCenter\. |
| 106 |
and \kbboxSize\. fields, and the setting passed to \ksetBoundingBoxVisibility()\.. |
| 107 |
If no fetch URL callback is set and the \kalternateRep\. |
| 108 |
is not NULL, the \kalternateRep\. will be rendered until child data has been set. |
| 109 |
} |
| 110 |
|
| 111 |
ALSO { |
| 112 |
SoWWWAnchor, SoFile |
| 113 |
} |