Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:56

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 
0051 
0052   //! Empty Constructor
0053   Standard_EXPORT ShapeFix_Shape();
0054 
0055   //! Initislises by shape.
0056   Standard_EXPORT ShapeFix_Shape(const TopoDS_Shape& shape);
0057 
0058   //! Initislises by shape.
0059   Standard_EXPORT void Init (const TopoDS_Shape& shape);
0060 
0061   //! Iterates on sub- shape and performs fixes
0062   Standard_EXPORT Standard_Boolean Perform (const Message_ProgressRange& theProgress = Message_ProgressRange());
0063 
0064   //! Returns resulting shape
0065   Standard_EXPORT TopoDS_Shape Shape() const;
0066 
0067   //! Returns tool for fixing solids.
0068     Handle(ShapeFix_Solid) FixSolidTool() const;
0069 
0070   //! Returns tool for fixing shells.
0071     Handle(ShapeFix_Shell) FixShellTool() const;
0072 
0073   //! Returns tool for fixing faces.
0074     Handle(ShapeFix_Face) FixFaceTool() const;
0075 
0076   //! Returns tool for fixing wires.
0077     Handle(ShapeFix_Wire) FixWireTool() const;
0078 
0079   //! Returns tool for fixing edges.
0080     Handle(ShapeFix_Edge) FixEdgeTool() const;
0081 
0082   //! Returns the status of the last Fix.
0083   //! This can be a combination of the following flags:
0084   //! ShapeExtend_DONE1: some free edges were fixed
0085   //! ShapeExtend_DONE2: some free wires were fixed
0086   //! ShapeExtend_DONE3: some free faces were fixed
0087   //! ShapeExtend_DONE4: some free shells were fixed
0088   //! ShapeExtend_DONE5: some free solids were fixed
0089   //! ShapeExtend_DONE6: shapes in compound(s) were fixed
0090   Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
0091 
0092   //! Sets message registrator
0093   Standard_EXPORT virtual void SetMsgRegistrator (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 
0133 
0134 
0135   DEFINE_STANDARD_RTTIEXT(ShapeFix_Shape,ShapeFix_Root)
0136 
0137 protected:
0138 
0139 
0140   //! Fixes same parameterization problem on the passed shape
0141   //! by updating tolerances of the corresponding topological
0142   //! entities.
0143   Standard_EXPORT void SameParameter (const TopoDS_Shape& shape, const Standard_Boolean enforce,
0144                                       const Message_ProgressRange& theProgress = Message_ProgressRange());
0145 
0146   TopoDS_Shape myResult;
0147   Handle(ShapeFix_Solid) myFixSolid;
0148   TopTools_MapOfShape myMapFixingShape;
0149   Standard_Integer myFixSolidMode;
0150   Standard_Integer myFixShellMode;
0151   Standard_Integer myFixFaceMode;
0152   Standard_Integer myFixWireMode;
0153   Standard_Integer myFixSameParameterMode;
0154   Standard_Integer myFixVertexPositionMode;
0155   Standard_Integer myFixVertexTolMode;
0156   Standard_Integer myStatus;
0157 
0158 
0159 private:
0160 
0161 
0162 
0163 
0164 };
0165 
0166 
0167 #include <ShapeFix_Shape.lxx>
0168 
0169 
0170 
0171 
0172 
0173 #endif // _ShapeFix_Shape_HeaderFile