Class 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 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:
  • Field Details

    • 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 (see setChildData()).
  • Constructor Details

    • SoWWWInline

      public SoWWWInline()
      Creates an inline node with default settings.
  • Method Details

    • setFetchURLCallBack

      public static void setFetchURLCallBack(SoWWWInlineFetchURLCB f, 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 the bboxSize field is not set, or when requestURLData() is called.
    • getFullURLName

      public 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 through setChildData().
    • 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 an SoFile node instead of using SoWWWInlineFetchURLCB.
    • isURLDataHere

      public boolean isURLDataHere()
      Returns whether URL data is here (i.e. whether setChildData() 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(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()).