42cf5bc1 |
1 | // Created on: 1991-03-05 |
2 | // Created by: Remy GILET |
3 | // Copyright (c) 1991-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 _GccEnt_HeaderFile |
18 | #define _GccEnt_HeaderFile |
19 | |
9294c8f7 |
20 | #include <GccEnt_Position.hxx> |
42cf5bc1 |
21 | #include <Standard.hxx> |
22 | #include <Standard_DefineAlloc.hxx> |
23 | #include <Standard_Handle.hxx> |
24 | |
25 | class GccEnt_QualifiedLin; |
26 | class gp_Lin2d; |
27 | class GccEnt_QualifiedCirc; |
28 | class gp_Circ2d; |
29 | class GccEnt_QualifiedLin; |
30 | class GccEnt_QualifiedCirc; |
31 | |
32 | |
33 | //! This package provides an implementation of the qualified |
34 | //! entities useful to create 2d entities with geometric |
35 | //! constraints. The qualifier explains which subfamily of |
36 | //! solutions we want to obtain. It uses the following law: the |
37 | //! matter/the interior side is at the left of the line, if we go |
38 | //! from the beginning to the end. |
39 | //! The qualifiers are: |
40 | //! Enclosing : the solution(s) must enclose the argument. |
41 | //! Enclosed : the solution(s) must be enclosed in the |
42 | //! argument. |
43 | //! Outside : both the solution(s) and the argument must be |
44 | //! outside to each other. |
45 | //! Unqualified : the position is undefined, so give all the |
46 | //! solutions. |
47 | //! The use of a qualifier is always required if such |
48 | //! subfamilies exist. For example, it is not used for a point. |
49 | //! Note: the interior of a curve is defined as the left-hand |
50 | //! side of the curve in relation to its orientation. |
51 | class GccEnt |
52 | { |
53 | public: |
54 | |
55 | DEFINE_STANDARD_ALLOC |
56 | |
9294c8f7 |
57 | |
58 | //! Prints the name of Position type as a String on the Stream. |
59 | static Standard_OStream& Print (const GccEnt_Position thePosition, Standard_OStream& theStream) |
60 | { |
61 | return (theStream << PositionToString (thePosition)); |
62 | } |
63 | |
64 | //! Returns the string name for a given position. |
65 | //! @param thePosition position type |
66 | //! @return string identifier from the list UNQUALIFIED ENCLOSING ENCLOSED OUTSIDE NOQUALIFIER |
67 | Standard_EXPORT static Standard_CString PositionToString (GccEnt_Position thePosition); |
68 | |
69 | //! Returns the position from the given string identifier (using case-insensitive comparison). |
70 | //! @param thePositionString string identifier |
71 | //! @return position or GccEnt_unqualified if string identifier is invalid |
72 | static GccEnt_Position PositionFromString (Standard_CString thePositionString) |
73 | { |
74 | GccEnt_Position aPosition = GccEnt_unqualified; |
75 | PositionFromString (thePositionString, aPosition); |
76 | return aPosition; |
77 | } |
78 | |
79 | //! Determines the position from the given string identifier (using case-insensitive comparison). |
80 | //! @param thePositionString string identifier |
81 | //! @param thePosition detected shape type |
82 | //! @return TRUE if string identifier is known |
83 | Standard_EXPORT static Standard_Boolean PositionFromString (Standard_CString thePositionString, |
84 | GccEnt_Position& thePosition); |
42cf5bc1 |
85 | |
86 | //! Constructs a qualified line, |
87 | //! so that the relative position to the circle or line of the |
88 | //! solution computed by a construction algorithm using the |
89 | //! qualified circle or line is not qualified, i.e. all solutions apply. |
90 | Standard_EXPORT static GccEnt_QualifiedLin Unqualified (const gp_Lin2d& Obj); |
91 | |
92 | //! Constructs a qualified circle |
93 | //! so that the relative position to the circle or line of the |
94 | //! solution computed by a construction algorithm using the |
95 | //! qualified circle or line is not qualified, i.e. all solutions apply. |
96 | Standard_EXPORT static GccEnt_QualifiedCirc Unqualified (const gp_Circ2d& Obj); |
97 | |
98 | |
99 | //! Constructs such a qualified circle that the solution |
100 | //! computed by a construction algorithm using the qualified |
101 | //! circle encloses the circle. |
102 | Standard_EXPORT static GccEnt_QualifiedCirc Enclosing (const gp_Circ2d& Obj); |
103 | |
104 | //! Constructs a qualified line, |
105 | //! so that the solution computed by a construction |
106 | //! algorithm using the qualified circle or line is enclosed by |
107 | //! the circle or line. |
108 | Standard_EXPORT static GccEnt_QualifiedLin Enclosed (const gp_Lin2d& Obj); |
109 | |
110 | //! Constructs a qualified circle |
111 | //! so that the solution computed by a construction |
112 | //! algorithm using the qualified circle or line is enclosed by |
113 | //! the circle or line. |
114 | Standard_EXPORT static GccEnt_QualifiedCirc Enclosed (const gp_Circ2d& Obj); |
115 | |
116 | //! Constructs a qualified line, |
117 | //! so that the solution computed by a construction |
118 | //! algorithm using the qualified circle or line and the circle |
119 | //! or line are external to one another. |
120 | Standard_EXPORT static GccEnt_QualifiedLin Outside (const gp_Lin2d& Obj); |
121 | |
122 | //! Constructs a qualified circle |
123 | //! so that the solution computed by a construction |
124 | //! algorithm using the qualified circle or line and the circle |
125 | //! or line are external to one another. |
126 | Standard_EXPORT static GccEnt_QualifiedCirc Outside (const gp_Circ2d& Obj); |
127 | |
128 | |
129 | |
130 | |
131 | protected: |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | private: |
138 | |
139 | |
140 | |
141 | |
142 | friend class GccEnt_QualifiedLin; |
143 | friend class GccEnt_QualifiedCirc; |
144 | |
145 | }; |
146 | |
147 | |
148 | |
149 | |
150 | |
151 | |
152 | |
153 | #endif // _GccEnt_HeaderFile |