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