Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
PoBaseView Class Reference

VSG extension Abstract base class for views. More...

#include <Inventor/Gui/view/PoBaseView.h>

+ Inheritance diagram for PoBaseView:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
virtual const SoNodekitCataloggetNodekitCatalog () const
 Returns the SoNodekitCatalog for this instance.
 
SbBool isPointWithinViewport (float x, float y) const
 Indicates if a point defined in the normalized space [0-1]x[0-1] is in the viewport of the view.
 
void setCamera (SoGuiViewer *viewer)
 Sets the camera of the view on the viewer.
 
void sensitiveOnEvents (SbBool flag)
 Specifies if the view is sensitive to events.
 
SbBool isSensitiveOnEvents () const
 Returns true if the view is sensitive to events.
 
- Public Member Functions inherited from SoBaseKit
 SoBaseKit ()
 Constructor.
 
virtual SoNodegetPart (const SbName &partName, SbBool makeIfNeeded)
 Searches the nodekit catalog (and those of all nested nodekits) for the part named partName.
 
template<typename PartType >
PartType * getPart (const SbName &partName)
 Like getPart(const SbName&,SbBool) but casts the returned part to the specified type and sets the makeIfNeeded parameter to TRUE.
 
template<typename PartType >
PartType * checkPart (const SbName &partName)
 Like getPart(const SbName&,SbBool) but casts the returned part to the specified type and sets the makeIfNeeded parameter to FALSE.
 
SbString getPartString (const SoBase *part)
 Given a node or a path to a node, checks if the part exists in the nodekit, in a nested nodekit, or an element of a list part.
 
virtual SoNodeKitPathcreatePathToPart (const SbName &partName, SbBool makeIfNeeded, const SoPath *pathToExtend=NULL)
 Returns a path that begins at this nodekit and ends at partName.
 
virtual SbBool setPart (const SbName &partName, SoNode *newPart)
 Inserts the given node (not a copy) as the new part specified by partName.
 
SoNONUNICODE SbBool set (char *nameValuePairListString)
 This function allows field values of parts (nodes) to be set in several different parts simultaneously.
 
SbBool set (const SbString &nameValuePairListString)
 This function allows field values of parts (nodes) to be set in several different parts simultaneously.
 
SoNONUNICODE SbBool set (const char *partNameString, const char *parameterString)
 This function allows field values of parts (nodes) to be set.
 
SbBool set (const SbString &partNameString, const SbString &parameterString)
 This function allows field values of parts (nodes) to be set.
 
- 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 SbBool affectsState () const
 Returns TRUE if a node has an effect on the state during traversal.
 
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.
 
- Public Member Functions inherited from SoGetView
 SoGetView ()
 Default constructor.
 
virtual ~SoGetView ()
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for this class.
 
static PoBaseViewgetView (SoGuiViewer *viewer, int mouseX, int mouseY)
 Returns the view (if any) that contains the given mouse cursor position.
 
Deprecated
static SoDEPRECATED SbBool viewingEventCB (void *viewer, void *anyEvent)
 The callback is automatically registered in the So<XXX>Viewer classes.
 
- Static Public Member Functions inherited from SoBaseKit
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for the class SoBaseKit.
 
static void setSearchingChildren (SbBool newVal)
 Sets if nodekit children are searched during SoSearchAction traversal.
 
static SbBool isSearchingChildren ()
 Returns TRUE if nodekit children are searched during SoSearchAction traversal.
 
- 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
 Lower-left corner coordinates of the viewport of the view.
 
SoSFVec2f viewportSize
 Size of the viewport of the view.
 
- Public Attributes inherited from SoBaseKit
SoSFBool boundingBoxIgnoring
 Whether to ignore this node during bounding box traversal.
 

Detailed Description

VSG extension Abstract base class for views.

Views allow the application to specify multiple cameras, each with its own separate viewport (region of the 3D window). This is more powerful than just using multiple SoCamera nodes, because camera nodes do not allow specifying a viewport (the viewport is always the full window).

In addition, when mouse event locations are mapped back into 3D space, Open Inventor automatically uses the view volume of the camera associated with the view whose viewport currently contains the mouse cursor.

Views can be used to efficiently create the effect of multiple windows, without the overhead and system dependent code to manage multiple windows. For example, views can be used to subdivide the window into multiple independent views of a 3D scene or to create an inset "bird's eye" view inside the window.

Basically, a view consists of a camera (specifically an SoCameraKit) and a viewport attached to this camera. The viewport is the region of the graphics window in which the scene graph will be rendered.

NOTES:

  • If you use a viewer, you should call the method SoBaseKit::setSearchingChildren(TRUE) to allow the viewer to search for cameras inside nodekits (like this one).
  • Do not place a camera node before this nodekit.
  • Create a camera for each view and set it using the setPart method. See example in PoSceneView.
  • When you use HardCopy, the graphics window is the paper sheet.
  • SoGui::init() needs to be called in order to initialize this class (this is done automatically if you use SoXt, SoWin or SoQt).

