0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / TopOpeBRepBuild / TopOpeBRepBuild_PaveClassifier.hxx
1 // Created on: 1993-06-17
2 // Created by: Jean Yves LEBEY
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 _TopOpeBRepBuild_PaveClassifier_HeaderFile
18 #define _TopOpeBRepBuild_PaveClassifier_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TopoDS_Edge.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Real.hxx>
27 #include <TopAbs_Orientation.hxx>
28 #include <Standard_Integer.hxx>
29 #include <TopOpeBRepBuild_LoopClassifier.hxx>
30 #include <TopAbs_State.hxx>
31 class TopoDS_Shape;
32 class TopOpeBRepBuild_Loop;
33
34
35
36 //! This class compares vertices on an edge.
37 //!
38 //! A vertex V1 is inside a vertex V2 if V1 is on the
39 //! part of the curve defined by V2.
40 //!
41 //! If V2 is FORWARD V1 must be after V2 on the curve.
42 //! If V2 is REVERSED V1 must be before V2 on the curve.
43 //! If V2 is INTERNAL V1 is always inside.
44 //! If V2 is EXTERNAL V1 is never inside.
45 class TopOpeBRepBuild_PaveClassifier  : public TopOpeBRepBuild_LoopClassifier
46 {
47 public:
48
49   DEFINE_STANDARD_ALLOC
50
51   
52   //! Create a Pave classifier to compare vertices on edge <E>.
53   Standard_EXPORT TopOpeBRepBuild_PaveClassifier(const TopoDS_Shape& E);
54   
55   //! Returns state of vertex <L1> compared with <L2>.
56   Standard_EXPORT TopAbs_State Compare (const Handle(TopOpeBRepBuild_Loop)& L1, const Handle(TopOpeBRepBuild_Loop)& L2);
57   
58   Standard_EXPORT void SetFirstParameter (const Standard_Real P);
59   
60   Standard_EXPORT void ClosedVertices (const Standard_Boolean B);
61   
62   Standard_EXPORT static Standard_Real AdjustCase (const Standard_Real p1, const TopAbs_Orientation o, const Standard_Real first, const Standard_Real period, const Standard_Real tol, Standard_Integer& cas);
63
64
65
66
67 protected:
68
69
70
71
72
73 private:
74
75   
76   Standard_EXPORT TopAbs_State CompareOnNonPeriodic();
77   
78   Standard_EXPORT TopAbs_State CompareOnPeriodic();
79   
80   Standard_EXPORT void AdjustOnPeriodic();
81   
82   Standard_EXPORT Standard_Boolean ToAdjustOnPeriodic() const;
83
84
85   TopoDS_Edge myEdge;
86   Standard_Boolean myEdgePeriodic;
87   Standard_Real myFirst;
88   Standard_Real myPeriod;
89   Standard_Boolean mySameParameters;
90   Standard_Boolean myClosedVertices;
91   Standard_Real myP1;
92   Standard_Real myP2;
93   TopAbs_Orientation myO1;
94   TopAbs_Orientation myO2;
95   Standard_Integer myCas1;
96   Standard_Integer myCas2;
97
98
99 };
100
101
102
103
104
105
106
107 #endif // _TopOpeBRepBuild_PaveClassifier_HeaderFile