Open CASCADE Technology
6.5.4
|
Abstract framework to define 3D sensitive entities.
As the selection process uses the principle of a
projection of 3D shapes onto a 2D view where
nearness to a rectangle determines whether a shape
is picked or not, all 3D shapes need to be converted
into 2D ones in order to be selected.
#include <Select3D_SensitiveEntity.hxx>
Public Member Functions | |
Standard_Boolean | NeedsConversion () const |
Returns true if this framework needs conversion. | |
Standard_Boolean | Is3D () const |
Returns true if this framework provides 3D information. | |
virtual void | Project (const Handle< Select3D_Projector > &aProjector) |
Returns the projector aProjector. In classes inheriting this framework, you must redefine this function in order to get a sensitive 2D rectangle from a 3D entity. This rectangle is the sensitive zone which makes the 3D entity selectable. | |
virtual Standard_Integer | MaxBoxes () const |
Returns the max number of sensitive areas returned by this class is 1 by default. Else on must redefine this method. | |
virtual Handle_Select3D_SensitiveEntity | GetConnected (const TopLoc_Location &aLocation) |
Originally this method intended to return sensitive entity with new location aLocation, but currently sensitive entities do not hold a location, instead HasLocation() and Location() methods call corresponding entity owner's methods. Thus all entities returned by GetConnected() share the same location propagated from corresponding selectable object. You must redefine this function for any type of sensitive entity which can accept another connected sensitive entity.//can be connected to another sensitive entity. | |
virtual Standard_Boolean | Matches (const Standard_Real X, const Standard_Real Y, const Standard_Real aTol, Standard_Real &DMin) |
Matches the coordinates X, Y with the entity found at that point within the tolerance aTol and the minimum depth DMin. You must redefine this function for every inheriting entity. You will have to call this framework inside the redefined function. | |
virtual Standard_Boolean | Matches (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real aTol) |
Matches the box defined by the coordinates Xmin, Ymin, Xmax, Ymax with the entity found at that point within the tolerance aTol. Xmin, YMin define the minimum point in the lower left hand corner of the box, and XMax, YMax define the maximum point in the upper right hand corner of the box. You must redefine this function for every inheriting entity. You will have to call this framework inside the redefined function. | |
virtual Standard_Boolean | Matches (const TColgp_Array1OfPnt2d &Polyline, const Bnd_Box2d &aBox, const Standard_Real aTol) |
prevents from hiding virtual methods... | |
gp_Lin | GetEyeLine (const Standard_Real X, const Standard_Real Y) const |
Returns the eye line for the point defined by the coordinates X,Y. | |
virtual Standard_Real | ComputeDepth (const gp_Lin &EyeLine) const =0 |
Returns the depth of this object on the line EyeLine. EyeLine goes through the eye towards a point defined by the coordinates X,Y in the function GetEyeLine. //! gives an abcissa on <aLin> . <aLin> represents the line going through the eye towards an X,Y point on the screen. This Method must return a mean Depth on this line. | |
virtual Standard_Real | Depth () const |
Sort Selected entities according to depth... | |
virtual Standard_Boolean | HasLocation () const |
Returns true if this framework has a location defined. | |
virtual const TopLoc_Location & | Location () const |
virtual void | ResetLocation () |
sets the location to Identity | |
virtual void | SetLocation (const TopLoc_Location &aLoc) |
virtual void | Dump (Standard_OStream &S, const Standard_Boolean FullDump=Standard_True) const |
2 options : <FullDump> = False -> general information <FullDump> = True -> whole informtion 3D +2d ... | |
void | UpdateLocation (const TopLoc_Location &aLoc) |
virtual void | SetLastPrj (const Handle< Select3D_Projector > &aPrj) |
Static Public Member Functions | |
static void | DumpBox (Standard_OStream &S, const Bnd_Box2d &abox) |
Protected Member Functions | |
Select3D_SensitiveEntity (const Handle< SelectBasics_EntityOwner > &OwnerId) | |
void | SetLastDepth (const Standard_Real aDepth) |
Protected Attributes | |
Handle_Select3D_Projector | mylastprj |
Select3D_SensitiveEntity::Select3D_SensitiveEntity | ( | const Handle< SelectBasics_EntityOwner > & | OwnerId | ) | [protected] |
virtual Standard_Real Select3D_SensitiveEntity::ComputeDepth | ( | const gp_Lin & | EyeLine | ) | const [pure virtual] |
Implemented in Select3D_SensitiveGroup, Select3D_SensitiveTriangulation, Select3D_SensitiveSegment, Select3D_SensitiveCircle, Select3D_SensitiveWire, Select3D_SensitiveBox, Select3D_SensitiveFace, Select3D_SensitiveCurve, MeshVS_SensitivePolyhedron, Select3D_SensitivePoint, Select3D_SensitiveTriangle, and MeshVS_SensitiveMesh.
virtual Standard_Real Select3D_SensitiveEntity::Depth | ( | ) | const [virtual] |
Reimplemented from SelectBasics_SensitiveEntity.
virtual void Select3D_SensitiveEntity::Dump | ( | Standard_OStream & | S, |
const Standard_Boolean | FullDump = Standard_True |
||
) | const [virtual] |
static void Select3D_SensitiveEntity::DumpBox | ( | Standard_OStream & | S, |
const Bnd_Box2d & | abox | ||
) | [static] |
virtual Handle_Select3D_SensitiveEntity Select3D_SensitiveEntity::GetConnected | ( | const TopLoc_Location & | aLocation | ) | [virtual] |
Reimplemented in Select3D_SensitiveCircle, Select3D_SensitiveGroup, Select3D_SensitiveTriangulation, Select3D_SensitiveSegment, Select3D_SensitiveTriangle, Select3D_SensitiveFace, Select3D_SensitiveCurve, Select3D_SensitiveBox, Select3D_SensitiveWire, MeshVS_SensitivePolyhedron, Select3D_SensitivePoint, and MeshVS_SensitiveMesh.
gp_Lin Select3D_SensitiveEntity::GetEyeLine | ( | const Standard_Real | X, |
const Standard_Real | Y | ||
) | const |
virtual Standard_Boolean Select3D_SensitiveEntity::HasLocation | ( | ) | const [virtual] |
Standard_Boolean Select3D_SensitiveEntity::Is3D | ( | ) | const [virtual] |
Implements SelectBasics_SensitiveEntity.
virtual const TopLoc_Location& Select3D_SensitiveEntity::Location | ( | ) | const [virtual] |
virtual Standard_Boolean Select3D_SensitiveEntity::Matches | ( | const Standard_Real | X, |
const Standard_Real | Y, | ||
const Standard_Real | aTol, | ||
Standard_Real & | DMin | ||
) | [virtual] |
Implements SelectBasics_SensitiveEntity.
Reimplemented in Select3D_SensitiveGroup, Select3D_SensitiveTriangulation, Select3D_SensitiveSegment, Select3D_SensitiveCircle, Select3D_SensitiveWire, Select3D_SensitiveBox, Select3D_SensitiveCurve, Select3D_SensitiveFace, MeshVS_SensitivePolyhedron, Select3D_SensitivePoint, MeshVS_SensitiveMesh, and Select3D_SensitiveTriangle.
virtual Standard_Boolean Select3D_SensitiveEntity::Matches | ( | const Standard_Real | XMin, |
const Standard_Real | YMin, | ||
const Standard_Real | XMax, | ||
const Standard_Real | YMax, | ||
const Standard_Real | aTol | ||
) | [virtual] |
Implements SelectBasics_SensitiveEntity.
Reimplemented in Select3D_SensitiveGroup, Select3D_SensitiveTriangulation, Select3D_SensitiveSegment, Select3D_SensitiveCircle, Select3D_SensitiveWire, Select3D_SensitiveBox, Select3D_SensitiveCurve, Select3D_SensitiveFace, MeshVS_SensitivePolyhedron, Select3D_SensitivePoint, MeshVS_SensitiveMesh, Select3D_SensitiveTriangle, MeshVS_SensitiveFace, and MeshVS_SensitiveSegment.
virtual Standard_Boolean Select3D_SensitiveEntity::Matches | ( | const TColgp_Array1OfPnt2d & | Polyline, |
const Bnd_Box2d & | aBox, | ||
const Standard_Real | aTol | ||
) | [virtual] |
Implements SelectBasics_SensitiveEntity.
Reimplemented in Select3D_SensitiveGroup, Select3D_SensitiveTriangulation, Select3D_SensitiveSegment, Select3D_SensitiveCircle, Select3D_SensitiveWire, Select3D_SensitiveBox, Select3D_SensitiveCurve, Select3D_SensitiveFace, MeshVS_SensitivePolyhedron, Select3D_SensitivePoint, MeshVS_SensitiveMesh, Select3D_SensitiveTriangle, MeshVS_SensitiveFace, and MeshVS_SensitiveSegment.
virtual Standard_Integer Select3D_SensitiveEntity::MaxBoxes | ( | ) | const [virtual] |
Implements SelectBasics_SensitiveEntity.
Reimplemented in Select3D_SensitiveSegment, Select3D_SensitiveGroup, and Select3D_SensitiveWire.
Standard_Boolean Select3D_SensitiveEntity::NeedsConversion | ( | ) | const [virtual] |
Implements SelectBasics_SensitiveEntity.
virtual void Select3D_SensitiveEntity::Project | ( | const Handle< Select3D_Projector > & | aProjector | ) | [virtual] |
Reimplemented in Select3D_SensitiveCircle, Select3D_SensitiveTriangulation, Select3D_SensitiveGroup, Select3D_SensitiveSegment, MeshVS_SensitiveMesh, Select3D_SensitiveBox, MeshVS_SensitivePolyhedron, Select3D_SensitiveWire, Select3D_SensitivePoint, Select3D_SensitivePoly, MeshVS_SensitiveFace, and MeshVS_SensitiveSegment.
virtual void Select3D_SensitiveEntity::ResetLocation | ( | ) | [virtual] |
Reimplemented in Select3D_SensitiveTriangulation, Select3D_SensitiveGroup, and Select3D_SensitiveWire.
void Select3D_SensitiveEntity::SetLastDepth | ( | const Standard_Real | aDepth | ) | [protected] |
virtual void Select3D_SensitiveEntity::SetLastPrj | ( | const Handle< Select3D_Projector > & | aPrj | ) | [virtual] |
Reimplemented in Select3D_SensitiveGroup, and Select3D_SensitiveWire.
virtual void Select3D_SensitiveEntity::SetLocation | ( | const TopLoc_Location & | aLoc | ) | [virtual] |
Reimplemented in Select3D_SensitiveTriangulation, Select3D_SensitiveGroup, and Select3D_SensitiveWire.
Handle_Select3D_Projector Select3D_SensitiveEntity::mylastprj [protected] |