0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / BOPDS / BOPDS_Curve.hxx
1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 #ifndef _BOPDS_Curve_HeaderFile
16 #define _BOPDS_Curve_HeaderFile
17
18 #include <Standard.hxx>
19 #include <Standard_DefineAlloc.hxx>
20 #include <Standard_Handle.hxx>
21
22 #include <Bnd_Box.hxx>
23 #include <BOPDS_ListOfPaveBlock.hxx>
24 #include <IntTools_Curve.hxx>
25 #include <NCollection_BaseAllocator.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TColStd_ListOfInteger.hxx>
28 class IntTools_Curve;
29 class Bnd_Box;
30 class BOPDS_PaveBlock;
31
32
33
34 //! The class BOPDS_Curve is to store
35 //! the information about intersection curve
36 class BOPDS_Curve 
37 {
38 public:
39
40   DEFINE_STANDARD_ALLOC
41
42   
43
44   //! Empty contructor
45     BOPDS_Curve();
46 virtual ~BOPDS_Curve();
47   
48
49   //! Contructor
50   //! <theAllocator> - the allocator to manage the memory
51     BOPDS_Curve(const Handle(NCollection_BaseAllocator)& theAllocator);
52   
53
54   //! Modifier
55   //! Sets the curve <theC>
56     void SetCurve (const IntTools_Curve& theC);
57   
58
59   //! Selector
60   //! Returns the curve
61     const IntTools_Curve& Curve() const;
62   
63
64   //! Modifier
65   //! Sets the bounding box <theBox> of the curve
66     void SetBox (const Bnd_Box& theBox);
67   
68
69   //! Selector
70   //! Returns the bounding box of the curve
71     const Bnd_Box& Box() const;
72   
73
74   //! Selector/Modifier
75   //! Returns the bounding box of the curve
76     Bnd_Box& ChangeBox();
77   
78   void SetPaveBlocks (const BOPDS_ListOfPaveBlock& theLPB);
79   
80
81   //! Selector
82   //! Returns the list of pave blocks
83   //! of the curve
84     const BOPDS_ListOfPaveBlock& PaveBlocks() const;
85   
86
87   //! Selector/Modifier
88   //! Returns the list of pave blocks
89   //! of the curve
90     BOPDS_ListOfPaveBlock& ChangePaveBlocks();
91   
92
93   //! Creates  initial pave block
94   //! of the curve
95     void InitPaveBlock1();
96   
97
98   //! Selector/Modifier
99   //! Returns  initial pave block
100   //! of the curve
101     Handle(BOPDS_PaveBlock)& ChangePaveBlock1();
102   
103
104   //! Selector
105   //! Returns list of indices of technologic vertices
106   //! of the curve
107     const TColStd_ListOfInteger& TechnoVertices() const;
108   
109
110   //! Selector/Modifier
111   //! Returns list of indices of technologic vertices
112   //! of the curve
113     TColStd_ListOfInteger& ChangeTechnoVertices();
114   
115
116   //! Query
117   //! Returns true if at least one pave block of the curve
118   //! has edge
119     Standard_Boolean HasEdge() const;
120
121   //! Sets the tolerance for the curve.
122   void SetTolerance(const Standard_Real theTol)
123   {
124     myTolerance = theTol;
125   }
126
127   //! Returns the tolerance of the curve
128   Standard_Real Tolerance() const
129   {
130     return myTolerance;
131   }
132
133   //! Returns the tangential tolerance of the curve
134   Standard_Real TangentialTolerance() const
135   {
136     return myCurve.TangentialTolerance();
137   }
138
139 protected:
140
141   Handle(NCollection_BaseAllocator) myAllocator;
142   IntTools_Curve myCurve;
143   BOPDS_ListOfPaveBlock myPaveBlocks;
144   TColStd_ListOfInteger myTechnoVertices;
145   Bnd_Box myBox;
146   Standard_Real myTolerance;
147
148 private:
149
150 };
151
152 #include <BOPDS_Curve.lxx>
153
154 #endif // _BOPDS_Curve_HeaderFile