Class PoView
- java.lang.Object
-
- All Implemented Interfaces:
SafeDisposable
public class PoView extends PoBaseView
Class to define a view. This class allows the user to define a "view".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 (specified with an
SoCameraKit
) and a viewport (specified using the fields of this node). The viewport is the region of the graphics window in which the scene graph will be rendered.A To define a view, set the fields
viewportOrigin
andviewportSize
to the desired viewport position and size in normalized device coordinates [0..1], then configure the camera (set the part cameraKit). All shape nodes placed after this node will be drawn using the specified camera and viewport. You can define as many views as you want.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.
- 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 andsetOverride()
if necessary.
File format/default:
PoView
{viewportOrigin 0 0 viewportSize 1 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <link REL="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> <title></title> </head> <BODY> <h1></h1> <h4> <A NAME="Heading1256">CATALOG PARTS</A></h4> <ul><b>PoView</b> {</ul> <ul><ul><b>Camera</b> <tt>cameraKit </tt>(from PoBaseView)</ul></ul> <ul><ul><i>Corresponds to the camera of the view specified by the user.</i></ul></ul> <ul>}<br> <br> </ul> </body> </html>
-
-
Nested Class Summary
-
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 inherited from class com.openinventor.inventor.gui.view.PoBaseView
viewportOrigin, viewportSize
-
Fields inherited from class com.openinventor.inventor.nodekits.SoBaseKit
boundingBoxIgnoring
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description PoView()
Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SoNodekitCatalog
getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.-
Methods inherited from class com.openinventor.inventor.gui.view.PoBaseView
isPointWithinViewport, isSensitiveOnEvents, sensitiveOnEvents
-
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
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Method Detail
-
getClassNodekitCatalog
public static SoNodekitCatalog getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.
-
-