Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-30 09:28: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 <NCollection_Sequence.hxx>
0024 #include <NCollection_HSequence.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <ShapeExtend_Status.hxx>
0028 class Geom_Surface;
0029 class ShapeExtend_CompositeSurface;
0030 
0031 // resolve name collisions with X11 headers
0032 #ifdef Status
0033   #undef Status
0034 #endif
0035 
0036 //! Splits a Surface with a criterion.
0037 class ShapeUpgrade_SplitSurface : public Standard_Transient
0038 {
0039 
0040 public:
0041   //! Empty constructor.
0042   Standard_EXPORT ShapeUpgrade_SplitSurface();
0043 
0044   //! Initializes with single supporting surface.
0045   Standard_EXPORT void Init(const occ::handle<Geom_Surface>& S);
0046 
0047   //! Initializes with single supporting surface with bounding parameters.
0048   Standard_EXPORT void Init(const occ::handle<Geom_Surface>& S,
0049                             const double                     UFirst,
0050                             const double                     ULast,
0051                             const double                     VFirst,
0052                             const double                     VLast,
0053                             const double                     theArea = 0.);
0054 
0055   //! Sets U parameters where splitting has to be done
0056   Standard_EXPORT void SetUSplitValues(const occ::handle<NCollection_HSequence<double>>& UValues);
0057 
0058   //! Sets V parameters where splitting has to be done
0059   Standard_EXPORT void SetVSplitValues(const occ::handle<NCollection_HSequence<double>>& VValues);
0060 
0061   //! Performs splitting of the supporting surface.
0062   //! If resulting surface is B-Spline and Segment is True,
0063   //! the result is composed with segments of the surface bounded
0064   //! by the U and V SplitValues (method Geom_BSplineSurface::Segment
0065   //! is used).
0066   //! If Segment is False, the result is composed with
0067   //! Geom_RectangularTrimmedSurface all based on the same complete
0068   //! surface.
0069   //! Fields myNbResultingRow and myNbResultingCol must be set to
0070   //! specify the size of resulting grid of surfaces.
0071   Standard_EXPORT virtual void Build(const bool Segment);
0072 
0073   //! Calculates points for correction/splitting of the surface.
0074   Standard_EXPORT virtual void Compute(const bool Segment = true);
0075 
0076   //! Performs correction/splitting of the surface.
0077   //! First defines splitting values by method Compute(), then calls method Build().
0078   Standard_EXPORT void Perform(const bool Segment = true);
0079 
0080   //! returns all the U splitting values including the
0081   //! First and Last parameters of the input surface
0082   Standard_EXPORT const occ::handle<NCollection_HSequence<double>>& USplitValues() const;
0083 
0084   //! returns all the splitting V values including the
0085   //! First and Last parameters of the input surface
0086   Standard_EXPORT const occ::handle<NCollection_HSequence<double>>& VSplitValues() const;
0087 
0088   //! Returns the status
0089   //! OK    - no splitting is needed
0090   //! DONE1 - splitting required and gives more than one patch
0091   //! DONE2 - splitting is required, but gives only single patch (initial)
0092   //! DONE3 - geometric form of the surface or parametrisation is modified
0093   Standard_EXPORT bool Status(const ShapeExtend_Status status) const;
0094 
0095   //! Returns obtained surfaces after splitting as CompositeSurface
0096   Standard_EXPORT const occ::handle<ShapeExtend_CompositeSurface>& ResSurfaces() const;
0097 
0098   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_SplitSurface, Standard_Transient)
0099 
0100 protected:
0101   occ::handle<NCollection_HSequence<double>> myUSplitValues;
0102   occ::handle<NCollection_HSequence<double>> myVSplitValues;
0103   int                                        myNbResultingRow;
0104   int                                        myNbResultingCol;
0105   occ::handle<Geom_Surface>                  mySurface;
0106   int                                        myStatus;
0107   occ::handle<ShapeExtend_CompositeSurface>  myResSurfaces;
0108   double                                     myArea;
0109   double                                     myUsize;
0110   double                                     myVsize;
0111 };
0112 
0113 #endif // _ShapeUpgrade_SplitSurface_HeaderFile