summaryrefslogtreecommitdiff
path: root/inc/Select3D_SensitiveEntity.hxx
blob: f91b02801e42f27d84cbc7e81d842b08638d2c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _Select3D_SensitiveEntity_HeaderFile
#define _Select3D_SensitiveEntity_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_Select3D_SensitiveEntity_HeaderFile
#include <Handle_Select3D_SensitiveEntity.hxx>
#endif

#ifndef _Handle_Select3D_Projector_HeaderFile
#include <Handle_Select3D_Projector.hxx>
#endif
#ifndef _Standard_ShortReal_HeaderFile
#include <Standard_ShortReal.hxx>
#endif
#ifndef _SelectBasics_SensitiveEntity_HeaderFile
#include <SelectBasics_SensitiveEntity.hxx>
#endif
#ifndef _Handle_SelectBasics_EntityOwner_HeaderFile
#include <Handle_SelectBasics_EntityOwner.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif
class Select3D_Projector;
class SelectBasics_EntityOwner;
class TopLoc_Location;
class TColgp_Array1OfPnt2d;
class Bnd_Box2d;
class gp_Lin;


//!  Abstract framework to define 3D sensitive entities. <br>
//! As the selection process uses the principle of a <br>
//! projection of 3D shapes onto a 2D view where <br>
//! nearness to a rectangle determines whether a shape <br>
//! is picked or not, all 3D shapes need to be converted <br>
//! into 2D ones in order to be selected. <br>
class Select3D_SensitiveEntity : public SelectBasics_SensitiveEntity {

public:

  //! Returns true if this framework needs conversion. <br>
        Standard_Boolean NeedsConversion() const;
  //! Returns true if this framework provides 3D information. <br>
  Standard_EXPORT     Standard_Boolean Is3D() const;
  //!Returns the projector aProjector. <br>
//!	 In classes inheriting this framework, you must <br>
//! redefine this function in order to get a sensitive 2D <br>
//! rectangle from a 3D entity. This rectangle is the <br>
//! sensitive zone which makes the 3D entity selectable. <br>
  Standard_EXPORT   virtual  void Project(const Handle(Select3D_Projector)& aProjector) ;
  //! Returns the max number of sensitive areas returned <br>
//!          by this class is 1 by default. <br>
//!          Else on must redefine this method. <br>
  Standard_EXPORT   virtual  Standard_Integer MaxBoxes() const;
  //! Returns the sensitive entity found at the location  aLocation. <br>
//! You must redefine this function for any type of <br>
//! sensitive entity which can accept another connected <br>
//! sensitive entity.//can be connected to another sensitive entity. <br>
  Standard_EXPORT   virtual  Handle_Select3D_SensitiveEntity GetConnected(const TopLoc_Location& aLocation) ;
  //! Matches the coordinates X, Y with the entity found at <br>
//! that point within the tolerance aTol and the minimum depth DMin. <br>
//! You must redefine this function for every inheriting entity. <br>
//! You will have to call this framework inside the redefined function. <br>
  Standard_EXPORT   virtual  Standard_Boolean Matches(const Standard_Real X,const Standard_Real Y,const Standard_Real aTol,Standard_Real& DMin) ;
  //! Matches the box defined by the coordinates Xmin, <br>
//! Ymin, Xmax, Ymax with the entity found at that point <br>
//! within the tolerance aTol. <br>
//! Xmin, YMin define the minimum point in the lower left <br>
//! hand corner of the box, and   XMax, YMax define the <br>
//! maximum point in the upper right hand corner of the box. <br>
//! You must redefine this function for every inheriting entity. <br>
//! You will have to call this framework inside the redefined function. <br>
  Standard_EXPORT   virtual  Standard_Boolean Matches(const Standard_Real XMin,const Standard_Real YMin,const Standard_Real XMax,const Standard_Real YMax,const Standard_Real aTol) ;
  //! prevents from hiding virtual methods... <br>
  Standard_EXPORT   virtual  Standard_Boolean Matches(const TColgp_Array1OfPnt2d& Polyline,const Bnd_Box2d& aBox,const Standard_Real aTol) ;
  //! Returns the eye line for the point defined by the coordinates X,Y. <br>
  Standard_EXPORT     gp_Lin GetEyeLine(const Standard_Real X,const Standard_Real Y) const;
  //! Returns the depth of this object on the line EyeLine. <br>
//! EyeLine goes through the eye towards a point <br>
//! defined by the coordinates X,Y in the function GetEyeLine. <br>//! gives an abcissa on <aLin> . <br>
//!          <aLin> represents the line going through <br>
//!          the eye towards an X,Y point on the screen. This Method <br>
//!          must return a mean Depth on this line. <br>
  Standard_EXPORT   virtual  Standard_Real ComputeDepth(const gp_Lin& EyeLine) const = 0;
  
  Standard_EXPORT   virtual  Standard_Real Depth() const;
  //! Returns true if this framework has a location defined. <br>
  Standard_EXPORT   virtual  Standard_Boolean HasLocation() const;
  
  Standard_EXPORT   virtual const TopLoc_Location& Location() const;
  //! sets the location to Identity <br>
  Standard_EXPORT   virtual  void ResetLocation() ;
  
  Standard_EXPORT   virtual  void SetLocation(const TopLoc_Location& aLoc) ;
  //! 2 options : <br>
//!          <FullDump> = False -> general information <br>
//!	        <FullDump> = True  -> whole informtion 3D +2d ... <br>
  Standard_EXPORT   virtual  void Dump(Standard_OStream& S,const Standard_Boolean FullDump = Standard_True) const;
  
  Standard_EXPORT   static  void DumpBox(Standard_OStream& S,const Bnd_Box2d& abox) ;
  
  Standard_EXPORT     void UpdateLocation(const TopLoc_Location& aLoc) ;
  
  Standard_EXPORT   virtual  void SetLastPrj(const Handle(Select3D_Projector)& aPrj) ;




  DEFINE_STANDARD_RTTI(Select3D_SensitiveEntity)

protected:

  
  Standard_EXPORT   Select3D_SensitiveEntity(const Handle(SelectBasics_EntityOwner)& OwnerId);
  
  Standard_EXPORT     void SetLastDepth(const Standard_Real aDepth) ;

Handle_Select3D_Projector mylastprj;


private: 


Standard_ShortReal mylastdepth;


};


#include <Select3D_SensitiveEntity.lxx>



// other Inline functions and methods (like "C++: function call" methods)


#endif