Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:33

0001 // Created on: 2015-08-06
0002 // Created by: Ilya Novikov
0003 // Copyright (c) 2004-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 
0017 #ifndef _XCAFDimTolObjects_GeomToleranceObject_HeaderFile
0018 #define _XCAFDimTolObjects_GeomToleranceObject_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <XCAFDimTolObjects_GeomToleranceType.hxx>
0023 #include <XCAFDimTolObjects_GeomToleranceTypeValue.hxx>
0024 #include <Standard_Real.hxx>
0025 #include <XCAFDimTolObjects_GeomToleranceMatReqModif.hxx>
0026 #include <XCAFDimTolObjects_GeomToleranceZoneModif.hxx>
0027 #include <XCAFDimTolObjects_GeomToleranceModifiersSequence.hxx>
0028 #include <Standard_Transient.hxx>
0029 #include <XCAFDimTolObjects_GeomToleranceModif.hxx>
0030 #include <XCAFDimTolObjects_ToleranceZoneAffectedPlane.hxx>
0031 #include <gp_Pln.hxx>
0032 #include <TopoDS_Shape.hxx>
0033 #include <TCollection_HAsciiString.hxx>
0034 
0035 class XCAFDimTolObjects_GeomToleranceObject;
0036 DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_GeomToleranceObject, Standard_Transient)
0037 
0038 //! Access object to store dimension and tolerance
0039 class XCAFDimTolObjects_GeomToleranceObject : public Standard_Transient
0040 {
0041 
0042 public:
0043   
0044   Standard_EXPORT XCAFDimTolObjects_GeomToleranceObject();
0045   
0046   Standard_EXPORT XCAFDimTolObjects_GeomToleranceObject(const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObj);
0047   
0048   //! Returns semantic name
0049   Standard_EXPORT Handle(TCollection_HAsciiString) GetSemanticName() const;
0050 
0051   //! Sets semantic name
0052   Standard_EXPORT void SetSemanticName(const Handle(TCollection_HAsciiString)& theName);
0053 
0054   //! Sets type of the object.
0055   Standard_EXPORT void SetType (const XCAFDimTolObjects_GeomToleranceType theType);
0056   
0057   //! Returns type of the object.
0058   Standard_EXPORT XCAFDimTolObjects_GeomToleranceType GetType() const;
0059   
0060   //! Sets type of tolerance value.
0061   Standard_EXPORT void SetTypeOfValue (const XCAFDimTolObjects_GeomToleranceTypeValue theTypeOfValue);
0062   
0063   //! Returns type of tolerance value.
0064   Standard_EXPORT XCAFDimTolObjects_GeomToleranceTypeValue GetTypeOfValue() const;
0065   
0066   //! Sets tolerance value.
0067   Standard_EXPORT void SetValue (const Standard_Real theValue);
0068   
0069   //! Returns tolerance value.
0070   Standard_EXPORT Standard_Real GetValue() const;
0071   
0072   //! Sets material requirement of the tolerance.
0073   Standard_EXPORT void SetMaterialRequirementModifier (const XCAFDimTolObjects_GeomToleranceMatReqModif theMatReqModif);
0074   
0075   //! Returns material requirement of the tolerance.
0076   Standard_EXPORT XCAFDimTolObjects_GeomToleranceMatReqModif GetMaterialRequirementModifier() const;
0077   
0078   //! Sets tolerance zone.
0079   Standard_EXPORT void SetZoneModifier (const XCAFDimTolObjects_GeomToleranceZoneModif theZoneModif);
0080   
0081   //! Returns tolerance zone.
0082   Standard_EXPORT XCAFDimTolObjects_GeomToleranceZoneModif GetZoneModifier() const;
0083   
0084   //! Sets value associated with tolerance zone.
0085   Standard_EXPORT void SetValueOfZoneModifier (const Standard_Real theValue);
0086   
0087   //! Returns value associated with tolerance zone.
0088   Standard_EXPORT Standard_Real GetValueOfZoneModifier() const;
0089   
0090   //! Sets new sequence of tolerance modifiers.
0091   Standard_EXPORT void SetModifiers (const XCAFDimTolObjects_GeomToleranceModifiersSequence& theModifiers);
0092   
0093   //! Adds a tolerance modifier to the sequence of modifiers.
0094   Standard_EXPORT void AddModifier (const XCAFDimTolObjects_GeomToleranceModif theModifier);
0095   
0096   //! Returns a sequence of modifiers of the tolerance.
0097   Standard_EXPORT XCAFDimTolObjects_GeomToleranceModifiersSequence GetModifiers() const;
0098   
0099   //! Sets the maximal upper tolerance value for tolerance with modifiers.
0100   Standard_EXPORT void SetMaxValueModifier (const Standard_Real theModifier);
0101   
0102   //! Returns the maximal upper tolerance.
0103   Standard_EXPORT Standard_Real GetMaxValueModifier() const;
0104 
0105   Standard_EXPORT void SetAxis (const gp_Ax2& theAxis);
0106   
0107   Standard_EXPORT gp_Ax2 GetAxis() const;
0108    
0109   Standard_EXPORT Standard_Boolean HasAxis () const;
0110 
0111   //! Sets annotation plane.
0112   void SetPlane (const gp_Ax2& thePlane)
0113   {
0114     myPlane = thePlane;
0115     myHasPlane = Standard_True;
0116   }
0117 
0118   //! Returns annotation plane.
0119   const gp_Ax2& GetPlane() const { return myPlane; }
0120 
0121   //! Sets reference point.
0122   void SetPoint (const gp_Pnt& thePnt)
0123   {
0124     myPnt = thePnt;
0125     myHasPnt = Standard_True;
0126   }
0127 
0128   //! Returns reference point.
0129   const gp_Pnt& GetPoint() const { return myPnt; }
0130 
0131   //! Sets text position.
0132   void SetPointTextAttach (const gp_Pnt& thePntText)
0133   {
0134     myPntText = thePntText;
0135     myHasPntText = Standard_True;
0136   }
0137 
0138   //! Returns the text position.
0139   const gp_Pnt& GetPointTextAttach() const 
0140   { 
0141     return myPntText; 
0142   }
0143 
0144   //! Returns True if the object has annotation plane.
0145   Standard_Boolean HasPlane() const { return myHasPlane; }
0146 
0147   //! Returns True if reference point is specified.
0148   Standard_Boolean HasPoint() const { return myHasPnt; }
0149   
0150   //! Returns True if text position is specified.
0151   Standard_Boolean HasPointText() const 
0152   { 
0153     return myHasPntText; 
0154   }
0155    
0156   //! Set graphical presentation for object.
0157   void SetPresentation(const TopoDS_Shape& thePresentation, 
0158     const Handle(TCollection_HAsciiString)& thePresentationName)
0159   {
0160     myPresentation = thePresentation;
0161     myPresentationName = thePresentationName;
0162   }
0163 
0164   //! Returns graphical presentation of the object.
0165   TopoDS_Shape GetPresentation() const
0166   {
0167     return myPresentation;
0168   }
0169 
0170   //! Returns graphical presentation of the object.
0171   Handle(TCollection_HAsciiString) GetPresentationName() const
0172   {
0173     return myPresentationName;
0174   }
0175 
0176   // Returns true, if affected plane is specified.
0177   bool HasAffectedPlane() const
0178   {
0179     return (myAffectedPlaneType != XCAFDimTolObjects_ToleranceZoneAffectedPlane_None);
0180   }
0181 
0182   // Returns type of affected plane.
0183   XCAFDimTolObjects_ToleranceZoneAffectedPlane GetAffectedPlaneType() const
0184   {
0185     return myAffectedPlaneType;
0186   }
0187 
0188   // Sets affected plane type.
0189   void SetAffectedPlaneType(const XCAFDimTolObjects_ToleranceZoneAffectedPlane theType)
0190   {
0191     myAffectedPlaneType = theType;
0192   }
0193 
0194   //! Sets affected plane.
0195   void SetAffectedPlane(const gp_Pln& thePlane)
0196   {
0197     myAffectedPlane = thePlane;
0198   }
0199 
0200   //! Sets affected plane.
0201   void SetAffectedPlane(const gp_Pln& thePlane,
0202                         const XCAFDimTolObjects_ToleranceZoneAffectedPlane theType)
0203   {
0204     myAffectedPlaneType = theType;
0205     myAffectedPlane = thePlane;
0206   }
0207 
0208   //! Returns affected plane.
0209   const gp_Pln& GetAffectedPlane() const
0210   { 
0211     return myAffectedPlane;
0212   }
0213 
0214   //! Dumps the content of me into the stream
0215   Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0216 
0217   DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_GeomToleranceObject,Standard_Transient)
0218 
0219 private: 
0220 
0221   XCAFDimTolObjects_GeomToleranceType myType;
0222   XCAFDimTolObjects_GeomToleranceTypeValue myTypeOfValue;
0223   Standard_Real myValue;
0224   XCAFDimTolObjects_GeomToleranceMatReqModif myMatReqModif;
0225   XCAFDimTolObjects_GeomToleranceZoneModif myZoneModif;
0226   Standard_Real myValueOfZoneModif;
0227   XCAFDimTolObjects_GeomToleranceModifiersSequence myModifiers;
0228   Standard_Real myMaxValueModif;
0229   gp_Ax2 myAxis;
0230   Standard_Boolean myHasAxis;
0231   gp_Ax2 myPlane;
0232   gp_Pnt myPnt;
0233   gp_Pnt myPntText;
0234   Standard_Boolean myHasPlane;
0235   Standard_Boolean myHasPnt;
0236   Standard_Boolean myHasPntText;
0237   TopoDS_Shape myPresentation;
0238   Handle(TCollection_HAsciiString) mySemanticName;
0239   Handle(TCollection_HAsciiString) myPresentationName;
0240   XCAFDimTolObjects_ToleranceZoneAffectedPlane myAffectedPlaneType;
0241   gp_Pln myAffectedPlane;
0242 
0243 };
0244 
0245 #endif // _XCAFDimTolObjects_GeomToleranceObject_HeaderFile