Open CASCADE Technology 6.6.0
|
Defines an Interactive Object through a connection to
another Interactive Object, which serves as a
reference, and which is located elsewhere in the viewer.
This allows you to use the Connected Interactive
Object without having to recalculate presentation,
selection or graphic structure. These are deduced
from your reference object.
The relation between the connected interactive object
and its source is generally one of geometric transformation.
AIS_ConnectedInteractive class doesn't support selection
modes different from 0. Descendants should redefine ComputeSelection()
method in order to handle other selection modes and generate connected
sensitive entities properly. Refer to AIS_ConnectedShape class
for exisiting implementation of a connected interactive object
for AIS_Shape that supports all standard sub-shape selection modes.
Warning
An Interactive entity which is view (or projector)
dependent requires recalculation of views in hidden
parts mode depending on the position of the
projector in each view. You should derive the entity's
inheritance from ConnectedInteractive and redefine
its compute method to enable this type of calculation.
#include <AIS_ConnectedInteractive.hxx>
Public Member Functions | |
AIS_ConnectedInteractive (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d=PrsMgr_TOP_AllView) | |
Disconnects the previous view and sets highlight mode to 0. This highlights the wireframe presentation aTypeOfPresentation3d. Top_AllView deactivates hidden line removal. | |
virtual AIS_KindOfInteractive | Type () const |
Returns KOI_Object | |
virtual Standard_Integer | Signature () const |
Returns 1 | |
virtual void | Connect (const Handle< AIS_InteractiveObject > &anotherIObj) |
Establishes the connection between the Connected Interactive Object, anotherIobj, and its reference entity. If a previous connection with an Interactive Object already exists, it is removed by Disconnect. The second syntax also initiates the location of the Connected Interactive Object. | |
virtual void | Connect (const Handle< AIS_InteractiveObject > &anotherIobj, const TopLoc_Location &aLocation) |
Standard_Boolean | HasConnection () const |
Returns true if there is a connection established between the presentation and its source reference. | |
const Handle_AIS_InteractiveObject & | ConnectedTo () const |
Returns the connection with the reference Interactive Object. | |
void | Disconnect () |
Clears the connection with a source reference. The presentation will no longer be displayed. Warning Must be done before deleting the presentation. | |
virtual void | Compute (const Handle< Prs3d_Projector > &aProjector, const Handle< Geom_Transformation > &aTrsf, const Handle< Prs3d_Presentation > &aPresentation) |
Computes the presentation according to a point of view given by <aProjector>. To be Used when the associated degenerated Presentations have been transformed by <aTrsf> which is not a Pure Translation. The HLR Prs can't be deducted automatically WARNING :<aTrsf> must be applied to the object to display before computation !!! | |
virtual void | Compute (const Handle< Prs3d_Projector > &aProjector, const Handle< Prs3d_Presentation > &aPresentation) |
Calculates the 3D view aPresentation and its updates. The latter are managed by aPresentationManager. Each of the views in the viewer and every modification such as rotation, for example, entails recalculation. It must be redefined to implement hidden line removal for the object. The user never calls this method himself. This is done via the InteractiveContext object and is dependent on the point of view from which the object is displayed. | |
virtual Standard_Boolean | AcceptShapeDecomposition () const |
Informs the graphic context that the interactive Object may be decomposed into sub-shapes for dynamic selection. The most used Interactive Object is AIS_Shape. Activation methods for standard selection modes are proposed in the Interactive Context. These include selection by vertex or by edges. For datums with the same behavior as AIS_Shape, such as vetices and edges, we must redefine the virtual method so that AcceptShapeDecomposition returns false. Rule for selection : Mode 0 : Selection of the interactive Object itself Mode 1 : Selection of vertices Mode 2 : Selection Of Edges Mode 3 : Selection Of Wires Mode 4 : Selection Of Faces ... | |
virtual void | UpdateLocation () |
Recomputes the location of the selection aSelection. | |
virtual void | UpdateLocation (const Handle< SelectMgr_Selection > &aSel) |
For this class, the location effect is treated in the compute & computeSelection methods. So the UpdateLocation Methods are redefined to do nothing else | |
Protected Attributes | |
Handle_AIS_InteractiveObject | myReference |
Handle_AIS_InteractiveObject | myOldReference |
AIS_ConnectedInteractive::AIS_ConnectedInteractive | ( | const PrsMgr_TypeOfPresentation3d | aTypeOfPresentation3d = PrsMgr_TOP_AllView | ) |
virtual Standard_Boolean AIS_ConnectedInteractive::AcceptShapeDecomposition | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in AIS_ConnectedShape.
virtual void AIS_ConnectedInteractive::Compute | ( | const Handle< Prs3d_Projector > & | aProjector, |
const Handle< Geom_Transformation > & | aTrsf, | ||
const Handle< Prs3d_Presentation > & | aPresentation | ||
) | [virtual] |
Reimplemented from PrsMgr_PresentableObject.
virtual void AIS_ConnectedInteractive::Compute | ( | const Handle< Prs3d_Projector > & | aProjector, |
const Handle< Prs3d_Presentation > & | aPresentation | ||
) | [virtual] |
Reimplemented from PrsMgr_PresentableObject.
virtual void AIS_ConnectedInteractive::Connect | ( | const Handle< AIS_InteractiveObject > & | anotherIObj | ) | [virtual] |
Reimplemented in AIS_ConnectedShape.
virtual void AIS_ConnectedInteractive::Connect | ( | const Handle< AIS_InteractiveObject > & | anotherIobj, |
const TopLoc_Location & | aLocation | ||
) | [virtual] |
Reimplemented in AIS_ConnectedShape.
const Handle_AIS_InteractiveObject& AIS_ConnectedInteractive::ConnectedTo | ( | ) | const |
void AIS_ConnectedInteractive::Disconnect | ( | ) |
Standard_Boolean AIS_ConnectedInteractive::HasConnection | ( | ) | const |
virtual Standard_Integer AIS_ConnectedInteractive::Signature | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in AIS_ConnectedShape.
virtual AIS_KindOfInteractive AIS_ConnectedInteractive::Type | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in AIS_ConnectedShape.
virtual void AIS_ConnectedInteractive::UpdateLocation | ( | ) | [virtual] |
Reimplemented from SelectMgr_SelectableObject.
virtual void AIS_ConnectedInteractive::UpdateLocation | ( | const Handle< SelectMgr_Selection > & | aSel | ) | [virtual] |
Reimplemented from SelectMgr_SelectableObject.
Handle_AIS_InteractiveObject AIS_ConnectedInteractive::myOldReference [protected] |
Handle_AIS_InteractiveObject AIS_ConnectedInteractive::myReference [protected] |