1 -- File: IntPoly_ShapeSection.cdl
2 -- Created: Tue Aug 1 09:14:30 1995
3 -- Author: Stagiaire Alain JOURDAIN
5 ---Copyright: Matra Datavision 1995
8 class ShapeSection from IntPoly
10 ---Purpose: determines the section between 2 triangulated shapes.
11 -- The section is a set of edges.
13 uses Real from Standard,
14 Integer from Standard,
15 Boolean from Standard,
20 SequenceOfPnt from TColgp,
21 SequenceOfSequenceOfPnt from IntPoly,
22 IndexedMapOfPnt from IntPoly,
23 PntHasher from IntPoly
26 returns ShapeSection from IntPoly;
28 Create (S1 : Shape from TopoDS;
29 S2 : Shape from TopoDS)
30 returns ShapeSection from IntPoly;
38 Intersect (me : in out; S1,S2,S3 : Pnt from gp;
39 OS1,VS0,V1,V2 : Vec from gp;
40 h1,h2,ah1,ah2 : in out Real from Standard)
41 ---Purpose: determines if it exists, the intersection point between
42 -- the (S1,S2,S3) triangle and the edge pointed by V1 and V2.
43 -- Returns True if the triangle-triangle section is found.
44 returns Boolean from Standard;
46 IsEqual (me : in out; Pt1,Pt2 : Pnt from gp)
47 returns Boolean from Standard;
49 IsInside (me : in out; P,P1,P2,P3 : Pnt from gp;
51 ---Purpose: returns True if P is inside the (P1,P2,P3) triangle
53 returns Boolean from Standard;
55 InsertInMap (me : in out)
56 ---Purpose: adds if necessary, myBegPoint in myMapBegPoint
57 -- and myEndPoint in myMapEndPoint.
60 Insert (me : in out; OldPnt : Pnt from gp;
63 ---Purpose: sees whether OldPnt and NewPnt begins or ends a section
64 -- created before and adds the 2 others points.
65 -- If not, creates a section
68 Concat (me : in out; BegPnt : Pnt from gp;
70 OutPnt : out Pnt from gp)
71 ---Purpose: sees whether BegPnt or EndPnt begins or ends a section
72 -- created before, and returns the other point to continue
74 -- Returns 2 if the construction is 'Forward'
75 -- Returns 1 if the construction is 'Previous'
76 -- Returns 0 if not and creates a section
77 returns Integer from Standard;
79 ConcatSection (me : in out; Section : in out SequenceOfPnt from TColgp;
80 NbSection : Integer from Standard;
81 Index : Integer from Standard)
82 ---Purpose: sees whether Section begins or ends another one in mySection,
83 -- from the rank 'Index' to the last one 'NbSection'
86 ForwConstruction (me : in out; Point : Pnt from gp)
87 ---Purpose: builds a section from Point in this way
89 -- Point--/__/--/__/--/__/--/__/--->
92 PrevConstruction (me : in out; Point : Pnt from gp)
93 ---Purpose: builds a section from Point in this way
95 -- <---/__/--/__/--/__/--/__/--Point
99 returns Integer from Standard;
101 Edge (me : in out; Index : Integer from Standard)
102 ---Purpose: builds an edge from a sequence of Pnt
103 -- this is a part of the whole section
104 returns Edge from TopoDS;
108 myShape1 : Shape from TopoDS;
109 myShape2 : Shape from TopoDS;
110 mySection : SequenceOfSequenceOfPnt from IntPoly;
111 myMapBegPoints : IndexedMapOfPnt from IntPoly;
112 myMapEndPoints : IndexedMapOfPnt from IntPoly;
113 myBegPoint : Pnt from gp;
114 myEndPoint : Pnt from gp;
115 myFirstTime : Boolean from Standard;
116 myCpt : Integer from Standard;
117 myIndex : Integer from Standard;
118 myNbEdges : Integer from Standard;