42cf5bc1 |
1 | // Created on: 1993-11-18 |
2 | // Created by: Yves FRICAUD |
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 _MAT2d_Circuit_HeaderFile |
18 | #define _MAT2d_Circuit_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Standard_Real.hxx> |
24 | #include <TColGeom2d_SequenceOfGeometry.hxx> |
25 | #include <MAT2d_DataMapOfIntegerConnexion.hxx> |
26 | #include <MAT2d_DataMapOfBiIntSequenceOfInteger.hxx> |
27 | #include <TColStd_SequenceOfInteger.hxx> |
28 | #include <GeomAbs_JoinType.hxx> |
29 | #include <Standard_Boolean.hxx> |
25e59720 |
30 | #include <Standard_Transient.hxx> |
42cf5bc1 |
31 | #include <MAT2d_SequenceOfSequenceOfGeometry.hxx> |
32 | #include <TColStd_SequenceOfBoolean.hxx> |
33 | #include <Standard_Integer.hxx> |
34 | #include <MAT2d_SequenceOfConnexion.hxx> |
35 | class Geom2d_Geometry; |
36 | class MAT2d_Connexion; |
37 | class MAT2d_BiInt; |
38 | class MAT2d_MiniPath; |
39 | |
40 | |
41 | class MAT2d_Circuit; |
25e59720 |
42 | DEFINE_STANDARD_HANDLE(MAT2d_Circuit, Standard_Transient) |
42cf5bc1 |
43 | |
44 | //! Constructs a circuit on a set of lines. |
45 | //! EquiCircuit gives a Circuit passing by all the lines |
46 | //! in a set and all the connexions of the minipath associated. |
25e59720 |
47 | class MAT2d_Circuit : public Standard_Transient |
42cf5bc1 |
48 | { |
49 | |
50 | public: |
51 | |
52 | |
53 | Standard_EXPORT MAT2d_Circuit(const GeomAbs_JoinType aJoinType = GeomAbs_Arc, const Standard_Boolean IsOpenResult = Standard_False); |
54 | |
55 | Standard_EXPORT void Perform (MAT2d_SequenceOfSequenceOfGeometry& aFigure, const TColStd_SequenceOfBoolean& IsClosed, const Standard_Integer IndRefLine, const Standard_Boolean Trigo); |
56 | |
57 | //! Returns the Number of Items . |
58 | Standard_EXPORT Standard_Integer NumberOfItems() const; |
59 | |
60 | //! Returns the item at position <Index> in <me>. |
61 | Standard_EXPORT Handle(Geom2d_Geometry) Value (const Standard_Integer Index) const; |
62 | |
63 | //! Returns the number of items on the line <IndexLine>. |
64 | Standard_EXPORT Standard_Integer LineLength (const Standard_Integer IndexLine) const; |
65 | |
66 | //! Returns the set of index of the items in <me>corresponding |
67 | //! to the curve <IndCurve> on the line <IndLine> from the |
68 | //! initial figure. |
69 | Standard_EXPORT const TColStd_SequenceOfInteger& RefToEqui (const Standard_Integer IndLine, const Standard_Integer IndCurve) const; |
70 | |
71 | //! Returns the Connexion on the item <Index> in me. |
72 | Standard_EXPORT Handle(MAT2d_Connexion) Connexion (const Standard_Integer Index) const; |
73 | |
74 | //! Returns <True> is there is a connexion on the item <Index> |
75 | //! in <me>. |
76 | Standard_EXPORT Standard_Boolean ConnexionOn (const Standard_Integer Index) const; |
77 | |
78 | |
79 | |
80 | |
25e59720 |
81 | DEFINE_STANDARD_RTTIEXT(MAT2d_Circuit,Standard_Transient) |
42cf5bc1 |
82 | |
83 | protected: |
84 | |
85 | |
86 | |
87 | |
88 | private: |
89 | |
90 | |
91 | Standard_EXPORT Standard_Boolean IsSharpCorner (const Handle(Geom2d_Geometry)& Geom1, const Handle(Geom2d_Geometry)& Geom2, const Standard_Real Direction) const; |
92 | |
93 | Standard_EXPORT Standard_Boolean PassByLast (const Handle(MAT2d_Connexion)& C1, const Handle(MAT2d_Connexion)& C2) const; |
94 | |
95 | Standard_EXPORT Standard_Real Side (const Handle(MAT2d_Connexion)& C, const TColGeom2d_SequenceOfGeometry& Line) const; |
96 | |
97 | Standard_EXPORT void UpDateLink (const Standard_Integer IFirst, const Standard_Integer ILine, const Standard_Integer ICurveFirst, const Standard_Integer ICurveLast); |
98 | |
99 | Standard_EXPORT void SortRefToEqui (const MAT2d_BiInt& aBiInt); |
100 | |
101 | Standard_EXPORT void InitOpen (TColGeom2d_SequenceOfGeometry& Line) const; |
102 | |
103 | Standard_EXPORT void InsertCorner (TColGeom2d_SequenceOfGeometry& Line) const; |
104 | |
105 | Standard_EXPORT void DoubleLine (TColGeom2d_SequenceOfGeometry& Line, MAT2d_SequenceOfConnexion& Connexions, const Handle(MAT2d_Connexion)& Father, const Standard_Real Side) const; |
106 | |
107 | Standard_EXPORT void ConstructCircuit (const MAT2d_SequenceOfSequenceOfGeometry& aFigure, const Standard_Integer IndRefLine, const MAT2d_MiniPath& aPath); |
108 | |
109 | Standard_Real direction; |
110 | TColGeom2d_SequenceOfGeometry geomElements; |
111 | MAT2d_DataMapOfIntegerConnexion connexionMap; |
112 | MAT2d_DataMapOfBiIntSequenceOfInteger linkRefEqui; |
113 | TColStd_SequenceOfInteger linesLength; |
114 | GeomAbs_JoinType myJoinType; |
115 | Standard_Boolean myIsOpenResult; |
116 | |
117 | |
118 | }; |
119 | |
120 | |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | #endif // _MAT2d_Circuit_HeaderFile |