Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-28 10:21:39

0001 // Created on: 2006-08-08
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_ShapeDivideArea_HeaderFile
0017 #define _ShapeUpgrade_ShapeDivideArea_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <ShapeUpgrade_ShapeDivide.hxx>
0024 class TopoDS_Shape;
0025 class ShapeUpgrade_FaceDivide;
0026 
0027 //! Divides faces from specified shape by max area criterium.
0028 class ShapeUpgrade_ShapeDivideArea : public ShapeUpgrade_ShapeDivide
0029 {
0030 public:
0031   DEFINE_STANDARD_ALLOC
0032 
0033   Standard_EXPORT ShapeUpgrade_ShapeDivideArea();
0034 
0035   //! Initialize by a Shape.
0036   Standard_EXPORT ShapeUpgrade_ShapeDivideArea(const TopoDS_Shape& S);
0037 
0038   //! Set max area allowed for faces
0039   double& MaxArea();
0040 
0041   //! Set number of parts expected
0042   //! for the case of splitting by number
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 protected:
0056   //! Returns the tool for splitting faces.
0057   Standard_EXPORT occ::handle<ShapeUpgrade_FaceDivide> GetSplitFaceTool() const override;
0058 
0059 private:
0060   double myMaxArea;
0061   int    myNbParts;
0062   int    myUnbSplit;
0063   int    myVnbSplit;
0064   bool   myIsSplittingByNumber;
0065 };
0066 
0067 #include <ShapeUpgrade_ShapeDivideArea.lxx>
0068 
0069 #endif // _ShapeUpgrade_ShapeDivideArea_HeaderFile