1 // Created on: 1997-04-17
2 // Created by: Christophe MARION
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _HLRBRep_EdgeBuilder_HeaderFile
18 #define _HLRBRep_EdgeBuilder_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopAbs_State.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TopAbs_Orientation.hxx>
28 class HLRBRep_AreaLimit;
29 class Standard_NoMoreObject;
30 class Standard_NoSuchObject;
31 class Standard_DomainError;
32 class HLRBRep_VertexList;
33 class HLRAlgo_Intersection;
37 class HLRBRep_EdgeBuilder
44 //! Creates an EdgeBuilder algorithm. <VList>
45 //! describes the edge and the interferences.
46 //! AreaLimits are created from the vertices.
47 //! Builds(IN) is automatically called.
48 Standard_EXPORT HLRBRep_EdgeBuilder(HLRBRep_VertexList& VList);
50 //! Initialize an iteration on the areas.
51 Standard_EXPORT void InitAreas();
53 //! Set the current area to the next area.
54 Standard_EXPORT void NextArea();
56 //! Set the current area to the previous area.
57 Standard_EXPORT void PreviousArea();
59 //! Returns True if there is a current area.
60 Standard_EXPORT Standard_Boolean HasArea() const;
62 //! Returns the state of the current area.
63 Standard_EXPORT TopAbs_State AreaState() const;
65 //! Returns the edge state of the current area.
66 Standard_EXPORT TopAbs_State AreaEdgeState() const;
68 //! Returns the AreaLimit beginning the current area.
69 //! This is a NULL handle when the area is infinite on
71 Standard_EXPORT Handle(HLRBRep_AreaLimit) LeftLimit() const;
73 //! Returns the AreaLimit ending the current area.
74 //! This is a NULL handle when the area is infinite on
76 Standard_EXPORT Handle(HLRBRep_AreaLimit) RightLimit() const;
78 //! Reinitialize the results iteration to the parts
79 //! with State <ToBuild>. If this method is not called
80 //! after construction the default is <ToBuild> = IN.
81 Standard_EXPORT void Builds (const TopAbs_State ToBuild);
83 //! Returns True if there are more new edges to build.
84 Standard_EXPORT Standard_Boolean MoreEdges() const;
86 //! Proceeds to the next edge to build. Skip all
87 //! remaining vertices on the current edge.
88 Standard_EXPORT void NextEdge();
90 //! True if there are more vertices in the current new
92 Standard_EXPORT Standard_Boolean MoreVertices() const;
94 //! Proceeds to the next vertex of the current edge.
95 Standard_EXPORT void NextVertex();
97 //! Returns the current vertex of the current edge.
98 Standard_EXPORT const HLRAlgo_Intersection& Current() const;
100 //! Returns True if the current vertex comes from the
101 //! boundary of the edge.
102 Standard_EXPORT Standard_Boolean IsBoundary() const;
104 //! Returns True if the current vertex was an
106 Standard_EXPORT Standard_Boolean IsInterference() const;
108 //! Returns the new orientation of the current vertex.
109 Standard_EXPORT TopAbs_Orientation Orientation() const;
111 Standard_EXPORT void Destroy();
112 ~HLRBRep_EdgeBuilder()
130 TopAbs_State toBuild;
131 Handle(HLRBRep_AreaLimit) myLimits;
132 Handle(HLRBRep_AreaLimit) left;
133 Handle(HLRBRep_AreaLimit) right;
134 Standard_Integer current;
145 #endif // _HLRBRep_EdgeBuilder_HeaderFile