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
public class SoWWWInline extends SoNode
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 anSoWWWInline
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 thebboxCenter
andbboxSize
fields, and the setting passed tosetBoundingBoxVisibility()
. If no fetch URL callback is set and thealternateRep
is not NULL, thealternateRep
will be rendered until child data has been set.- See Also:
SoWWWAnchor
,SoFile
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoWWWInline.BboxVisibilities
BboxVisibility.-
Nested 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
Fields Modifier and Type Field Description SoSFNode
alternateRep
Specifies child data that can be used instead of fetching data from the URL.SoSFVec3f
bboxCenter
Defines the center of the bounding box surrounding the URL child data.SoSFVec3f
bboxSize
Defines the size of the bounding box surrounding the URL child data.SoSFFilePathString
name
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 Constructor Description SoWWWInline()
Creates an inline node with default settings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelURLDataRequest()
Cancels the active URL data fetch request.SoGroup
copyChildren()
Return a copy of the hidden children as a Group.static SbColor
getBoundingBoxColor()
Queries the color of bounding boxes displayed.static SoWWWInline.BboxVisibilities
getBoundingBoxVisibility()
Queries when bounding boxes are displayed.SoNode
getChildData()
Gets the child data the inline should display.java.lang.String
getFullURLName()
Returns the fullURL set by setFullURLName, or if not set, returns the contents of the name field.static boolean
getReadAsSoFile()
Queries the ReadAsSoFile flag.boolean
isURLDataHere()
Returns whether URL data is here (i.e.boolean
isURLDataRequested()
Returns whether URL data has been requested.void
requestURLData()
Requests that URL data be fetched.static void
setBoundingBoxColor(SbColor c)
Specifies the color of bounding boxes displayed.static void
setBoundingBoxVisibility(SoWWWInline.BboxVisibilities b)
Specifies when bounding boxes are displayed.void
setChildData(SoNode urlData)
Sets the child data the inline should display.static void
setFetchURLCallBack(SoWWWInlineFetchURLCB f, java.lang.Object userData)
Application callbacks invoked when the inline needs its URL data fetched.void
setFullURLName(java.lang.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 Detail
-
bboxCenter
public final SoSFVec3f bboxCenter
Defines the center of the bounding box surrounding the URL child data.
-
bboxSize
public final SoSFVec3f bboxSize
Defines the size of the bounding box surrounding the URL child data.
-
name
public final SoSFFilePathString name
Specifies the URL which the application should fetch as child data to this node (e.g. "http://bogus.com/homeWorld.wrl.gz").
-
alternateRep
public final SoSFNode 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()
).
-
-
Method Detail
-
setFetchURLCallBack
public static void setFetchURLCallBack(SoWWWInlineFetchURLCB f, java.lang.Object userData)
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
public java.lang.String getFullURLName()
Returns the fullURL set by setFullURLName, or if not set, returns the contents of the name field.
-
setBoundingBoxVisibility
public static void setBoundingBoxVisibility(SoWWWInline.BboxVisibilities b)
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
public static SoWWWInline.BboxVisibilities getBoundingBoxVisibility()
Queries when bounding boxes are displayed.
-
copyChildren
public SoGroup 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
public void setChildData(SoNode urlData)
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
public SoNode getChildData()
Gets the child data the inline should display.
-
getBoundingBoxColor
public static SbColor getBoundingBoxColor()
Queries the color of bounding boxes displayed.
-
setBoundingBoxColor
public static void setBoundingBoxColor(SbColor c)
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
public void setFullURLName(java.lang.String url)
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()).
-
-