LIMITATIONS:

  • The field SoCamera::viewportMapping must be equal to ADJUST_CAMERA in order to have a correct vectorisation when you use
    HardCopy,
  • Do not use the SoBoxHighlightRenderAction class on a scene graph which contains a view,
  • Do not push view,
  • Be careful when you use the method viewAll() of the class SoXtViewer, because this method works on the entire scene graph and not on a portion of a scene graph. Overload this method according to your requirements,
  • Some of the viewer functions/buttons do not work correctly with views.
    For example, saveHomePosition() and resetToHomePosition() do not work correctly because the viewer only stores one copy of the camera.
  • The viewer rendering options, e.g. wireframe, apply to ALL views inside the viewer. You can implement these effects per-view using an SoDrawStyle node and setOverride() if necessary.

CHANGES:

  • Since Open Inventor 8.1, PoBaseView and related classes (PoView, PoSceneView) have been moved from MeshViz into core Open Inventor.
  • Since Open Inventor 8.1, the callback viewingEventCB no longer needs to be registered. This is now done automatically in the So<XXX>Viewer classes.

ACTION BEHAVIOR

SEE ALSO

PoView, PoSceneView

Definition at line 100 of file PoBaseView.h.

Member Function Documentation

◆ getClassNodekitCatalog()

static const SoNodekitCatalog * PoBaseView::getClassNodekitCatalog ( )
static

Returns the SoNodekitCatalog for this class.

◆ getClassTypeId()

static SoType PoBaseView::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getNodekitCatalog()

virtual const SoNodekitCatalog * PoBaseView::getNodekitCatalog ( ) const
virtual

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoBaseKit.

Reimplemented in PoSceneView, and PoView.

◆ getTypeId()

virtual SoType PoBaseView::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoBaseKit.

Reimplemented in PoSceneView, and PoView.

◆ getView()

static PoBaseView * PoBaseView::getView ( SoGuiViewer viewer,
int  mouseX,
int  mouseY 
)
static

Returns the view (if any) that contains the given mouse cursor position.

If the viewports of multiple views overlap, the chosen view is the last view drawn (i.e. last view node traversed). Only a sensitive view (see sensitiveOnEvents() method) can be selected, others are ignored during the search. (See Chapter 10 of the Open Inventor Mentor, page 266-268, for the method for getting mouse coordinates).

Note: For portability, this method does not take a system dependent viewer class, e.g. SoXtViewer, as its parameter. The SoGuiViewer associated with a viewer can be retrieved using the viewer's getGuiViewer() method.

◆ isPointWithinViewport()

SbBool PoBaseView::isPointWithinViewport ( float  x,
float  y 
) const

Indicates if a point defined in the normalized space [0-1]x[0-1] is in the viewport of the view.

◆ isSensitiveOnEvents()

SbBool PoBaseView::isSensitiveOnEvents ( ) const
inline

Returns true if the view is sensitive to events.

Definition at line 155 of file PoBaseView.h.

◆ sensitiveOnEvents()

void PoBaseView::sensitiveOnEvents ( SbBool  flag)
inline

Specifies if the view is sensitive to events.

Default is false.

Definition at line 149 of file PoBaseView.h.

◆ setCamera()

void PoBaseView::setCamera ( SoGuiViewer viewer)

Sets the camera of the view on the viewer.

(This method is equivalent to: viewer->setCamera(camera) with camera being the camera of the view).

Note: For portability, this method does not take a system dependent viewer class, e.g. SoXtViewer, as its parameter. The SoGuiViewer associated with a viewer can be retrieved using the viewer's getGuiViewer() method.

◆ viewingEventCB()

static SoDEPRECATED SbBool PoBaseView::viewingEventCB ( void *  viewer,
void *  anyEvent 
)
inlinestatic

The callback is automatically registered in the So<XXX>Viewer classes.

Definition at line 181 of file PoBaseView.h.

Member Data Documentation

◆ viewportOrigin

SoSFVec2f PoBaseView::viewportOrigin

Lower-left corner coordinates of the viewport of the view.


These coordinates must be given in the normalized space [0-1]*[0-1]. The coordinate (0,0) is the lower- left corner of the display window and (1,1) is the upper-right corner. Default is 0,0.

Definition at line 116 of file PoBaseView.h.

◆ viewportSize

SoSFVec2f PoBaseView::viewportSize

Size of the viewport of the view.


viewportSize[0] is the viewport's width and viewportSize[1] is the viewport's height, each in normalized space. Therefore viewportOrigin[0]+viewportSize[0] and viewportOrigin[1]+viewportSize[1] must be less than or equal to 1. Default is 1,1.

Definition at line 126 of file PoBaseView.h.


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