Package com.openinventor.inventor.nodes
Class SoWWWInline
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.misc.SoBase
com.openinventor.inventor.fields.SoFieldContainer
com.openinventor.inventor.nodes.SoNode
com.openinventor.inventor.nodes.SoWWWInline
- All Implemented Interfaces:
SafeDisposable
Node that refers to children through a URL.
This node refers to children through a URL (Universal Resource Locator). The application is responsible for actually fetching data from the URL for an
SoWWWInline
node to display.
File format/default:
WWWInline {
name | "<Undefined file>" |
bboxCenter | 0 0 0 |
bboxSize | 0 0 0 |
alternateRep | NULL |
Action behavior:
SoGLRenderAction
This renders the child data if it has been set by the application. It will render a wireframe bounding box as specified by the bboxCenter
and bboxSize
fields, and the setting passed to setBoundingBoxVisibility()
. If no fetch URL callback is set and the alternateRep
is not NULL, the alternateRep
will be rendered until child data has been set.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SoSFNode
Specifies child data that can be used instead of fetching data from the URL.final SoSFVec3f
Defines the center of the bounding box surrounding the URL child data.final SoSFVec3f
Defines the size of the bounding box surrounding the URL child data.final SoSFFilePathString
Specifies the URL which the application should fetch as child data to this node (e.g.Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancels the active URL data fetch request.Return a copy of the hidden children as a Group.static SbColor
Queries the color of bounding boxes displayed.static SoWWWInline.BboxVisibilities
Queries when bounding boxes are displayed.Gets the child data the inline should display.Returns the fullURL set by setFullURLName, or if not set, returns the contents of the name field.static boolean
Queries the ReadAsSoFile flag.boolean
Returns whether URL data is here (i.e.boolean
Returns whether URL data has been requested.void
Requests that URL data be fetched.static void
Specifies the color of bounding boxes displayed.static void
Specifies when bounding boxes are displayed.void
setChildData
(SoNode urlData) Sets the child data the inline should display.static void
setFetchURLCallBack
(SoWWWInlineFetchURLCB f, Object userData) Application callbacks invoked when the inline needs its URL data fetched.void
setFullURLName
(String url) If the name field contains a relative URL (e.g.static void
setReadAsSoFile
(boolean onOff) Sets the ReadAsSoFile flag.Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Field Details
-
bboxCenter
Defines the center of the bounding box surrounding the URL child data. -
bboxSize
Defines the size of the bounding box surrounding the URL child data. -
name
Specifies the URL which the application should fetch as child data to this node (e.g. "http://bogus.com/homeWorld.wrl.gz"). -
alternateRep
Specifies child data that can be used instead of fetching data from the URL. On read, if this field is set and there is no fetch URL callback registered, the alternateRep will be used as the child data. Otherwise, it is the applications responsibility to set the child data (seesetChildData()
).
-
-
Constructor Details
-
SoWWWInline
public SoWWWInline()Creates an inline node with default settings.
-
-
Method Details
-
setFetchURLCallBack
Application callbacks invoked when the inline needs its URL data fetched. This happens the first time the inline is rendered, or if it needs to compute a bounding box and thebboxSize
field is not set, or whenrequestURLData()
is called. -
getFullURLName
Returns the fullURL set by setFullURLName, or if not set, returns the contents of the name field. -
setBoundingBoxVisibility
Specifies when bounding boxes are displayed. The bounding box can be rendered along with the children (ALWAYS), only until the child data is loaded (UNTIL_LOADED), or not at all (NEVER). Default is UNTIL_LOADED. -
getBoundingBoxVisibility
Queries when bounding boxes are displayed. -
copyChildren
Return a copy of the hidden children as a Group. The children are set by the application throughsetChildData()
. -
setReadAsSoFile
public static void setReadAsSoFile(boolean onOff) Sets the ReadAsSoFile flag. If true, assume that "url" points to other Open Inventor files on local filesystem, and load them directly as if this were anSoFile
node instead of using SoWWWInlineFetchURLCB. -
isURLDataHere
public boolean isURLDataHere()Returns whether URL data is here (i.e. whethersetChildData()
has been called.) -
setChildData
Sets the child data the inline should display. The application should set child data after it has fetched data for an inline node. -
getReadAsSoFile
public static boolean getReadAsSoFile()Queries the ReadAsSoFile flag. -
getChildData
Gets the child data the inline should display. -
getBoundingBoxColor
Queries the color of bounding boxes displayed. -
setBoundingBoxColor
Specifies the color of bounding boxes displayed. -
cancelURLDataRequest
public void cancelURLDataRequest()Cancels the active URL data fetch request. -
isURLDataRequested
public boolean isURLDataRequested()Returns whether URL data has been requested. -
setFullURLName
If the name field contains a relative URL (e.g. "foo.wrl" instead of "http://bogus.com/foo.wrl"), the inline cannot resolve the URL reference. This method allows the application to tell the anchor what its full URL should be.getFullURLName()
returns the fullURL set here, or if not set, returns the contents of the name field. -
requestURLData
public void requestURLData()Requests that URL data be fetched. This will invoke the application callback to actually fetch the data and can be called before the inline does this for itself (see setFetchURLCallBack()).
-