Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/ShapeUpgrade_FaceDivide.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1998-02-18
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_FaceDivide_HeaderFile
0018 #define _ShapeUpgrade_FaceDivide_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopoDS_Face.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <ShapeUpgrade_Tool.hxx>
0026 #include <ShapeExtend_Status.hxx>
0027 class ShapeUpgrade_SplitSurface;
0028 class ShapeUpgrade_WireDivide;
0029 
0030 // resolve name collisions with X11 headers
0031 #ifdef Status
0032   #undef Status
0033 #endif
0034 
0035 //! Divides a Face (both edges in the wires, by splitting
0036 //! curves and pcurves, and the face itself, by splitting
0037 //! supporting surface) according to splitting criteria.
0038 //! * The domain of the face to divide is defined by the PCurves
0039 //! of the wires on the Face.
0040 //!
0041 //! * all the PCurves are supposed to be defined (in the parametric
0042 //! space of the supporting surface).
0043 //!
0044 //! The result is available after the call to the Build method.
0045 //! It is a Shell containing all the resulting Faces.
0046 //!
0047 //! All the modifications made during splitting are recorded in the
0048 //! external context (ShapeBuild_ReShape).
0049 class ShapeUpgrade_FaceDivide : public ShapeUpgrade_Tool
0050 {
0051 
0052 public:
0053   //! Creates empty constructor.
0054   Standard_EXPORT ShapeUpgrade_FaceDivide();
0055 
0056   //! Initialize by a Face.
0057   Standard_EXPORT ShapeUpgrade_FaceDivide(const TopoDS_Face& F);
0058 
0059   //! Initialize by a Face.
0060   Standard_EXPORT void Init(const TopoDS_Face& F);
0061 
0062   //! Purpose sets mode for trimming (segment) surface by
0063   //! wire UV bounds.
0064   Standard_EXPORT void SetSurfaceSegmentMode(const bool Segment);
0065 
0066   //! Performs splitting and computes the resulting shell
0067   //! The context is used to keep track of former splittings
0068   //! in order to keep sharings. It is updated according to
0069   //! modifications made.
0070   //! The optional argument <theArea> is used to initialize
0071   //! the tool for splitting surface in the case of
0072   //! splitting into N parts where N is user-defined.
0073   Standard_EXPORT virtual bool Perform(const double theArea = 0.);
0074 
0075   //! Performs splitting of surface and computes the shell
0076   //! from source face.
0077   //! The optional argument <theArea> is used to initialize
0078   //! the tool for splitting surface in the case of
0079   //! splitting into N parts where N is user-defined.
0080   Standard_EXPORT virtual bool SplitSurface(const double theArea = 0.);
0081 
0082   //! Performs splitting of curves of all the edges in the
0083   //! shape and divides these edges.
0084   Standard_EXPORT virtual bool SplitCurves();
0085 
0086   //! Gives the resulting Shell, or Face, or Null shape if not done.
0087   Standard_EXPORT TopoDS_Shape Result() const;
0088 
0089   //! Queries the status of last call to Perform
0090   //! OK   : no splitting was done (or no call to Perform)
0091   //! DONE1: some edges were split
0092   //! DONE2: surface was split
0093   //! DONE3: surface was modified without splitting
0094   //! FAIL1: some fails encountered during splitting wires
0095   //! FAIL2: face cannot be split
0096   Standard_EXPORT bool Status(const ShapeExtend_Status status) const;
0097 
0098   //! Sets the tool for splitting surfaces.
0099   Standard_EXPORT void SetSplitSurfaceTool(
0100     const occ::handle<ShapeUpgrade_SplitSurface>& splitSurfaceTool);
0101 
0102   //! Sets the tool for dividing edges on Face.
0103   Standard_EXPORT void SetWireDivideTool(
0104     const occ::handle<ShapeUpgrade_WireDivide>& wireDivideTool);
0105 
0106   //! Returns the tool for splitting surfaces.
0107   //! This tool must be already initialized.
0108   Standard_EXPORT virtual occ::handle<ShapeUpgrade_SplitSurface> GetSplitSurfaceTool() const;
0109 
0110   //! Returns the tool for dividing edges on Face.
0111   //! This tool must be already initialized.
0112   Standard_EXPORT virtual occ::handle<ShapeUpgrade_WireDivide> GetWireDivideTool() const;
0113 
0114   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_FaceDivide, ShapeUpgrade_Tool)
0115 
0116 protected:
0117   TopoDS_Face  myFace;
0118   TopoDS_Shape myResult;
0119   bool         mySegmentMode;
0120   int          myStatus;
0121 
0122 private:
0123   occ::handle<ShapeUpgrade_SplitSurface> mySplitSurfaceTool;
0124   occ::handle<ShapeUpgrade_WireDivide>   myWireDivideTool;
0125 };
0126 
0127 #endif // _ShapeUpgrade_FaceDivide_HeaderFile