Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:18:36

0001 // Created on: 2006-08-07
0002 // Created by: Galina KULIKOVA
0003 // Copyright (c) 2006-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _ShapeUpgrade_FaceDivideArea_HeaderFile
0017 #define _ShapeUpgrade_FaceDivideArea_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <ShapeUpgrade_FaceDivide.hxx>
0023 class TopoDS_Face;
0024 
0025 //! Divides face by max area criterium.
0026 class ShapeUpgrade_FaceDivideArea : public ShapeUpgrade_FaceDivide
0027 {
0028 
0029 public:
0030   //! Creates empty constructor.
0031   Standard_EXPORT ShapeUpgrade_FaceDivideArea();
0032 
0033   Standard_EXPORT ShapeUpgrade_FaceDivideArea(const TopoDS_Face& F);
0034 
0035   //! Performs splitting and computes the resulting shell
0036   //! The context is used to keep track of former splittings
0037   Standard_EXPORT bool Perform(const double theArea = 0.) override;
0038 
0039   //! Set max area allowed for faces
0040   double& MaxArea();
0041 
0042   //! Set number of parts expected
0043   int& NbParts();
0044 
0045   //! Set fixed numbers of splits in U and V directions.
0046   //! Only for "Splitting By Numbers" mode
0047   void SetNumbersUVSplits(const int theNbUsplits, const int theNbVsplits);
0048 
0049   //! Set splitting mode
0050   //! If the mode is "splitting by number",
0051   //! the face is splitted approximately into <myNbParts> parts,
0052   //! the parts are similar to squares in 2D.
0053   void SetSplittingByNumber(const bool theIsSplittingByNumber);
0054 
0055   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_FaceDivideArea, ShapeUpgrade_FaceDivide)
0056 
0057 private:
0058   double myMaxArea;
0059   int    myNbParts;
0060   int    myUnbSplit;
0061   int    myVnbSplit;
0062   bool   myIsSplittingByNumber;
0063 };
0064 
0065 #include <ShapeUpgrade_FaceDivideArea.lxx>
0066 
0067 #endif // _ShapeUpgrade_FaceDivideArea_HeaderFile