Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:25:53

0001 // Created on: 1998-03-16
0002 // Created by: Pierre BARRAS
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ShapeUpgrade_SplitSurface_HeaderFile
0018 #define _ShapeUpgrade_SplitSurface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TColStd_HSequenceOfReal.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_Transient.hxx>
0026 #include <ShapeExtend_Status.hxx>
0027 class Geom_Surface;
0028 class ShapeExtend_CompositeSurface;
0029 
0030 // resolve name collisions with X11 headers
0031 #ifdef Status
0032   #undef Status
0033 #endif
0034 
0035 class ShapeUpgrade_SplitSurface;
0036 DEFINE_STANDARD_HANDLE(ShapeUpgrade_SplitSurface, Standard_Transient)
0037 
0038 //! Splits a Surface with a criterion.
0039 class ShapeUpgrade_SplitSurface : public Standard_Transient
0040 {
0041 
0042 public:
0043   //! Empty constructor.
0044   Standard_EXPORT ShapeUpgrade_SplitSurface();
0045 
0046   //! Initializes with single supporting surface.
0047   Standard_EXPORT void Init(const Handle(Geom_Surface)& S);
0048 
0049   //! Initializes with single supporting surface with bounding parameters.
0050   Standard_EXPORT void Init(const Handle(Geom_Surface)& S,
0051                             const Standard_Real         UFirst,
0052                             const Standard_Real         ULast,
0053                             const Standard_Real         VFirst,
0054                             const Standard_Real         VLast,
0055                             const Standard_Real         theArea = 0.);
0056 
0057   //! Sets U parameters where splitting has to be done
0058   Standard_EXPORT void SetUSplitValues(const Handle(TColStd_HSequenceOfReal)& UValues);
0059 
0060   //! Sets V parameters where splitting has to be done
0061   Standard_EXPORT void SetVSplitValues(const Handle(TColStd_HSequenceOfReal)& VValues);
0062 
0063   //! Performs splitting of the supporting surface.
0064   //! If resulting surface is B-Spline and Segment is True,
0065   //! the result is composed with segments of the surface bounded
0066   //! by the U and V SplitValues (method Geom_BSplineSurface::Segment
0067   //! is used).
0068   //! If Segment is False, the result is composed with
0069   //! Geom_RectangularTrimmedSurface all based on the same complete
0070   //! surface.
0071   //! Fields myNbResultingRow and myNbResultingCol must be set to
0072   //! specify the size of resulting grid of surfaces.
0073   Standard_EXPORT virtual void Build(const Standard_Boolean Segment);
0074 
0075   //! Calculates points for correction/splitting of the surface.
0076   Standard_EXPORT virtual void Compute(const Standard_Boolean Segment = Standard_True);
0077 
0078   //! Performs correction/splitting of the surface.
0079   //! First defines splitting values by method Compute(), then calls method Build().
0080   Standard_EXPORT void Perform(const Standard_Boolean Segment = Standard_True);
0081 
0082   //! returns all the U splitting values including the
0083   //! First and Last parameters of the input surface
0084   Standard_EXPORT const Handle(TColStd_HSequenceOfReal)& USplitValues() const;
0085 
0086   //! returns all the splitting V values including the
0087   //! First and Last parameters of the input surface
0088   Standard_EXPORT const Handle(TColStd_HSequenceOfReal)& VSplitValues() const;
0089 
0090   //! Returns the status
0091   //! OK    - no splitting is needed
0092   //! DONE1 - splitting required and gives more than one patch
0093   //! DONE2 - splitting is required, but gives only single patch (initial)
0094   //! DONE3 - geometric form of the surface or parametrisation is modified
0095   Standard_EXPORT Standard_Boolean Status(const ShapeExtend_Status status) const;
0096 
0097   //! Returns obtained surfaces after splitting as CompositeSurface
0098   Standard_EXPORT const Handle(ShapeExtend_CompositeSurface)& ResSurfaces() const;
0099 
0100   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_SplitSurface, Standard_Transient)
0101 
0102 protected:
0103   Handle(TColStd_HSequenceOfReal)      myUSplitValues;
0104   Handle(TColStd_HSequenceOfReal)      myVSplitValues;
0105   Standard_Integer                     myNbResultingRow;
0106   Standard_Integer                     myNbResultingCol;
0107   Handle(Geom_Surface)                 mySurface;
0108   Standard_Integer                     myStatus;
0109   Handle(ShapeExtend_CompositeSurface) myResSurfaces;
0110   Standard_Real                        myArea;
0111   Standard_Real                        myUsize;
0112   Standard_Real                        myVsize;
0113 
0114 private:
0115 };
0116 
0117 #endif // _ShapeUpgrade_SplitSurface_HeaderFile