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 <Standard_Real.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <ShapeExtend_Status.hxx>
30 class ShapeExtend_CompositeSurface;
32 // resolve name collisions with X11 headers
37 class ShapeUpgrade_SplitSurface;
38 DEFINE_STANDARD_HANDLE(ShapeUpgrade_SplitSurface, Standard_Transient)
40 //! Splits a Surface with a criterion.
41 class ShapeUpgrade_SplitSurface : public Standard_Transient
47 //! Empty constructor.
48 Standard_EXPORT ShapeUpgrade_SplitSurface();
50 //! Initializes with single supporting surface.
51 Standard_EXPORT void Init (const Handle(Geom_Surface)& S);
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);
56 //! Sets U parameters where splitting has to be done
57 Standard_EXPORT void SetUSplitValues (const Handle(TColStd_HSequenceOfReal)& UValues);
59 //! Sets V parameters where splitting has to be done
60 Standard_EXPORT void SetVSplitValues (const Handle(TColStd_HSequenceOfReal)& VValues);
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
67 //! If Segment is False, the result is composed with
68 //! Geom_RectangularTrimmedSurface all based on the same complete
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);
74 //! Calculates points for correction/splitting of the surface.
75 Standard_EXPORT virtual void Compute (const Standard_Boolean Segment = Standard_True);
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);
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;
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;
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;
96 //! Returns obtained surfaces after splitting as CompositeSurface
97 Standard_EXPORT const Handle(ShapeExtend_CompositeSurface)& ResSurfaces() const;
102 DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_SplitSurface,Standard_Transient)
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;
129 #endif // _ShapeUpgrade_SplitSurface_HeaderFile