Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-03-04
0002 // Created by: Jean-Pierre COMBE
0003 // Copyright (c) 1997-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 _PrsDim_OffsetDimension_HeaderFile
0018 #define _PrsDim_OffsetDimension_HeaderFile
0019 
0020 #include <PrsDim_Relation.hxx>
0021 #include <PrsDim_KindOfDimension.hxx>
0022 
0023 DEFINE_STANDARD_HANDLE(PrsDim_OffsetDimension, PrsDim_Relation)
0024 
0025 //! A framework to display dimensions of offsets.
0026 //! The relation between the offset and the basis shape
0027 //! is indicated. This relation is displayed with arrows and
0028 //! text. The text gives the dsitance between the offset
0029 //! and the basis shape.
0030 class PrsDim_OffsetDimension : public PrsDim_Relation
0031 {
0032   DEFINE_STANDARD_RTTIEXT(PrsDim_OffsetDimension, PrsDim_Relation)
0033 public:
0034 
0035   //! Constructs the offset display object defined by the
0036   //! first shape aFShape, the second shape aSShape, the
0037   //! dimension aVal, and the text aText.
0038   Standard_EXPORT PrsDim_OffsetDimension(const TopoDS_Shape& FistShape, const TopoDS_Shape& SecondShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
0039 
0040   //! Indicates that the dimension we are concerned with is an offset.
0041   virtual PrsDim_KindOfDimension KindOfDimension() const Standard_OVERRIDE { return PrsDim_KOD_OFFSET; }
0042 
0043   //! Returns true if the offset datum is movable.
0044   virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
0045 
0046   //! Sets a transformation aTrsf for presentation and
0047   //! selection to a relative position.
0048   void SetRelativePos (const gp_Trsf& aTrsf) { myRelativePos = aTrsf; }
0049 
0050 private:
0051 
0052   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0053                                         const Handle(Prs3d_Presentation)& thePrs,
0054                                         const Standard_Integer theMode) Standard_OVERRIDE;
0055 
0056   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0057                                                  const Standard_Integer theMode) Standard_OVERRIDE;
0058 
0059   Standard_EXPORT void ComputeTwoFacesOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
0060 
0061   Standard_EXPORT void ComputeTwoAxesOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
0062 
0063   Standard_EXPORT void ComputeAxeFaceOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
0064 
0065 private:
0066 
0067   gp_Pnt myFAttach;
0068   gp_Pnt mySAttach;
0069   gp_Dir myDirAttach;
0070   gp_Dir myDirAttach2;
0071   gp_Trsf myRelativePos;
0072 
0073 };
0074 
0075 #endif // _PrsDim_OffsetDimension_HeaderFile