Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-05 09:23:43

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 //! A framework to define display of 2D chamfers.
0027 //! A chamfer is displayed with arrows and text. The text
0028 //! gives the length of the chamfer if it is a symmetrical
0029 //! chamfer, or the angle if it is not.
0030 class PrsDim_Chamf2dDimension : public PrsDim_Relation
0031 {
0032   DEFINE_STANDARD_RTTIEXT(PrsDim_Chamf2dDimension, PrsDim_Relation)
0033 public:
0034   //! Constructs the display object for 2D chamfers.
0035   //! This object is defined by the face aFShape, the
0036   //! dimension aVal, the plane aPlane and the text aText.
0037   Standard_EXPORT PrsDim_Chamf2dDimension(const TopoDS_Shape&               aFShape,
0038                                           const occ::handle<Geom_Plane>&    aPlane,
0039                                           const double                      aVal,
0040                                           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,
0048                                           const occ::handle<Geom_Plane>&    aPlane,
0049                                           const double                      aVal,
0050                                           const TCollection_ExtendedString& aText,
0051                                           const gp_Pnt&                     aPosition,
0052                                           const DsgPrs_ArrowSide            aSymbolPrs,
0053                                           const double                      anArrowSize = 0.0);
0054 
0055   //! Indicates that we are concerned with a 2d length.
0056   PrsDim_KindOfDimension KindOfDimension() const override { return PrsDim_KOD_LENGTH; }
0057 
0058   //! Returns true if the 2d chamfer dimension is movable.
0059   bool IsMovable() const override { return true; }
0060 
0061 private:
0062   Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
0063                                const occ::handle<Prs3d_Presentation>&         thePrs,
0064                                const int                                      theMode) override;
0065 
0066   Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
0067                                         const int                               theMode) override;
0068 
0069 private:
0070   gp_Pnt myPntAttach;
0071   gp_Dir myDir;
0072 };
0073 
0074 #endif // _PrsDim_Chamf2dDimension_HeaderFile