Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-01 08:33:25

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 sprcified 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   Standard_Real& MaxArea();
0040 
0041   //! Set number of parts expected
0042   //! for the case of splitting by number
0043   Standard_Integer& NbParts();
0044 
0045   //! Set fixed numbers of splits in U and V directions.
0046   //! Only for "Splitting By Numbers" mode
0047   void SetNumbersUVSplits(const Standard_Integer theNbUsplits, const Standard_Integer 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 Standard_Boolean theIsSplittingByNumber);
0054 
0055 protected:
0056   //! Returns the tool for splitting faces.
0057   Standard_EXPORT virtual Handle(ShapeUpgrade_FaceDivide) GetSplitFaceTool() const
0058     Standard_OVERRIDE;
0059 
0060 private:
0061   Standard_Real    myMaxArea;
0062   Standard_Integer myNbParts;
0063   Standard_Integer myUnbSplit;
0064   Standard_Integer myVnbSplit;
0065   Standard_Boolean myIsSplittingByNumber;
0066 };
0067 
0068 #include <ShapeUpgrade_ShapeDivideArea.lxx>
0069 
0070 #endif // _ShapeUpgrade_ShapeDivideArea_HeaderFile