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