OCC22354 Bug in Overlay Text rendering
[occt.git] / src / Select3D / Select3D_SensitiveTriangulation.cdl
1 -- File:        Select3D_SensitiveTriangulation.cdl
2 -- Created:     Thu May 15 15:05:37 1997
3 -- Author:      Robert COUBLANC
4 --              <rob@robox.paris1.matra-dtv.fr>
5 ---Copyright:    Matra Datavision 1997
6
7
8 class SensitiveTriangulation from Select3D 
9 inherits SensitiveEntity from Select3D
10
11         ---Purpose: A framework to define selection of a sensitive entity made of a set of triangles.
12
13 uses
14     EntityOwner      from SelectBasics,
15     Projector        from Select3D,
16     Lin              from gp,
17     Trsf             from gp,
18     ListOfBox2d      from SelectBasics,
19     Array1OfPnt      from TColgp,
20     Array1OfPnt2d    from TColgp,
21     HArray1OfInteger from TColStd,
22     Box2d            from Bnd,
23     SensitiveTriangle from Select3D,
24     ListOfSensitiveTriangle from Select3D,
25     XYZ              from gp,
26     XY               from gp,
27     Pnt              from gp,
28     Pnt2d            from gp,
29     Triangulation    from Poly,
30     Location from TopLoc
31 is
32
33     Create(OwnerId       : EntityOwner from SelectBasics;
34            aTriangulation: Triangulation from Poly;
35            aLoc          : Location from TopLoc;
36            InteriorFlag  : Boolean from Standard = Standard_True)
37     returns mutable SensitiveTriangulation from Select3D;
38
39         ---Purpose: Constructs a sensitive triangulation object defined by
40         -- the owner OwnerId, the triangulation aTriangulation,
41         -- the location aLoc, and the flag InteriorFlag.
42
43     Create(OwnerId       : EntityOwner from SelectBasics;
44            aTriangulation: Triangulation from Poly;
45            aLoc          : Location from TopLoc;
46            thefreeedges  : HArray1OfInteger from TColStd;
47            theCDG        : Pnt from gp;
48            InteriorFlag  : Boolean from Standard)
49     returns mutable SensitiveTriangulation from Select3D;
50         ---Purpose: Constructs a sensitive triangulation object defined by
51         -- the owner OwnerId, the triangulation aTriangulation,
52         -- the location aLoc, the array of free edges
53         -- thefreeedges, the center of gravity theCDG, and the flag InteriorFlag.
54         -- As free edges and the center of gravity do not have
55         -- to be computed later, this syntax reduces computation time. 
56
57
58     Project (me:mutable;aProjector : Projector from Select3D) is redefined static;
59         ---Level: Public 
60         ---Purpose: projection of the sensitive primitive in order to
61         --          get 2D boxes for the Sort Algorithm
62     
63     Areas   (me:mutable ; boxes : in out ListOfBox2d from SelectBasics) is redefined static;
64         ---Level: Public 
65         ---Purpose: stores in <boxes> the 2D Boxes which represent the sensitive face
66         --          in the selection algorithm.
67
68     GetConnected(me:mutable;aLocation: Location from TopLoc)
69     returns SensitiveEntity from Select3D is redefined static;
70
71     Matches(me  :mutable; 
72             X,Y : Real from Standard;
73             aTol: Real from Standard;
74             DMin: out Real from Standard) 
75     returns Boolean
76     is redefined virtual;
77
78     Matches (me  :mutable; 
79              XMin,YMin,XMax,YMax : Real from Standard;
80              aTol: Real from Standard) 
81     returns Boolean
82     is redefined virtual;
83         ---Level: Public 
84      
85     Matches (me  :mutable; 
86              Polyline:Array1OfPnt2d from TColgp;
87              aBox:Box2d from Bnd;
88              aTol: Real from Standard) 
89     returns Boolean
90     is redefined virtual;
91         ---Level: Public 
92     
93     
94     ComputeDepth(me;EyeLine: Lin from gp) 
95     returns Real from Standard is redefined static;
96         ---Purpose: give the depht of the last detected triangle
97         --          (center of gravity)
98
99     DetectedTriangle(me) returns Integer from Standard;
100         ---Purpose: Returns the detected three nodes P1, P2, P3 constituting a triangle.
101         -- This triangle is a component of the overall sensitive
102         -- triangulation created at construction time.
103         ---C++: inline
104
105     Triangulation(me) returns any Triangulation from Poly;
106         ---Purpose: Returns the triangulation used at the time of construction.
107         ---C++: inline
108         ---C++: return const &
109
110     CDG3D(me) returns Pnt from gp;
111         ---Purpose: Returns the 3D center of gravity used at the time of construction.
112         ---C++: inline
113         ---C++: return const &
114     
115     CDG2D(me) returns Pnt2d from gp;
116         ---Purpose: Returns the 2D center of gravity used at the time of construction.
117         ---C++: inline
118         ---C++: return const &
119    
120
121     IsFree(me;
122            IndexOfTriangle : Integer from Standard;
123            IndexinFree     : out Integer from Standard) 
124     returns Boolean is static private;
125
126     Status (me;
127              p0,p1,p2: XY from gp ;
128              aPoint  : XY from gp ;
129              aTol    : Real from Standard;
130              Dmin    : out Real from Standard) returns Integer from  Standard;
131         ---Purpose: Dmin gives the distance between the cdg and aPoint
132
133
134     ---Category: TheLocations....
135
136     HasInitLocation(me) returns Boolean from Standard;
137         ---C++: inline
138
139     GetInitLocation(me) returns Location from TopLoc;
140         ---C++: inline
141         ---C++: return const &
142
143     
144     ResetLocation(me:mutable) is redefined virtual;
145
146     SetLocation(me:mutable;aLoc :Location from TopLoc) is redefined virtual;
147
148
149
150     Dump(me; S: in out OStream;FullDump : Boolean from Standard = Standard_True) is redefined virtual;
151
152
153     DetectedTriangle(me;P1,P2,P3 : out Pnt from gp) 
154     returns Boolean from Standard;
155         ---Purpose: gives the vertices of detected triangle...
156
157  
158     DetectedTriangle2d(me;P1,P2,P3 : out Pnt2d from gp) 
159     returns Boolean from Standard;
160         ---Purpose: Gets 2D nodes computed by entity using 3D nodes and viewer
161         --          parameters (see Project() method)
162     
163     ComputeTotalTrsf(me:mutable) is static private;
164
165
166 fields
167
168     
169     myTriangul : Triangulation from Poly;
170     myiniloc   : Location      from TopLoc;
171     myTrsf     : Trsf          from gp;
172
173     myCDG3D    : Pnt from gp;
174     myFreeEdges: HArray1OfInteger from TColStd;
175     myIntFlag  : Boolean from Standard;
176
177     myNodes2d  : Array1OfPnt2d from TColgp;
178     myCDG2D    : Pnt2d from gp;
179     mybox2d    : Box2d from Bnd;
180
181     
182     myDetectedTr: Integer from Standard;
183         
184 end SensitiveTriangulation;