1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <BOPDS_PaveBlock.hxx>
17 //=======================================================================
20 //=======================================================================
21 inline BOPDS_Curve::BOPDS_Curve()
23 myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
24 myPaveBlocks(myAllocator),
25 myTechnoVertices(myAllocator),
29 //=======================================================================
32 //=======================================================================
33 inline BOPDS_Curve::BOPDS_Curve(const Handle(NCollection_BaseAllocator)& theAllocator)
35 myAllocator(theAllocator),
36 myPaveBlocks(myAllocator),
37 myTechnoVertices(myAllocator),
41 //=======================================================================
44 //=======================================================================
45 inline BOPDS_Curve::~BOPDS_Curve()
48 //=======================================================================
51 //=======================================================================
52 inline void BOPDS_Curve::SetCurve(const IntTools_Curve& theCurve)
56 //=======================================================================
59 //=======================================================================
60 inline const IntTools_Curve& BOPDS_Curve::Curve()const
64 //=======================================================================
65 //function : SetPaveBlocks
67 //=======================================================================
68 inline void BOPDS_Curve::SetPaveBlocks(const BOPDS_ListOfPaveBlock& theLPB)
70 BOPDS_ListIteratorOfListOfPaveBlock aIt;
73 aIt.Initialize(theLPB);
74 for (; aIt.More(); aIt.Next()) {
75 myPaveBlocks.Append(aIt.Value());
78 //=======================================================================
79 //function : PaveBlocks
81 //=======================================================================
82 inline const BOPDS_ListOfPaveBlock& BOPDS_Curve::PaveBlocks()const
86 //=======================================================================
87 //function : ChangePaveBlocks
89 //=======================================================================
90 inline BOPDS_ListOfPaveBlock& BOPDS_Curve::ChangePaveBlocks()
94 //=======================================================================
95 //function : InitPaveBlock1
97 //=======================================================================
98 inline void BOPDS_Curve::InitPaveBlock1()
100 if (!myPaveBlocks.Extent()) {
101 Handle(BOPDS_PaveBlock) aPB=new BOPDS_PaveBlock;
102 myPaveBlocks.Append(aPB);
105 //=======================================================================
106 //function : ChangePaveBlock1
108 //=======================================================================
109 inline Handle(BOPDS_PaveBlock)& BOPDS_Curve::ChangePaveBlock1()
111 Handle(BOPDS_PaveBlock)* pPB=(Handle(BOPDS_PaveBlock)*)&myPaveBlocks.First();
114 //=======================================================================
115 //function : TechnoVertices
117 //=======================================================================
118 inline const TColStd_ListOfInteger& BOPDS_Curve::TechnoVertices()const
120 return myTechnoVertices;
122 //=======================================================================
123 //function : ChangeTechnoVertices
125 //=======================================================================
126 inline TColStd_ListOfInteger& BOPDS_Curve::ChangeTechnoVertices()
128 return myTechnoVertices;
130 //=======================================================================
133 //=======================================================================
134 inline void BOPDS_Curve::SetBox(const Bnd_Box& theBox)
138 //=======================================================================
141 //=======================================================================
142 inline const Bnd_Box& BOPDS_Curve::Box()const
146 //=======================================================================
147 //function : ChangeBox
149 //=======================================================================
150 inline Bnd_Box& BOPDS_Curve::ChangeBox()
154 //=======================================================================
157 //=======================================================================
158 inline Standard_Boolean BOPDS_Curve::HasEdge()const
160 Standard_Boolean bFlag;
161 BOPDS_ListIteratorOfListOfPaveBlock aItPB;
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();