0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / BOPDS / BOPDS_Curve.lxx
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 #include <BOPDS_PaveBlock.hxx>
16
17 //=======================================================================
18 //function : 
19 //purpose  : 
20 //=======================================================================
21   inline BOPDS_Curve::BOPDS_Curve()
22 :
23   myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
24   myPaveBlocks(myAllocator),
25   myTechnoVertices(myAllocator),
26   myTolerance(0.)
27 {
28 }
29 //=======================================================================
30 //function : 
31 //purpose  : 
32 //=======================================================================
33   inline BOPDS_Curve::BOPDS_Curve(const Handle(NCollection_BaseAllocator)& theAllocator)
34 :
35   myAllocator(theAllocator),
36   myPaveBlocks(myAllocator),
37   myTechnoVertices(myAllocator),
38   myTolerance(0.)
39 {
40 }
41 //=======================================================================
42 //function : 
43 //purpose  : 
44 //=======================================================================
45   inline BOPDS_Curve::~BOPDS_Curve()
46 {
47 }
48 //=======================================================================
49 //function : SetCurve
50 //purpose  : 
51 //=======================================================================
52   inline void BOPDS_Curve::SetCurve(const IntTools_Curve& theCurve)
53 {
54   myCurve=theCurve;
55 }
56 //=======================================================================
57 //function : Curve
58 //purpose  : 
59 //=======================================================================
60   inline const IntTools_Curve& BOPDS_Curve::Curve()const
61 {
62   return myCurve;
63 }
64 //=======================================================================
65 //function : SetPaveBlocks
66 //purpose  : 
67 //=======================================================================
68   inline void BOPDS_Curve::SetPaveBlocks(const BOPDS_ListOfPaveBlock& theLPB)
69 {
70   BOPDS_ListIteratorOfListOfPaveBlock aIt;
71   //
72   myPaveBlocks.Clear();
73   aIt.Initialize(theLPB);
74   for (; aIt.More(); aIt.Next()) {
75     myPaveBlocks.Append(aIt.Value());
76   }
77 }
78 //=======================================================================
79 //function : PaveBlocks
80 //purpose  : 
81 //=======================================================================
82   inline const BOPDS_ListOfPaveBlock& BOPDS_Curve::PaveBlocks()const
83 {
84   return myPaveBlocks;
85 }
86 //=======================================================================
87 //function : ChangePaveBlocks
88 //purpose  : 
89 //=======================================================================
90   inline BOPDS_ListOfPaveBlock& BOPDS_Curve::ChangePaveBlocks()
91 {
92   return myPaveBlocks;
93 }
94 //=======================================================================
95 //function : InitPaveBlock1
96 //purpose  : 
97 //=======================================================================
98   inline void BOPDS_Curve::InitPaveBlock1()
99 {
100   if (!myPaveBlocks.Extent()) {
101     Handle(BOPDS_PaveBlock) aPB=new BOPDS_PaveBlock;
102     myPaveBlocks.Append(aPB);
103   }
104 }
105 //=======================================================================
106 //function : ChangePaveBlock1
107 //purpose  : 
108 //=======================================================================
109   inline Handle(BOPDS_PaveBlock)& BOPDS_Curve::ChangePaveBlock1()
110 {
111   Handle(BOPDS_PaveBlock)* pPB=(Handle(BOPDS_PaveBlock)*)&myPaveBlocks.First();
112   return *pPB;
113 }
114 //=======================================================================
115 //function : TechnoVertices
116 //purpose  : 
117 //=======================================================================
118   inline const TColStd_ListOfInteger& BOPDS_Curve::TechnoVertices()const
119 {
120   return myTechnoVertices;
121 }
122 //=======================================================================
123 //function : ChangeTechnoVertices
124 //purpose  : 
125 //=======================================================================
126   inline TColStd_ListOfInteger& BOPDS_Curve::ChangeTechnoVertices()
127 {
128   return myTechnoVertices;
129 }
130 //=======================================================================
131 //function : SetBox
132 //purpose  : 
133 //=======================================================================
134   inline void BOPDS_Curve::SetBox(const Bnd_Box& theBox)
135 {
136   myBox=theBox;
137 }
138 //=======================================================================
139 //function : Box
140 //purpose  : 
141 //=======================================================================
142   inline const Bnd_Box& BOPDS_Curve::Box()const
143 {
144   return myBox;
145 }
146 //=======================================================================
147 //function : ChangeBox
148 //purpose  : 
149 //=======================================================================
150   inline Bnd_Box& BOPDS_Curve::ChangeBox()
151 {
152   return myBox;
153 }
154 //=======================================================================
155 //function : HasEdge
156 //purpose  : 
157 //=======================================================================
158   inline Standard_Boolean BOPDS_Curve::HasEdge()const
159 {
160   Standard_Boolean bFlag;
161   BOPDS_ListIteratorOfListOfPaveBlock aItPB;
162   //
163   bFlag=Standard_False;
164   aItPB.Initialize(myPaveBlocks);
165   for (; aItPB.More(); aItPB.Next()) {
166     const Handle(BOPDS_PaveBlock)& aPB=aItPB.Value();
167     bFlag=aPB->HasEdge();
168     if (bFlag) {
169       break;
170     }
171   }
172   return bFlag;
173 }