Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1996-12-05
0002 // Created by: Flore Lantheaume/Odile Olivier
0003 // Copyright (c) 1996-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_Chamf2dDimension_HeaderFile
0018 #define _PrsDim_Chamf2dDimension_HeaderFile
0019 
0020 #include <PrsDim_Relation.hxx>
0021 #include <DsgPrs_ArrowSide.hxx>
0022 #include <gp_Dir.hxx>
0023 
0024 class Geom_Plane;
0025 
0026 DEFINE_STANDARD_HANDLE(PrsDim_Chamf2dDimension, PrsDim_Relation)
0027 
0028 //! A framework to define display of 2D chamfers.
0029 //! A chamfer is displayed with arrows and text. The text
0030 //! gives the length of the chamfer if it is a symmetrical
0031 //! chamfer, or the angle if it is not.
0032 class PrsDim_Chamf2dDimension : public PrsDim_Relation
0033 {
0034   DEFINE_STANDARD_RTTIEXT(PrsDim_Chamf2dDimension, PrsDim_Relation)
0035 public:
0036 
0037   //! Constructs the display object for 2D chamfers.
0038   //! This object is defined by the face aFShape, the
0039   //! dimension aVal, the plane aPlane and the text aText.
0040   Standard_EXPORT PrsDim_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText);
0041   
0042   //! Constructs the display object for 2D chamfers.
0043   //! This object is defined by the face aFShape, the plane
0044   //! aPlane, the dimension aVal, the position aPosition,
0045   //! the type of arrow aSymbolPrs with the size
0046   //! anArrowSize, and the text aText.
0047   Standard_EXPORT PrsDim_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
0048 
0049   //! Indicates that we are concerned with a 2d length.
0050   virtual PrsDim_KindOfDimension KindOfDimension() const Standard_OVERRIDE { return PrsDim_KOD_LENGTH; }
0051 
0052   //! Returns true if the 2d chamfer dimension is movable.
0053   virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
0054 
0055 private:
0056 
0057   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0058                                         const Handle(Prs3d_Presentation)& thePrs,
0059                                         const Standard_Integer theMode) Standard_OVERRIDE;
0060 
0061   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0062                                                  const Standard_Integer theMode) Standard_OVERRIDE;
0063 
0064 private:
0065 
0066   gp_Pnt myPntAttach;
0067   gp_Dir myDir;
0068 
0069 };
0070 
0071 #endif // _PrsDim_Chamf2dDimension_HeaderFile