- All Implemented Interfaces:
public class PoBaseView extends SoBaseKitAbstract 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
SoCameranodes, 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.
- 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
- When you use HardCopy, the graphics window is the paper sheet.
- The field
SoCamera.viewportMappingmust be equal to ADJUST_CAMERA in order to have a correct vectorisation when you use HardCopy,
- Do not use the
SoBoxHighlightRenderActionclass 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
- Since Open Inventor 8.1,
PoBaseViewand related classes (
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.
Fields Modifier and Type Field Description
viewportOriginLower-left corner coordinates of the viewport of the view.
viewportSizeSize of the viewport of the view.
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description
SoNodekitCatalogfor this class.
isPointWithinViewport(float x, float y)Indicates if a point defined in the normalized space [0-1]x[0-1] is in the viewport of the view.
isSensitiveOnEvents()Returns true if the view is sensitive to events.
sensitiveOnEvents(boolean flag)Specifies if the view is sensitive to events.
Methods inherited from class com.openinventor.inventor.nodekits.SoBaseKit
getNodekitCatalog, getPart, getPart, getPartString, getViewportIsEnabled, getViewportOrigin, getViewportSize, isSearchingChildren, set, set, setPart, setSearchingChildren
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, setToDefaults
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
public final SoSFVec2f viewportOriginLower-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.
public final SoSFVec2f viewportSizeSize of the viewport of the view.
viewportSize is the viewport's width and viewportSize is the viewport's height, each in normalized space. Therefore viewportOrigin+viewportSize and viewportOrigin+viewportSize must be less than or equal to 1. Default is 1,1.
public void sensitiveOnEvents(boolean flag)Specifies if the view is sensitive to events. Default is false.
public boolean isSensitiveOnEvents()Returns true if the view is sensitive to events.
public boolean isPointWithinViewport(float x, float y)Indicates if a point defined in the normalized space [0-1]x[0-1] is in the viewport of the view.