42cf5bc1 |
1 | // Created on: 1999-05-13 |
2 | // Created by: data exchange team |
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_ConvertCurve3dToBezier_HeaderFile |
18 | #define _ShapeUpgrade_ConvertCurve3dToBezier_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TColGeom_HSequenceOfCurve.hxx> |
24 | #include <TColStd_HSequenceOfReal.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <ShapeUpgrade_SplitCurve3d.hxx> |
27 | |
28 | |
29 | class ShapeUpgrade_ConvertCurve3dToBezier; |
30 | DEFINE_STANDARD_HANDLE(ShapeUpgrade_ConvertCurve3dToBezier, ShapeUpgrade_SplitCurve3d) |
31 | |
32 | //! converts/splits a 3d curve of any type to a list of beziers |
33 | class ShapeUpgrade_ConvertCurve3dToBezier : public ShapeUpgrade_SplitCurve3d |
34 | { |
35 | |
36 | public: |
37 | |
38 | |
39 | //! Empty constructor |
40 | Standard_EXPORT ShapeUpgrade_ConvertCurve3dToBezier(); |
41 | |
42 | //! Sets mode for conversion Geom_Line to bezier. |
43 | void SetLineMode (const Standard_Boolean mode); |
44 | |
45 | //! Returns the Geom_Line conversion mode. |
46 | Standard_Boolean GetLineMode() const; |
47 | |
48 | //! Sets mode for conversion Geom_Circle to bezier. |
49 | void SetCircleMode (const Standard_Boolean mode); |
50 | |
51 | //! Returns the Geom_Circle conversion mode. |
52 | Standard_Boolean GetCircleMode() const; |
53 | |
54 | //! Returns the Geom_Conic conversion mode. |
55 | void SetConicMode (const Standard_Boolean mode); |
56 | |
57 | //! Performs converting and computes the resulting shape. |
58 | Standard_Boolean GetConicMode() const; |
59 | |
60 | //! Converts curve into a list of beziers, and stores the |
61 | //! splitting parameters on original curve. |
62 | Standard_EXPORT virtual void Compute() Standard_OVERRIDE; |
63 | |
64 | //! Splits a list of beziers computed by Compute method according |
65 | //! the split values and splitting parameters. |
66 | Standard_EXPORT virtual void Build (const Standard_Boolean Segment) Standard_OVERRIDE; |
67 | |
68 | //! Returns the list of splitted parameters in original curve |
69 | //! parametrisation. |
70 | Standard_EXPORT Handle(TColStd_HSequenceOfReal) SplitParams() const; |
71 | |
72 | |
73 | |
74 | |
75 | DEFINE_STANDARD_RTTI(ShapeUpgrade_ConvertCurve3dToBezier,ShapeUpgrade_SplitCurve3d) |
76 | |
77 | protected: |
78 | |
79 | |
80 | |
81 | |
82 | private: |
83 | |
84 | |
85 | //! Returns the list of bezier curves correspondent to original |
86 | //! curve. |
87 | Standard_EXPORT Handle(TColGeom_HSequenceOfCurve) Segments() const; |
88 | |
89 | Handle(TColGeom_HSequenceOfCurve) mySegments; |
90 | Handle(TColStd_HSequenceOfReal) mySplitParams; |
91 | Standard_Boolean myLineMode; |
92 | Standard_Boolean myCircleMode; |
93 | Standard_Boolean myConicMode; |
94 | |
95 | |
96 | }; |
97 | |
98 | |
99 | #include <ShapeUpgrade_ConvertCurve3dToBezier.lxx> |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | #endif // _ShapeUpgrade_ConvertCurve3dToBezier_HeaderFile |