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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _ShapeUpgrade_SplitSurface_HeaderFile
18 #define _ShapeUpgrade_SplitSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TColStd_HSequenceOfReal.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Transient.hxx>
26 #include <ShapeExtend_Status.hxx>
28 class ShapeExtend_CompositeSurface;
30 // resolve name collisions with X11 headers
35 class ShapeUpgrade_SplitSurface;
36 DEFINE_STANDARD_HANDLE(ShapeUpgrade_SplitSurface, Standard_Transient)
38 //! Splits a Surface with a criterion.
39 class ShapeUpgrade_SplitSurface : public Standard_Transient
45 //! Empty constructor.
46 Standard_EXPORT ShapeUpgrade_SplitSurface();
48 //! Initializes with single supporting surface.
49 Standard_EXPORT void Init (const Handle(Geom_Surface)& S);
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.);
57 //! Sets U parameters where splitting has to be done
58 Standard_EXPORT void SetUSplitValues (const Handle(TColStd_HSequenceOfReal)& UValues);
60 //! Sets V parameters where splitting has to be done
61 Standard_EXPORT void SetVSplitValues (const Handle(TColStd_HSequenceOfReal)& VValues);
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
68 //! If Segment is False, the result is composed with
69 //! Geom_RectangularTrimmedSurface all based on the same complete
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);
75 //! Calculates points for correction/splitting of the surface.
76 Standard_EXPORT virtual void Compute (const Standard_Boolean Segment = Standard_True);
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);
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;
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;
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;
97 //! Returns obtained surfaces after splitting as CompositeSurface
98 Standard_EXPORT const Handle(ShapeExtend_CompositeSurface)& ResSurfaces() const;
103 DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_SplitSurface,Standard_Transient)
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;
133 #endif // _ShapeUpgrade_SplitSurface_HeaderFile