42cf5bc1 |
1 | // Created on: 1999-05-14 |
2 | // Created by: Pavel DURANDIN |
3 | // Copyright (c) 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 _ShapeUpgrade_ShapeConvertToBezier_HeaderFile |
18 | #define _ShapeUpgrade_ShapeConvertToBezier_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <ShapeUpgrade_ShapeDivide.hxx> |
27 | class TopoDS_Shape; |
28 | class ShapeUpgrade_FaceDivide; |
29 | class Message_Msg; |
30 | |
31 | |
32 | //! API class for performing conversion of 3D, 2D curves to bezier curves |
33 | //! and surfaces to bezier based surfaces ( |
34 | //! bezier surface, |
35 | //! surface of revolution based on bezier curve, |
36 | //! offset surface based on any previous type). |
37 | class ShapeUpgrade_ShapeConvertToBezier : public ShapeUpgrade_ShapeDivide |
38 | { |
39 | public: |
40 | |
41 | DEFINE_STANDARD_ALLOC |
42 | |
43 | |
44 | //! Empty constructor. |
45 | Standard_EXPORT ShapeUpgrade_ShapeConvertToBezier(); |
46 | |
47 | //! Initialize by a Shape. |
48 | Standard_EXPORT ShapeUpgrade_ShapeConvertToBezier(const TopoDS_Shape& S); |
49 | |
50 | //! Sets mode for conversion 2D curves to bezier. |
51 | void Set2dConversion (const Standard_Boolean mode); |
52 | |
53 | //! Returns the 2D conversion mode. |
54 | Standard_Boolean Get2dConversion() const; |
55 | |
56 | //! Sets mode for conversion 3d curves to bezier. |
57 | void Set3dConversion (const Standard_Boolean mode); |
58 | |
59 | //! Returns the 3D conversion mode. |
60 | Standard_Boolean Get3dConversion() const; |
61 | |
62 | //! Sets mode for conversion surfaces curves to |
63 | //! bezier basis. |
64 | void SetSurfaceConversion (const Standard_Boolean mode); |
65 | |
66 | //! Returns the surface conversion mode. |
67 | Standard_Boolean GetSurfaceConversion() const; |
68 | |
69 | //! Sets mode for conversion Geom_Line to bezier. |
70 | void Set3dLineConversion (const Standard_Boolean mode); |
71 | |
72 | //! Returns the Geom_Line conversion mode. |
73 | Standard_Boolean Get3dLineConversion() const; |
74 | |
75 | //! Sets mode for conversion Geom_Circle to bezier. |
76 | void Set3dCircleConversion (const Standard_Boolean mode); |
77 | |
78 | //! Returns the Geom_Circle conversion mode. |
79 | Standard_Boolean Get3dCircleConversion() const; |
80 | |
81 | //! Sets mode for conversion Geom_Conic to bezier. |
82 | void Set3dConicConversion (const Standard_Boolean mode); |
83 | |
84 | //! Returns the Geom_Conic conversion mode. |
85 | Standard_Boolean Get3dConicConversion() const; |
86 | |
87 | //! Sets mode for conversion Geom_Plane to Bezier |
88 | void SetPlaneMode (const Standard_Boolean mode); |
89 | |
90 | //! Returns the Geom_Pline conversion mode. |
91 | Standard_Boolean GetPlaneMode() const; |
92 | |
93 | //! Sets mode for conversion Geom_SurfaceOfRevolution to Bezier |
94 | void SetRevolutionMode (const Standard_Boolean mode); |
95 | |
96 | //! Returns the Geom_SurfaceOfRevolution conversion mode. |
97 | Standard_Boolean GetRevolutionMode() const; |
98 | |
99 | //! Sets mode for conversion Geom_SurfaceOfLinearExtrusion to Bezier |
100 | void SetExtrusionMode (const Standard_Boolean mode); |
101 | |
102 | //! Returns the Geom_SurfaceOfLinearExtrusion conversion mode. |
103 | Standard_Boolean GetExtrusionMode() const; |
104 | |
105 | //! Sets mode for conversion Geom_BSplineSurface to Bezier |
106 | void SetBSplineMode (const Standard_Boolean mode); |
107 | |
108 | //! Returns the Geom_BSplineSurface conversion mode. |
109 | Standard_Boolean GetBSplineMode() const; |
110 | |
111 | //! Performs converting and computes the resulting shape |
112 | Standard_EXPORT virtual Standard_Boolean Perform (const Standard_Boolean newContext = Standard_True) Standard_OVERRIDE; |
113 | |
114 | |
115 | |
116 | |
117 | protected: |
118 | |
119 | |
120 | //! Returns the tool for dividing faces. |
121 | Standard_EXPORT virtual Handle(ShapeUpgrade_FaceDivide) GetSplitFaceTool() const Standard_OVERRIDE; |
122 | |
123 | Standard_EXPORT virtual Message_Msg GetFaceMsg() const Standard_OVERRIDE; |
124 | |
125 | Standard_EXPORT virtual Message_Msg GetWireMsg() const Standard_OVERRIDE; |
126 | |
127 | //! Returns a message decsribing modification of a shape. |
128 | Standard_EXPORT virtual Message_Msg GetEdgeMsg() const Standard_OVERRIDE; |
129 | |
130 | |
131 | |
132 | |
133 | private: |
134 | |
135 | |
136 | |
137 | Standard_Boolean my2dMode; |
138 | Standard_Boolean my3dMode; |
139 | Standard_Boolean mySurfaceMode; |
140 | Standard_Boolean my3dLineMode; |
141 | Standard_Boolean my3dCircleMode; |
142 | Standard_Boolean my3dConicMode; |
143 | Standard_Boolean myPlaneMode; |
144 | Standard_Boolean myRevolutionMode; |
145 | Standard_Boolean myExtrusionMode; |
146 | Standard_Boolean myBSplineMode; |
147 | Standard_Integer myLevel; |
148 | |
149 | |
150 | }; |
151 | |
152 | |
153 | #include <ShapeUpgrade_ShapeConvertToBezier.lxx> |
154 | |
155 | |
156 | |
157 | |
158 | |
159 | #endif // _ShapeUpgrade_ShapeConvertToBezier_HeaderFile |