Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-04 08:44:08

0001 // Created on: 1998-08-12
0002 // Created by: DATA EXCHANGE TEAM
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 _ShapeFix_Shape_HeaderFile
0018 #define _ShapeFix_Shape_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <TopTools_MapOfShape.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <ShapeFix_Root.hxx>
0027 #include <ShapeExtend_Status.hxx>
0028 #include <Message_ProgressRange.hxx>
0029 
0030 class ShapeFix_Solid;
0031 class ShapeFix_Shell;
0032 class ShapeFix_Face;
0033 class ShapeFix_Wire;
0034 class ShapeFix_Edge;
0035 class ShapeExtend_BasicMsgRegistrator;
0036 
0037 // resolve name collisions with X11 headers
0038 #ifdef Status
0039   #undef Status
0040 #endif
0041 
0042 class ShapeFix_Shape;
0043 DEFINE_STANDARD_HANDLE(ShapeFix_Shape, ShapeFix_Root)
0044 
0045 //! Fixing shape in general
0046 class ShapeFix_Shape : public ShapeFix_Root
0047 {
0048 
0049 public:
0050   //! Empty Constructor
0051   Standard_EXPORT ShapeFix_Shape();
0052 
0053   //! Initislises by shape.
0054   Standard_EXPORT ShapeFix_Shape(const TopoDS_Shape& shape);
0055 
0056   //! Initislises by shape.
0057   Standard_EXPORT void Init(const TopoDS_Shape& shape);
0058 
0059   //! Iterates on sub- shape and performs fixes
0060   Standard_EXPORT Standard_Boolean
0061     Perform(const Message_ProgressRange& theProgress = Message_ProgressRange());
0062 
0063   //! Returns resulting shape
0064   Standard_EXPORT TopoDS_Shape Shape() const;
0065 
0066   //! Returns tool for fixing solids.
0067   Handle(ShapeFix_Solid) FixSolidTool() const;
0068 
0069   //! Returns tool for fixing shells.
0070   Handle(ShapeFix_Shell) FixShellTool() const;
0071 
0072   //! Returns tool for fixing faces.
0073   Handle(ShapeFix_Face) FixFaceTool() const;
0074 
0075   //! Returns tool for fixing wires.
0076   Handle(ShapeFix_Wire) FixWireTool() const;
0077 
0078   //! Returns tool for fixing edges.
0079   Handle(ShapeFix_Edge) FixEdgeTool() const;
0080 
0081   //! Returns the status of the last Fix.
0082   //! This can be a combination of the following flags:
0083   //! ShapeExtend_DONE1: some free edges were fixed
0084   //! ShapeExtend_DONE2: some free wires were fixed
0085   //! ShapeExtend_DONE3: some free faces were fixed
0086   //! ShapeExtend_DONE4: some free shells were fixed
0087   //! ShapeExtend_DONE5: some free solids were fixed
0088   //! ShapeExtend_DONE6: shapes in compound(s) were fixed
0089   Standard_EXPORT Standard_Boolean Status(const ShapeExtend_Status status) const;
0090 
0091   //! Sets message registrator
0092   Standard_EXPORT virtual void SetMsgRegistrator(
0093     const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) Standard_OVERRIDE;
0094 
0095   //! Sets basic precision value (also to FixSolidTool)
0096   Standard_EXPORT virtual void SetPrecision(const Standard_Real preci) Standard_OVERRIDE;
0097 
0098   //! Sets minimal allowed tolerance (also to FixSolidTool)
0099   Standard_EXPORT virtual void SetMinTolerance(const Standard_Real mintol) Standard_OVERRIDE;
0100 
0101   //! Sets maximal allowed tolerance (also to FixSolidTool)
0102   Standard_EXPORT virtual void SetMaxTolerance(const Standard_Real maxtol) Standard_OVERRIDE;
0103 
0104   //! Returns (modifiable) the mode for applying fixes of
0105   //! ShapeFix_Solid, by default True.
0106   Standard_Integer& FixSolidMode();
0107 
0108   //! Returns (modifiable) the mode for applying fixes of
0109   //! ShapeFix_Shell, by default True.
0110   Standard_Integer& FixFreeShellMode();
0111 
0112   //! Returns (modifiable) the mode for applying fixes of
0113   //! ShapeFix_Face, by default True.
0114   Standard_Integer& FixFreeFaceMode();
0115 
0116   //! Returns (modifiable) the mode for applying fixes of
0117   //! ShapeFix_Wire, by default True.
0118   Standard_Integer& FixFreeWireMode();
0119 
0120   //! Returns (modifiable) the mode for applying
0121   //! ShapeFix::SameParameter after all fixes, by default True.
0122   Standard_Integer& FixSameParameterMode();
0123 
0124   //! Returns (modifiable) the mode for applying
0125   //! ShapeFix::FixVertexPosition before all fixes, by default False.
0126   Standard_Integer& FixVertexPositionMode();
0127 
0128   //! Returns (modifiable) the mode for fixing tolerances of vertices on whole shape
0129   //! after performing all fixes
0130   Standard_Integer& FixVertexTolMode();
0131 
0132   DEFINE_STANDARD_RTTIEXT(ShapeFix_Shape, ShapeFix_Root)
0133 
0134 protected:
0135   //! Fixes same parameterization problem on the passed shape
0136   //! by updating tolerances of the corresponding topological
0137   //! entities.
0138   Standard_EXPORT void SameParameter(
0139     const TopoDS_Shape&          shape,
0140     const Standard_Boolean       enforce,
0141     const Message_ProgressRange& theProgress = Message_ProgressRange());
0142 
0143   TopoDS_Shape           myResult;
0144   Handle(ShapeFix_Solid) myFixSolid;
0145   TopTools_MapOfShape    myMapFixingShape;
0146   Standard_Integer       myFixSolidMode;
0147   Standard_Integer       myFixShellMode;
0148   Standard_Integer       myFixFaceMode;
0149   Standard_Integer       myFixWireMode;
0150   Standard_Integer       myFixSameParameterMode;
0151   Standard_Integer       myFixVertexPositionMode;
0152   Standard_Integer       myFixVertexTolMode;
0153   Standard_Integer       myStatus;
0154 
0155 private:
0156 };
0157 
0158 #include <ShapeFix_Shape.lxx>
0159 
0160 #endif // _ShapeFix_Shape_HeaderFile