Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1999-08-09
0002 // Created by: Galina KULIKOVA
0003 // Copyright (c) 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_Root_HeaderFile
0018 #define _ShapeFix_Root_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <Standard_Transient.hxx>
0025 #include <Message_Gravity.hxx>
0026 #include <Standard_Integer.hxx>
0027 
0028 #include <ShapeExtend_BasicMsgRegistrator.hxx>
0029 
0030 class ShapeBuild_ReShape;
0031 class ShapeExtend_BasicMsgRegistrator;
0032 class Message_Msg;
0033 
0034 
0035 class ShapeFix_Root;
0036 DEFINE_STANDARD_HANDLE(ShapeFix_Root, Standard_Transient)
0037 
0038 //! Root class for fixing operations
0039 //! Provides context for recording changes (optional),
0040 //! basic precision value and limit (minimal and
0041 //! maximal) values for tolerances,
0042 //! and message registrator
0043 class ShapeFix_Root : public Standard_Transient
0044 {
0045 
0046 public:
0047 
0048   
0049   //! Empty Constructor (no context is created)
0050   Standard_EXPORT ShapeFix_Root();
0051   
0052   //! Copy all fields from another Root object
0053   Standard_EXPORT virtual void Set (const Handle(ShapeFix_Root)& Root);
0054   
0055   //! Sets context
0056   Standard_EXPORT virtual void SetContext (const Handle(ShapeBuild_ReShape)& context);
0057   
0058   //! Returns context
0059     Handle(ShapeBuild_ReShape) Context() const;
0060   
0061   //! Sets message registrator
0062   Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg);
0063   
0064   //! Returns message registrator
0065     Handle(ShapeExtend_BasicMsgRegistrator) MsgRegistrator() const;
0066   
0067   //! Sets basic precision value
0068   Standard_EXPORT virtual void SetPrecision (const Standard_Real preci);
0069   
0070   //! Returns basic precision value
0071     Standard_Real Precision() const;
0072   
0073   //! Sets minimal allowed tolerance
0074   Standard_EXPORT virtual void SetMinTolerance (const Standard_Real mintol);
0075   
0076   //! Returns minimal allowed tolerance
0077     Standard_Real MinTolerance() const;
0078   
0079   //! Sets maximal allowed tolerance
0080   Standard_EXPORT virtual void SetMaxTolerance (const Standard_Real maxtol);
0081   
0082   //! Returns maximal allowed tolerance
0083     Standard_Real MaxTolerance() const;
0084   
0085   //! Returns tolerance limited by [myMinTol,myMaxTol]
0086     Standard_Real LimitTolerance (const Standard_Real toler) const;
0087   
0088   //! Sends a message to be attached to the shape.
0089   //! Calls corresponding message of message registrator.
0090   Standard_EXPORT void SendMsg (const TopoDS_Shape& shape, const Message_Msg& message, const Message_Gravity gravity = Message_Info) const;
0091   
0092   //! Sends a message to be attached to myShape.
0093   //! Calls previous method.
0094     void SendMsg (const Message_Msg& message, const Message_Gravity gravity = Message_Info) const;
0095   
0096   //! Sends a warning to be attached to the shape.
0097   //! Calls SendMsg with gravity set to Message_Warning.
0098     void SendWarning (const TopoDS_Shape& shape, const Message_Msg& message) const;
0099   
0100   //! Calls previous method for myShape.
0101     void SendWarning (const Message_Msg& message) const;
0102   
0103   //! Sends a fail to be attached to the shape.
0104   //! Calls SendMsg with gravity set to Message_Fail.
0105     void SendFail (const TopoDS_Shape& shape, const Message_Msg& message) const;
0106   
0107   //! Calls previous method for myShape.
0108     void SendFail (const Message_Msg& message) const;
0109 
0110 
0111 
0112 
0113   DEFINE_STANDARD_RTTIEXT(ShapeFix_Root,Standard_Transient)
0114 
0115 protected:
0116 
0117   
0118   //! Auxiliary method for work with three-position
0119   //! (on/off/default) flags (modes) in ShapeFix.
0120     static Standard_Boolean NeedFix (const Standard_Integer flag, const Standard_Boolean def = Standard_True);
0121 
0122   TopoDS_Shape myShape;
0123 
0124 
0125 private:
0126 
0127 
0128   Handle(ShapeBuild_ReShape) myContext;
0129   Handle(ShapeExtend_BasicMsgRegistrator) myMsgReg;
0130   Standard_Real myPrecision;
0131   Standard_Real myMinTol;
0132   Standard_Real myMaxTol;
0133 
0134 
0135 };
0136 
0137 
0138 #include <ShapeFix_Root.lxx>
0139 
0140 
0141 
0142 
0143 
0144 #endif // _ShapeFix_Root_HeaderFile