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.RenderModesNested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SoSFNodeSpecifies child data that can be used instead of fetching data from the URL.final SoSFVec3fDefines the center of the bounding box surrounding the URL child data.final SoSFVec3fDefines the size of the bounding box surrounding the URL child data.final SoSFFilePathStringSpecifies 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 TypeMethodDescriptionvoidCancels the active URL data fetch request.Return a copy of the hidden children as a Group.static SbColorQueries the color of bounding boxes displayed.static SoWWWInline.BboxVisibilitiesQueries 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 booleanQueries the ReadAsSoFile flag.booleanReturns whether URL data is here (i.e.booleanReturns whether URL data has been requested.voidRequests that URL data be fetched.static voidSpecifies the color of bounding boxes displayed.static voidSpecifies when bounding boxes are displayed.voidsetChildData(SoNode urlData) Sets the child data the inline should display.static voidsetFetchURLCallBack(SoWWWInlineFetchURLCB f, Object userData) Application callbacks invoked when the inline needs its URL data fetched.voidsetFullURLName(String url) If the name field contains a relative URL (e.g.static voidsetReadAsSoFile(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, writeMethods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaultsMethods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizableMethods 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 thebboxSizefield 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 anSoFilenode 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()).
-