#include <NIS_InteractiveObject.hxx>
Inheritance diagram for NIS_InteractiveObject:
Public Member Functions | |
NIS_InteractiveObject () | |
virtual Standard_EXPORT | ~NIS_InteractiveObject () |
Standard_Integer | ID () const |
NIS_Drawer::DrawType | DrawType () const |
Standard_EXPORT const Handle_NIS_Drawer & | SetDrawer (const Handle_NIS_Drawer &theDrawer) |
const Handle_NIS_Drawer & | GetDrawer () const |
virtual Standard_EXPORT Handle_NIS_Drawer | DefaultDrawer () const =0 |
Standard_EXPORT const Bnd_B3f & | GetBox () |
Standard_Boolean | IsTransparent () const |
Standard_Boolean | IsHidden () const |
Standard_Boolean | IsDisplayed () const |
Standard_Boolean | IsDynHilighted () const |
Standard_EXPORT Standard_Boolean | IsSelectable () const |
Standard_EXPORT void | SetSelectable (const Standard_Boolean isSel=Standard_True) const |
Standard_Real | Transparency () const |
Standard_EXPORT void | SetTransparency (const Standard_Real theValue=0.6) |
void | UnsetTransparency () |
virtual Standard_EXPORT Standard_Real | Intersect (const gp_Ax1 &theAxis, const Standard_Real theOver) const =0 |
virtual Standard_EXPORT Standard_Boolean | Intersect (const Bnd_B3f &theBox, const gp_Trsf &theTrf, const Standard_Boolean isFull) const |
void | SetAttribute (void *theAttributePtr) |
void * | GetAttribute () const |
Protected Member Functions | |
void | setDrawerUpdate () const |
virtual Standard_EXPORT void | computeBox ()=0 |
Standard_Boolean | isUpdateBox () const |
void | setIsUpdateBox (const Standard_Boolean isUpdate) |
Protected Attributes | |
Bnd_B3f | myBox |
void * | myAttributePtr |
Private Member Functions | |
NIS_InteractiveObject (const NIS_InteractiveObject &theOther) | |
NIS_InteractiveObject & | operator= (const NIS_InteractiveObject &theOther) |
Private Attributes | |
Handle_NIS_Drawer | myDrawer |
Standard_Size | myID: 26 |
NIS_Drawer::DrawType | myDrawType: 2 |
Standard_Boolean | myIsHidden: 1 |
Standard_Boolean | myIsDynHilighted: 1 |
Standard_Boolean | myIsUpdateBox: 1 |
Standard_ShortReal | myTransparency |
Association with a Drawer instance is performed by method SetDrawer. This method should not be called by any custom code, it is used internally by NIS algorithms (in NIS_InteractiveContext::Display() for instance). If you develop your own InteractiveObject type, you will need to call SetDrawer whenever you change the visual aspect, for example:
void MyIOClass::SetColor (const Quantity_Color& theColor); { Handle(MyIOClassDrawer) aDrawer = new MyIOClassDrawer; // copy the current visual aspects and other attributes to the new Drawer aDrawer->Assign (GetDrawer()); // replace the Drawer aDrawer->myColor = theColor; SetDrawer (aDrawer); // optional: redraws the changed InteractiveObject in the views GetDrawer()->GetContext()->UpdateViews(); }
An instance of this class can have an associated value (Attribute) that is stored as a pointer. It can accommodate an integer/float/boolean value or a pointer to some structure. This attribute is NOT automatically destroyed with the InteractiveObject.
|
Empty constructor. Creates an object that is not attached to drawer. |
|
Destructor. |
|
|
|
Create a 3D bounding box of the object. Implemented in NIS_Surface, and NIS_Triangulated. |
|
Create a default drawer instance. Implemented in NIS_Surface, and NIS_Triangulated. |
|
Query the type of presentation. |
|
Query the associated custom (arbitrary) attribute pointer. |
|
Query a 3D bounding box of the object. |
|
Query the current drawer. |
|
Query the ID of the Object in its Context. |
|
Intersect the InteractiveObject geometry with an oriented box. The default implementation (in this abstract class) always returns True, signalling that every object pre-selected by its bounding box is automatically selected. The specializations should define a more correct behaviour. gp_Pnt aPnt = ..... // aPnt is part of our geometry. if (!theBox.IsOut (aPnt.Transformed(theTrf))) return Standard_True;
Reimplemented in NIS_Surface, and NIS_Triangulated. |
|
Intersect the InteractiveObject geometry with a line/ray.
Implemented in NIS_Surface, and NIS_Triangulated. |
|
Query the Displayed state - opposite to IsHidden(). |
|
Query the Dynamic Hilight state |
|
Query the Hidden state |
|
Query if the Object is selectable. |
|
Query the Transparent state. |
|
|
|
|
|
Set the pointer to custom (arbitrary) data associated with the Object. |
|
Replace the drawer. This method must not be called for Object that has not yet been added to a Context (thus has empty drawer).
|
|
|
|
|
|
Set or change the selectable state of the Object.
|
|
Set the Transparency factor. Reimplemented in NIS_Surface. |
|
Query the Transparency factor. |
|
Present the Object as opaque (Normal draw type). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|