0026489: The class ShapeUpgrade_UnifySameDomain provides the results that are wrong...
[occt.git] / src / ShapeUpgrade / ShapeUpgrade_SplitSurface.hxx
1 // Created on: 1998-03-16
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_SplitSurface_HeaderFile
18 #define _ShapeUpgrade_SplitSurface_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 class Geom_Surface;
30 class ShapeExtend_CompositeSurface;
31
32
33 class ShapeUpgrade_SplitSurface;
34 DEFINE_STANDARD_HANDLE(ShapeUpgrade_SplitSurface, MMgt_TShared)
35
36 //! Splits a Surface with a criterion.
37 class ShapeUpgrade_SplitSurface : public MMgt_TShared
38 {
39
40 public:
41
42   
43   //! Empty constructor.
44   Standard_EXPORT ShapeUpgrade_SplitSurface();
45   
46   //! Initializes with single supporting surface.
47   Standard_EXPORT void Init (const Handle(Geom_Surface)& S);
48   
49   //! Initializes with single supporting surface with bounding parameters.
50   Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Real UFirst, const Standard_Real ULast, const Standard_Real VFirst, const Standard_Real VLast);
51   
52   //! Sets U parameters where splitting has to be done
53   Standard_EXPORT void SetUSplitValues (const Handle(TColStd_HSequenceOfReal)& UValues);
54   
55   //! Sets V parameters where splitting has to be done
56   Standard_EXPORT void SetVSplitValues (const Handle(TColStd_HSequenceOfReal)& VValues);
57   
58   //! Performs splitting of the supporting surface.
59   //! If resulting surface is B-Spline and Segment is True,
60   //! the result is composed with segments of the surface bounded
61   //! by the U and V SplitValues (method Geom_BSplineSurface::Segment
62   //! is used).
63   //! If Segment is False, the result is composed with
64   //! Geom_RectangularTrimmedSurface all based on the same complete
65   //! surface.
66   //! Fields myNbResultingRow and myNbResultingCol must be set to
67   //! specify the size of resulting grid of surfaces.
68   Standard_EXPORT virtual void Build (const Standard_Boolean Segment);
69   
70   //! Calculates points for correction/splitting of the surface.
71   Standard_EXPORT virtual void Compute (const Standard_Boolean Segment = Standard_True);
72   
73   //! Performs correction/splitting of the surface.
74   //! First defines splitting values by method Compute(), then calls method Build().
75   Standard_EXPORT void Perform (const Standard_Boolean Segment = Standard_True);
76   
77   //! returns all the U splitting values including the
78   //! First and Last parameters of the input surface
79   Standard_EXPORT const Handle(TColStd_HSequenceOfReal)& USplitValues() const;
80   
81   //! returns all the splitting V values including the
82   //! First and Last parameters of the input surface
83   Standard_EXPORT const Handle(TColStd_HSequenceOfReal)& VSplitValues() const;
84   
85   //! Returns the status
86   //! OK    - no splitting is needed
87   //! DONE1 - splitting required and gives more than one patch
88   //! DONE2 - splitting is required, but gives only single patch (initial)
89   //! DONE3 - geometric form of the surface or parametrisation is modified
90   Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
91   
92   //! Returns obtained surfaces after splitting as CompositeSurface
93   Standard_EXPORT const Handle(ShapeExtend_CompositeSurface)& ResSurfaces() const;
94
95
96
97
98   DEFINE_STANDARD_RTTI(ShapeUpgrade_SplitSurface,MMgt_TShared)
99
100 protected:
101
102
103   Handle(TColStd_HSequenceOfReal) myUSplitValues;
104   Handle(TColStd_HSequenceOfReal) myVSplitValues;
105   Standard_Integer myNbResultingRow;
106   Standard_Integer myNbResultingCol;
107   Handle(Geom_Surface) mySurface;
108   Standard_Integer myStatus;
109   Handle(ShapeExtend_CompositeSurface) myResSurfaces;
110
111
112 private:
113
114
115
116
117 };
118
119
120
121
122
123
124
125 #endif // _ShapeUpgrade_SplitSurface_HeaderFile