Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SceneView Class Reference

VSG extension (Preview feature) [Medical] Defines a view for use with ViewManager. More...

#include <Medical/nodes/SceneView.h>

+ Inheritance diagram for SceneView:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
void setViewport (float origX, float origY, float sizeX, float sizeY)
 Convenience method to set viewport in normalized coordinates with one call.
 
void setViewport (const SbVec4f &viewport)
 Convenience method to set viewport in normalized coordinates with one call.
 
const SbVec4fgetViewport () const
 Returns the current viewport as a convenient single object.
 
const SbViewportRegiongetViewportRegion () const
 Returns the actual viewport in pixels.
 
const SbVec4fgetViewportPixels () const
 Returns the actual viewport in pixels.
 
void enableEventHandling (SbBool onoff)
 Enable handling events.
 
 SceneView ()
 Constructor.
 
- Public Member Functions inherited from SoSeparator
 SoSeparator ()
 Creates a separator node with default settings.
 
 SoSeparator (int nChildren)
 Constructor that takes approximate number of children.
 
- Public Member Functions inherited from SoGroup
 SoGroup ()
 Creates an empty group node.
 
 SoGroup (int nChildren)
 Constructor that takes approximate number of children.
 
- Public Member Functions inherited from SoNode
virtual void setOverride (const SbBool state)
 Turns the override flag on or off.
 
virtual SbBool isOverride () const
 Returns the state of the override flag.
 
virtual SoNodecopy (SbBool copyConnections=FALSE) const
 Creates and returns an exact copy of the node.
 
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static void initClass ()
 Initialize the class.
 
static void exitClass ()
 Finish using the class.
 
- Static Public Member Functions inherited from SoSeparator
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoGroup
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoNode
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SoNodegetByName (const SbName &name)
 A node's name can be set using SoBase::setName().
 
static int getByName (const SbName &name, SoNodeList &list)
 A node's name can be set using SoBase::setName().
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Public Attributes

SoSFVec2f viewportOrigin
 Viewport origin (normalized device coordinates 0..1).
 
SoSFVec2f viewportSize
 Viewport size (normalized device coordinates 0..1).
 
SoSFBool active
 Enable rendering the view.
 
SoSFBool drawBorder
 Enable drawing a border around the view's viewport.
 
- Public Attributes inherited from SoSeparator
SoSFEnum boundingBoxCaching
 Whether to cache during bounding box traversal.
 
SoSFEnum renderCulling
 Whether to cull during rendering traversal.
 
SoSFEnum pickCulling
 Whether to cull during picking traversal.
 
SoSFEnum fastEditing
 Specifies the fast edit mode of the separator node.
 
SoSFInt32 renderUnitId
 Used during the ScaleViz depth compositing process, this field specifies which render unit (OIRU) will render the sub scene graph below this separator.
 
SoDEPRECATED SoSFEnum renderCaching
 Whether to cache during rendering traversal.
 
- Public Attributes inherited from SoGroup
SoSFBool boundingBoxIgnoring
 Whether to ignore this node during bounding box traversal.
 

Additional Inherited Members

- Public Types inherited from SoSeparator
enum  CacheEnabled {
  OFF ,
  ON ,
  AUTO
}
 Possible values for caching. More...
 
enum  FastEditing {
  DISABLE = 0x01 ,
  KEEP_ZBUFFER = 0x02 ,
  CLEAR_ZBUFFER = 0x03
}
 Fast editing policy enumeration values. More...
 

Detailed Description

VSG extension (Preview feature) [Medical] Defines a view for use with ViewManager.

This class defines a "view" consisting of a viewport (subregion) inside the render area, a scene graph to be rendered and an optional border.

This class is conceptually similar to the older class PoSceneView, but is designed to be used with the Viewer Component classes, specifically SceneExaminer, and with the ViewManager class.

Usually the specified scene graph will contain its own camera node and one or more light nodes. If the user should be able to manipulate the camera, we recommend adding a SceneExaminer node (which automatically creates a camera, headlight and event handlers) and then setting the actual scene to be rendered as a child of the SceneExaminer.

Normally the SceneView node(s) should be added as children of a ViewManager node. This is not required if no nodes in the view need to handle events, for example if the view is an orientation indicator or bird's eye view and its camera is linked to a main camera. However the ViewManager node is needed to deliver events to its SceneView children based on the position of the event and the order of the SceneView children. The SoHandleEventAction will only be allowed to traverse a SceneView node's scene graph if the event position is inside that SceneView's viewport or the SceneView has "captured" events. See ViewManager for more details.

Note that the specified viewport is relative to the node's inherited viewport. For the "first level" of SceneView nodes the viewport is relative to the entire render area, as expected. However this feature allows the powerful capability to "nest" SceneView nodes. If a SceneView node is the child of another SceneView node, the child's viewport is relative to the viewport set by the parent node. For example, one quadrant of the render area could be subdivided into multiple smaller viewports to create a "light box" view. The viewport definition may be dynamically changed to create a different layout of views. For example four equal size viewports can be dynamically changed to one large viewport plus three small viewports. The convenience methods in the ViewManager node make it easy to modify the view layout.

