summaryrefslogtreecommitdiff
path: root/inc/IntPoly_ShapeSection.hxx
blob: 7d783384ccb309342877d2d020cdfdafd4cf8246 (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
// 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 _IntPoly_ShapeSection_HeaderFile
#define _IntPoly_ShapeSection_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _IntPoly_SequenceOfSequenceOfPnt_HeaderFile
#include <IntPoly_SequenceOfSequenceOfPnt.hxx>
#endif
#ifndef _IntPoly_IndexedMapOfPnt_HeaderFile
#include <IntPoly_IndexedMapOfPnt.hxx>
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.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
class TopoDS_Shape;
class gp_Pnt;
class gp_Vec;
class TColgp_SequenceOfPnt;
class TopoDS_Edge;


//! determines the section between 2 triangulated shapes. <br>
//!          The section is a set of edges. <br>
class IntPoly_ShapeSection  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  
  Standard_EXPORT   IntPoly_ShapeSection();
  
  Standard_EXPORT   IntPoly_ShapeSection(const TopoDS_Shape& S1,const TopoDS_Shape& S2);
  
  Standard_EXPORT     void Section() ;
  
  Standard_EXPORT     void Explore() ;
  //! determines if it exists, the intersection point between <br>
//!          the (S1,S2,S3) triangle and the edge pointed by V1 and V2. <br>
//!          Returns True if the triangle-triangle section is found. <br>
  Standard_EXPORT     Standard_Boolean Intersect(const gp_Pnt& S1,const gp_Pnt& S2,const gp_Pnt& S3,const gp_Vec& OS1,const gp_Vec& VS0,const gp_Vec& V1,const gp_Vec& V2,Standard_Real& h1,Standard_Real& h2,Standard_Real& ah1,Standard_Real& ah2) ;
  
  Standard_EXPORT     Standard_Boolean IsEqual(const gp_Pnt& Pt1,const gp_Pnt& Pt2) ;
  //! returns True if P is inside the (P1,P2,P3) triangle <br>
//!          N0 = P1P2 ^ P1P3 <br>
  Standard_EXPORT     Standard_Boolean IsInside(const gp_Pnt& P,const gp_Pnt& P1,const gp_Pnt& P2,const gp_Pnt& P3,const gp_Vec& N0) ;
  //! adds if necessary, myBegPoint in myMapBegPoint <br>
//!          and myEndPoint in  myMapEndPoint. <br>
  Standard_EXPORT     void InsertInMap() ;
  //! sees whether OldPnt and NewPnt begins or ends a section <br>
//!          created before and adds the 2 others points. <br>
//!          If not, creates a section <br>
  Standard_EXPORT     void Insert(const gp_Pnt& OldPnt,const gp_Pnt& ComPnt,const gp_Pnt& NewPnt) ;
  //! sees whether BegPnt or EndPnt begins or ends a section <br>
//!          created before, and returns the other point to continue <br>
//!          the construction <br>
//!          Returns 2 if the construction is 'Forward' <br>
//!          Returns 1 if the construction is 'Previous' <br>
//!          Returns 0 if not and creates a section <br>
  Standard_EXPORT     Standard_Integer Concat(const gp_Pnt& BegPnt,const gp_Pnt& EndPnt,gp_Pnt& OutPnt) ;
  //! sees whether Section begins or ends another one in  mySection, <br>
//!          from the rank 'Index' to the last one 'NbSection' <br>
  Standard_EXPORT     void ConcatSection(TColgp_SequenceOfPnt& Section,const Standard_Integer NbSection,const Standard_Integer Index) ;
  //! builds a section from Point in this way <br>
//!                       ___   ___   ___   ___ <br>
//!               Point--/__/--/__/--/__/--/__/---> <br>
  Standard_EXPORT     void ForwConstruction(const gp_Pnt& Point) ;
  //! builds a section from Point in this way <br>
//!                    ___   ___   ___   ___ <br>
//!               <---/__/--/__/--/__/--/__/--Point <br>
  Standard_EXPORT     void PrevConstruction(const gp_Pnt& Point) ;
  
  Standard_EXPORT     Standard_Integer NbEdges() ;
  //! builds an edge from a sequence of Pnt <br>
//!          this is a part of the whole section <br>
  Standard_EXPORT     TopoDS_Edge Edge(const Standard_Integer Index) ;





protected:





private:



TopoDS_Shape myShape1;
TopoDS_Shape myShape2;
IntPoly_SequenceOfSequenceOfPnt mySection;
IntPoly_IndexedMapOfPnt myMapBegPoints;
IntPoly_IndexedMapOfPnt myMapEndPoints;
gp_Pnt myBegPoint;
gp_Pnt myEndPoint;
Standard_Boolean myFirstTime;
Standard_Integer myCpt;
Standard_Integer myIndex;
Standard_Integer myNbEdges;


};





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


#endif