f507e4949b09fd15671d319101f8b6ab63051df7
[occt.git] / src / HLRAlgo / HLRAlgo_PolyData.hxx
1 // Created on: 1993-10-29
2 // Created by: Christophe MARION
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _HLRAlgo_PolyData_HeaderFile
18 #define _HLRAlgo_PolyData_HeaderFile
19
20 #include <HLRAlgo_BiPoint.hxx>
21 #include <Standard.hxx>
22 #include <Standard_Type.hxx>
23
24 #include <Standard_Integer.hxx>
25 #include <TColgp_HArray1OfXYZ.hxx>
26 #include <HLRAlgo_HArray1OfTData.hxx>
27 #include <HLRAlgo_HArray1OfPHDat.hxx>
28 #include <Standard_Transient.hxx>
29 #include <TColgp_Array1OfXYZ.hxx>
30 #include <HLRAlgo_Array1OfTData.hxx>
31 #include <HLRAlgo_Array1OfPHDat.hxx>
32 #include <Standard_Boolean.hxx>
33
34 class HLRAlgo_EdgeStatus;
35
36 class HLRAlgo_PolyData;
37 DEFINE_STANDARD_HANDLE(HLRAlgo_PolyData, Standard_Transient)
38
39 //! Data structure of a set of Triangles.
40 class HLRAlgo_PolyData : public Standard_Transient
41 {
42
43 public:
44   struct FaceIndices
45   {
46     Standard_Integer Index, Min, Max;
47   };
48
49   struct Triangle
50   {
51     gp_XY V1, V2, V3;
52     Standard_Real Param, TolParam, TolAng, Tolerance;
53   };
54
55   struct Box
56   {
57     Standard_Real XMin, YMin, ZMin, XMax, YMax, ZMax;
58
59     //! The default constructor.
60     Box()
61     {
62     }
63
64     //! The initializing constructor.
65     Box(
66         const Standard_Real& theXMin,
67         const Standard_Real& theYMin,
68         const Standard_Real& theZMin,
69         const Standard_Real& theXMax,
70         const Standard_Real& theYMax,
71         const Standard_Real& theZMax) :
72       XMin(theXMin),
73       YMin(theYMin),
74       ZMin(theZMin),
75       XMax(theXMax),
76       YMax(theYMax),
77       ZMax(theZMax)
78     {
79     }
80   };
81
82   Standard_EXPORT HLRAlgo_PolyData();
83   
84   Standard_EXPORT void HNodes (const Handle(TColgp_HArray1OfXYZ)& HNodes);
85   
86   Standard_EXPORT void HTData (const Handle(HLRAlgo_HArray1OfTData)& HTData);
87   
88   Standard_EXPORT void HPHDat (const Handle(HLRAlgo_HArray1OfPHDat)& HPHDat);
89   
90     void FaceIndex (const Standard_Integer I);
91   
92     Standard_Integer FaceIndex() const;
93   
94     TColgp_Array1OfXYZ& Nodes() const;
95   
96     HLRAlgo_Array1OfTData& TData() const;
97   
98     HLRAlgo_Array1OfPHDat& PHDat() const;
99   
100   Standard_EXPORT void UpdateGlobalMinMax (Box& theBox);
101   
102     Standard_Boolean Hiding() const;
103   
104   //! process hiding between <Pt1> and <Pt2>.
105   Standard_EXPORT void HideByPolyData (const HLRAlgo_BiPoint::PointsT& thePoints, Triangle& theTriangle, HLRAlgo_BiPoint::IndicesT& theIndices, const Standard_Boolean HidingShell, HLRAlgo_EdgeStatus& status);
106   
107   FaceIndices& Indices()
108   {
109     return myFaceIndices;
110   }
111
112   DEFINE_STANDARD_RTTIEXT(HLRAlgo_PolyData,Standard_Transient)
113
114 private:
115
116   //! evident.
117   void hideByOneTriangle (const HLRAlgo_BiPoint::PointsT& thePoints,
118                           Triangle& theTriangle,
119                           const Standard_Boolean Crossing,
120                           const Standard_Boolean HideBefore,
121                           const Standard_Integer TrFlags,
122                           HLRAlgo_EdgeStatus& status);
123
124   FaceIndices myFaceIndices;
125   Handle(TColgp_HArray1OfXYZ) myHNodes;
126   Handle(HLRAlgo_HArray1OfTData) myHTData;
127   Handle(HLRAlgo_HArray1OfPHDat) myHPHDat;
128
129 };
130
131 #include <HLRAlgo_PolyData.lxx>
132
133 #endif // _HLRAlgo_PolyData_HeaderFile