OCC Main Page | Visualization | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Visualization
TKNIS
NIS


NIS_View Class Reference

#include <NIS_View.hxx>

Inheritance diagram for NIS_View:

Inheritance graph
[legend]

Public Member Functions

Standard_EXPORT NIS_View (const Handle_V3d_Viewer &theViewer, const Handle_Aspect_Window &theWindow=NULL)
Standard_EXPORT void SetWindow (const Handle_Aspect_Window &theWindow)
Standard_EXPORT void FitAll3d ()
Standard_EXPORT void DynamicHilight (const Standard_Integer theX, const Standard_Integer theY)
Standard_EXPORT void DynamicUnhilight (const Handle_NIS_InteractiveObject &)
Standard_EXPORT void Select (const Standard_Integer theX, const Standard_Integer theY, const Standard_Boolean isForceMult=Standard_False)
Standard_EXPORT void Select (const Standard_Integer theXmin, const Standard_Integer theYmin, const Standard_Integer theXmax, const Standard_Integer theYmax, const Standard_Boolean isForceMult=Standard_False, const Standard_Boolean isFullyIncluded=Standard_False)
Standard_EXPORT Handle_NIS_InteractiveObject Pick (const Standard_Integer theX, const Standard_Integer theY) const
Standard_EXPORT Handle_NIS_InteractiveObject Pick (const gp_Ax1 &theAxis, const Standard_Real theOver, const Standard_Boolean isOnlySelectable) const

Protected Member Functions

Standard_EXPORT void AddContext (NIS_InteractiveContext *)
Standard_EXPORT void RemoveContext (NIS_InteractiveContext *)

Static Protected Member Functions

static int MyCallback (Aspect_Drawable, void *, Aspect_GraphicCallbackStruct *)

Private Attributes

NCollection_List< NIS_InteractiveContext * > myContexts
Handle_NIS_InteractiveObject myDynHilighted

Detailed Description

Manager of a single window with OpenGL context, used by one or more NIS_InteractiveContext instances. This class inherits V3d_OrthograpicView therefore its instances can be used to display any object that is normally handled by Graphic3d/V3d/AIS classes. Also the standard view operations: Pan, Rotate, Zoom, mouse API, etc. are supported due to this inheritance.

The new services added by this class is the visualisation of NIS_InteractiveObject (i.e., accommodation of NIS_InteractiveContext instances). This visualisation is done by the method MyCallback that is called just before redrawing the scene by Graphic3d/OpenGl drivers.

The View instance can be understood as a collector of several interactive contexts that exist independently (do not interfere) though they output into the same OpenGL context. The contexts are:

The list of associated NIS_InteractiveContext can be modified by methods AddContext and RemoveContext.


Constructor & Destructor Documentation

Standard_EXPORT NIS_View::NIS_View const Handle_V3d_Viewer &  theViewer,
const Handle_Aspect_Window &  theWindow = NULL
 

Attach the view to the window.


Member Function Documentation

Standard_EXPORT void NIS_View::AddContext NIS_InteractiveContext  )  [protected]
 

Register an interactive context for this view.

Standard_EXPORT void NIS_View::DynamicHilight const Standard_Integer  theX,
const Standard_Integer  theY
 

Set or unset the dynamically hilighted object, depending on the given mouse coordinates.

Standard_EXPORT void NIS_View::DynamicUnhilight const Handle_NIS_InteractiveObject &   ) 
 

Unhilights the hilighted object if it coincides with the given object instance.

Standard_EXPORT void NIS_View::FitAll3d  ) 
 

Zoom the view to fit to visible objects size and positions.

static int NIS_View::MyCallback Aspect_Drawable  ,
void *  ,
Aspect_GraphicCallbackStruct
[static, protected]
 

Standard_EXPORT Handle_NIS_InteractiveObject NIS_View::Pick const gp_Ax1 &  theAxis,
const Standard_Real  theOver,
const Standard_Boolean  isOnlySelectable
const
 

Interactive selection by mouse click. Selection itself is performed in each Interactive Context attached to this View, accordingto the local parameters (mode, filter) of selection in each context.

Parameters:
theAxis 3D axis for objects selection
theOver Overlap for the selecting axis
isOnlySelectable If False, any displayed object can be picked, otherwise only selectable ones.
Returns:
the selected object picked by the minimal intersection distance among all contexts attached to this View.

Standard_EXPORT Handle_NIS_InteractiveObject NIS_View::Pick const Standard_Integer  theX,
const Standard_Integer  theY
const
 

Interactive selection by mouse click. Selection itself is performed in each Interactive Context attached to this View, accordingto the local parameters (mode, filter) of selection in each context.

Parameters:
theX X coordinate of mouse pointer in the window.
theY Y coordinate of mouse pointer in the window.
Returns:
the selected object picked by the minimal intersection distance among all contexts attached to this View.

Standard_EXPORT void NIS_View::RemoveContext NIS_InteractiveContext  )  [protected]
 

Detach an interactive context from this view.

Standard_EXPORT void NIS_View::Select const Standard_Integer  theXmin,
const Standard_Integer  theYmin,
const Standard_Integer  theXmax,
const Standard_Integer  theYmax,
const Standard_Boolean  isForceMult = Standard_False,
const Standard_Boolean  isFullyIncluded = Standard_False
 

Set or unset the selected (hilighted) state of the objects that are intersected by 2D box in the view

Parameters:
theXmin left X coordinate of the view window
theYmin lower Y coordinate of the view window
theXmax right X coordinate of the view window
theYmax upper Y coordinate of the view window
isForceMult True if the effect of multi-Selection should be forced (e.g., when Shift is pressed).
isFullyIncluded True if only those objects are processed that are fully inside the selection rectangle. False if objects fully or partially included in the rectangle are processed.

Standard_EXPORT void NIS_View::Select const Standard_Integer  theX,
const Standard_Integer  theY,
const Standard_Boolean  isForceMult = Standard_False
 

Set or unset the selected (hilighted) state of the object that is under the coordinates theX, theY.

Parameters:
theX X coordinate of the view window
theX X coordinate of the view window
isForceMult True if the effect of multi-Selection should be forced (e.g., when Shift is pressed).

Standard_EXPORT void NIS_View::SetWindow const Handle_Aspect_Window &  theWindow  ) 
 

Attach the view to the window.


Field Documentation

NCollection_List<NIS_InteractiveContext *> NIS_View::myContexts [private]
 

Handle_NIS_InteractiveObject NIS_View::myDynHilighted [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:55:54 2008 for OpenCASCADE by  doxygen 1.4.1