Open CASCADE Technology 6.6.0
|
#include <NIS_View.hxx>
Public Member Functions | |
NIS_View (const Handle_V3d_Viewer &theViewer, const Handle_Aspect_Window &theWindow=NULL) | |
void | SetWindow (const Handle_Aspect_Window &theWindow) |
void | SetHilightOnTop (const Standard_Boolean theTop=Standard_True) |
void | SetDynHilightSelected (const Standard_Boolean theHilight=Standard_True) |
Standard_Boolean | FitAll3d (const Quantity_Coefficient theCoef=0.01) |
Bnd_B3f | GetBndBox () const |
void | GetBndBox (Standard_Integer &theXMin, Standard_Integer &theXMax, Standard_Integer &theYMin, Standard_Integer &theYMax) const |
void | DynamicHilight (const Standard_Integer theX, const Standard_Integer theY) |
void | DynamicUnhilight (const Handle_NIS_InteractiveObject &) |
void | DynamicUnhilight () |
void | Select (const Standard_Integer theX, const Standard_Integer theY, const Standard_Boolean isForceMult=Standard_False, const Standard_Boolean theRedraw=Standard_True) |
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, const Standard_Boolean theRedraw=Standard_True) |
void | Select (const NCollection_List< gp_XY > &thePolygon, const Standard_Boolean isForceMult=Standard_False, const Standard_Boolean isFullyIncluded=Standard_False, const Standard_Boolean theRedraw=Standard_True) |
Handle_NIS_InteractiveObject | Pick (const Standard_Integer theX, const Standard_Integer theY) |
Handle_NIS_InteractiveObject | Pick (const gp_Ax1 &theAxis, const Standard_Real theOver, const Standard_Boolean isOnlySel) |
NCollection_Vector < NIS_InteractiveObject * > | GetDetected () const |
TColStd_PackedMapOfInteger & | GetExListId () |
Protected Member Functions | |
void | AddContext (NIS_InteractiveContext *) |
void | RemoveContext (NIS_InteractiveContext *) |
Static Protected Member Functions | |
static int | MyCallback (Aspect_Drawable, void *, Aspect_GraphicCallbackStruct *) |
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.
NIS_View::NIS_View | ( | const Handle_V3d_Viewer & | theViewer, |
const Handle_Aspect_Window & | theWindow = NULL |
||
) |
Attach the view to the window.
void NIS_View::AddContext | ( | NIS_InteractiveContext * | ) | [protected] |
Register an interactive context for this view.
void NIS_View::DynamicHilight | ( | const Standard_Integer | theX, |
const Standard_Integer | theY | ||
) |
Destructor. Set or unset the dynamically hilighted object, depending on the given mouse coordinates.
void NIS_View::DynamicUnhilight | ( | const Handle_NIS_InteractiveObject & | ) |
Unhilights the hilighted object if it coincides with the given object instance.
void NIS_View::DynamicUnhilight | ( | ) | [inline] |
Unhilights the currently hilighted object.
Standard_Boolean NIS_View::FitAll3d | ( | const Quantity_Coefficient | theCoef = 0.01 | ) |
Zoom the view to fit to visible objects size and positions.
theCoef | Relative margin in both X and Y dimensions. For example, value 1.0 will fit to twice the actual size. |
Bnd_B3f NIS_View::GetBndBox | ( | ) | const |
Gets bounding box covering objects displayed in viewer.
void NIS_View::GetBndBox | ( | Standard_Integer & | theXMin, |
Standard_Integer & | theXMax, | ||
Standard_Integer & | theYMin, | ||
Standard_Integer & | theYMax | ||
) | const |
Gets bounding box covering objects displayed in viewer. If operation is fails when Xmax < Xmin abd Ymax < Ymin
NCollection_Vector<NIS_InteractiveObject *> NIS_View::GetDetected | ( | ) | const [inline] |
Gets all objects detected by last call of Pick() method
TColStd_PackedMapOfInteger& NIS_View::GetExListId | ( | ) | [inline] |
Obtain the IDs of ex-lists.
static int NIS_View::MyCallback | ( | Aspect_Drawable | , |
void * | , | ||
Aspect_GraphicCallbackStruct * | |||
) | [static, protected] |
Handle_NIS_InteractiveObject NIS_View::Pick | ( | const Standard_Integer | theX, |
const Standard_Integer | theY | ||
) |
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.
theX | X coordinate of mouse pointer in the window. |
theY | Y coordinate of mouse pointer in the window. |
Handle_NIS_InteractiveObject NIS_View::Pick | ( | const gp_Ax1 & | theAxis, |
const Standard_Real | theOver, | ||
const Standard_Boolean | isOnlySel | ||
) |
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.
theAxis | 3D axis for objects selection |
theOver | Overlap for the selecting axis |
isOnlySel | If False, any displayed object can be picked, otherwise only selectable ones. |
void NIS_View::RemoveContext | ( | NIS_InteractiveContext * | ) | [protected] |
Detach an interactive context from this view.
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 , |
||
const Standard_Boolean | theRedraw = Standard_True |
||
) |
Set or unset the selected (hilighted) state of the objects that are intersected by 2D box in the view
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. |
theRedraw | True to redraw view automatically (default value). |
void NIS_View::Select | ( | const Standard_Integer | theX, |
const Standard_Integer | theY, | ||
const Standard_Boolean | isForceMult = Standard_False , |
||
const Standard_Boolean | theRedraw = Standard_True |
||
) |
Set or unset the selected (hilighted) state of the object that is under the coordinates theX, theY.
theX | X coordinate of the view window |
theY | X coordinate of the view window |
isForceMult | True if the effect of multi-Selection should be forced (e.g., when Shift is pressed). |
theRedraw | True to redraw view automatically (default value). |
void NIS_View::Select | ( | const NCollection_List< gp_XY > & | thePolygon, |
const Standard_Boolean | isForceMult = Standard_False , |
||
const Standard_Boolean | isFullyIncluded = Standard_False , |
||
const Standard_Boolean | theRedraw = Standard_True |
||
) |
Set or unset the selected (hilighted) state of the objects that are intersected by 2D polygon in the view
thePolygon | defines the vertices of a free-form closed polygon without self-intersections. The last point should not coincide with the first point of the list. Points are interpreted as X and Y integer coordinates of the view window. Any two neighbor points should not be confused. |
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. |
theRedraw | True to redraw view automatically (default value). |
void NIS_View::SetDynHilightSelected | ( | const Standard_Boolean | theHilight = Standard_True | ) | [inline] |
Indicate whether to hilight selected object dynamically By default dynamic hilight works on all objects independently on its selected/non-selected state. This behaviour differs from the behaviour of AIS interactive context, that doesn't hilight dynamically (on mouse movements) selected objects. In the case both context are used in the same view the behaviour of both context can be made consistent by setting this flag to False
void NIS_View::SetHilightOnTop | ( | const Standard_Boolean | theTop = Standard_True | ) | [inline] |
Indicate whether to draw hilighted objects on top of all other ones
void NIS_View::SetWindow | ( | const Handle_Aspect_Window & | theWindow | ) |
Attach the view to the window.