The active field can be used to prevent a view from being rendered. This is convenient, for example, when switching from a four view layout to a one or two view layout. In this case it is not necessary to remove the inactive SceneView nodes from their parent ViewManager, just set 'active' to false.

Data nodes, e.g. SoVolumeData, that are shared by multiple views may be placed in the scene graph above the ViewManager node. But note that in most cases Open Inventor cannot compute the correct bounding box without traversing the data node. This means that calling viewAll() on the SceneExaminer inside a view will compute the correct view volume. You can work around this by placing an SoBBox node under the SceneView and setting its 'boundingBox' field to (for example) the extent of the SoVolumeData node. Alternatively you can create one instance of the data node and add that instance under the SceneExaminer in each view that needs that data. In this case the viewAll() should work as expected. Do not create a separate instance of the data node for each view as this will cause the data to be loaded multiple times.

Tiling: Even when working in normalized coordinates it is necessary to take some care about the size of the viewports in pixels. For example, if the render area is 1024 pixels wide, then creating two tiles (viewports) with width 0.5 will result in two non-overlapping viewports, each 512 pixels wide as expected. But 1024 is not evenly divisible by 3, so creating three tiles with width 0.3333 means that each tile will be 341 pixels wide and 3 * 341 = 1023, leaving a 1 pixel gap. In this case it is necessary to make one of the viewports 1 pixel larger than the others. The width of 1 pixel in normalized coordinates is simply 1 / widthOfParentViewport (in pixels).

Limitations:

FILE FORMAT/DEFAULT

    SceneView {
    viewportOrigin 0 0
    viewportSize 1 1
    scene NULL
    active TRUE
    drawBorder TRUE
    }

SEE ALSO

ViewManager, SceneExaminer

Definition at line 132 of file SceneView.h.

Constructor & Destructor Documentation

◆ SceneView()

SceneView::SceneView ( )

Constructor.

Member Function Documentation

◆ enableEventHandling()

void SceneView::enableEventHandling ( SbBool  onoff)

Enable handling events.

Default is true. This method is used by the ViewManager node to temporarily disable event handling without triggering notification. Generally the application should not call this method directly.

◆ exitClass()

static void SceneView::exitClass ( )
static

Finish using the class.

◆ getClassTypeId()

static SoType SceneView::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getTypeId()

virtual SoType SceneView::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoSeparator.

◆ getViewport()

const SbVec4f & SceneView::getViewport ( ) const

Returns the current viewport as a convenient single object.

◆ getViewportPixels()

const SbVec4f & SceneView::getViewportPixels ( ) const

Returns the actual viewport in pixels.

◆ getViewportRegion()

const SbViewportRegion & SceneView::getViewportRegion ( ) const

Returns the actual viewport in pixels.

Convenient to use with (for example) viewAll().

◆ initClass()

static void SceneView::initClass ( )
static

Initialize the class.

◆ setViewport() [1/2]

void SceneView::setViewport ( const SbVec4f viewport)

Convenience method to set viewport in normalized coordinates with one call.

Modifies the 'viewportOrig' and 'viewportSize' fields.

◆ setViewport() [2/2]

void SceneView::setViewport ( float  origX,
float  origY,
float  sizeX,
float  sizeY 
)

Convenience method to set viewport in normalized coordinates with one call.

Modifies the 'viewportOrig' and 'viewportSize' fields.

Member Data Documentation

◆ active

SoSFBool SceneView::active

Enable rendering the view.

Default is true.

Definition at line 151 of file SceneView.h.

◆ drawBorder

SoSFBool SceneView::drawBorder

Enable drawing a border around the view's viewport.

Default is true.

  • The border is 1 pixel wide and uses the outermost pixels of the viewport, effectively reducing the size of the viewport by two pixels in each direction.
  • If two adjacent views have their border enabled the result will usually be a two pixel wide line (1 pixel in each view). However, see the discussion about "tiling" above. If the pixel size of the views are not taken into account then border lines may overlap or show a one pixel gap.

Definition at line 162 of file SceneView.h.

◆ viewportOrigin

SoSFVec2f SceneView::viewportOrigin

Viewport origin (normalized device coordinates 0..1).

Default is 0,0. Illegal values, e.g. < 0 or > 1, are clamped to 0..1.

Definition at line 142 of file SceneView.h.

◆ viewportSize

SoSFVec2f SceneView::viewportSize

Viewport size (normalized device coordinates 0..1).

Default is 1,1. Illegal values, e.g. < 0 or > 1, are clamped to 0..1.

Definition at line 148 of file SceneView.h.


The documentation for this class was generated from the following file: