1840898f9248a00878faa11ec60a6735661d214c
[occt.git] / src / ShapeUpgrade / ShapeUpgrade_SplitCurve.hxx
1 // Created on: 1998-03-12
2 // Created by: Pierre BARRAS
3 // Copyright (c) 1998-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_SplitCurve_HeaderFile
18 #define _ShapeUpgrade_SplitCurve_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TColStd_HSequenceOfReal.hxx>
24 #include <Standard_Integer.hxx>
25 #include <MMgt_TShared.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <ShapeExtend_Status.hxx>
29
30
31 class ShapeUpgrade_SplitCurve;
32 DEFINE_STANDARD_HANDLE(ShapeUpgrade_SplitCurve, MMgt_TShared)
33
34 //! Splits a  curve with a  criterion.
35 class ShapeUpgrade_SplitCurve : public MMgt_TShared
36 {
37
38 public:
39
40   
41   //! Empty constructor.
42   Standard_EXPORT ShapeUpgrade_SplitCurve();
43   
44   //! Initializes with curve first and last parameters.
45   Standard_EXPORT void Init (const Standard_Real First, const Standard_Real Last);
46   
47   //! Sets the parameters where splitting has to be done.
48   Standard_EXPORT void SetSplitValues (const Handle(TColStd_HSequenceOfReal)& SplitValues);
49   
50   //! If Segment is True, the result is composed with
51   //! segments of the curve bounded by the SplitValues.  If
52   //! Segment is False, the result is composed with trimmed
53   //! Curves all based on the same complete curve.
54   Standard_EXPORT virtual void Build (const Standard_Boolean Segment);
55   
56   //! returns all the splitting values including the
57   //! First and Last parameters of the input curve
58   //! Merges input split values and new ones into myGlobalKnots
59   Standard_EXPORT const Handle(TColStd_HSequenceOfReal)& SplitValues() const;
60   
61   //! Calculates points for correction/splitting of the curve
62   Standard_EXPORT virtual void Compute();
63   
64   //! Performs correction/splitting of the curve.
65   //! First defines splitting values by method Compute(), then calls method Build().
66   Standard_EXPORT void Perform (const Standard_Boolean Segment = Standard_True);
67   
68   //! Returns the status
69   //! OK    - no splitting is needed
70   //! DONE1 - splitting required and gives more than one segment
71   //! DONE2 - splitting is required, but gives only one segment (initial)
72   //! DONE3 - geometric form of the curve or parametrisation is modified
73   Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
74
75
76
77
78   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_SplitCurve,MMgt_TShared)
79
80 protected:
81
82
83   Handle(TColStd_HSequenceOfReal) mySplitValues;
84   Standard_Integer myNbCurves;
85   Standard_Integer myStatus;
86
87
88 private:
89
90
91
92
93 };
94
95
96
97
98
99
100
101 #endif // _ShapeUpgrade_SplitCurve_HeaderFile