Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:18:50

0001 // Created on: 1998-01-24
0002 // Created by: Julia GERASIMOVA
0003 // Copyright (c) 1998-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_EqualDistanceRelation_HeaderFile
0018 #define _PrsDim_EqualDistanceRelation_HeaderFile
0019 
0020 #include <PrsDim_Relation.hxx>
0021 #include <PrsDim_TypeOfDist.hxx>
0022 #include <DsgPrs_ArrowSide.hxx>
0023 
0024 class Geom_Plane;
0025 
0026 //! A framework to display equivalent distances between
0027 //! shapes and a given plane.
0028 //! The distance is the length of a projection from the
0029 //! shape to the plane.
0030 //! These distances are used to compare shapes by this vector alone.
0031 class PrsDim_EqualDistanceRelation : public PrsDim_Relation
0032 {
0033   DEFINE_STANDARD_RTTIEXT(PrsDim_EqualDistanceRelation, PrsDim_Relation)
0034 public:
0035   //! Constructs a framework to display equivalent
0036   //! distances between the shapes aShape1, aShape2,
0037   //! aShape3, aShape4 and the plane aPlane.
0038   //! The distance is the length of a projection from the
0039   //! shape to the plane.
0040   Standard_EXPORT PrsDim_EqualDistanceRelation(const TopoDS_Shape&            aShape1,
0041                                                const TopoDS_Shape&            aShape2,
0042                                                const TopoDS_Shape&            aShape3,
0043                                                const TopoDS_Shape&            aShape4,
0044                                                const occ::handle<Geom_Plane>& aPlane);
0045 
0046   //! Sets the shape aShape to be used as the shape
0047   //! aShape3 in the framework created at construction time.
0048   void SetShape3(const TopoDS_Shape& aShape) { myShape3 = aShape; }
0049 
0050   //! Returns the shape aShape3 from the framework
0051   //! created at construction time.
0052   const TopoDS_Shape& Shape3() const { return myShape3; }
0053 
0054   //! Sets the shape aShape to be used as the shape
0055   //! aShape4 in the framework created at construction time.
0056   void SetShape4(const TopoDS_Shape& aShape) { myShape4 = aShape; }
0057 
0058   //! Returns the shape aShape4 from the framework
0059   //! created at construction time.
0060   const TopoDS_Shape& Shape4() const { return myShape4; }
0061 
0062 public:
0063   //! Computes the location of an intreval between
0064   //! between two edges. FirstAttach , SecondAttach
0065   //! are the returned extreme points of the interval.
0066   Standard_EXPORT static void ComputeTwoEdgesLength(
0067     const occ::handle<Prs3d_Presentation>& aPresentation,
0068     const occ::handle<Prs3d_Drawer>&       aDrawer,
0069     const double                           ArrowSize,
0070     const TopoDS_Edge&                     FirstEdge,
0071     const TopoDS_Edge&                     SecondEdge,
0072     const occ::handle<Geom_Plane>&         Plane,
0073     const bool                             AutomaticPos,
0074     const bool                             IsSetBndBox,
0075     const Bnd_Box&                         BndBox,
0076     gp_Pnt&                                Position,
0077     gp_Pnt&                                FirstAttach,
0078     gp_Pnt&                                SecondAttach,
0079     gp_Pnt&                                FirstExtreme,
0080     gp_Pnt&                                SecondExtreme,
0081     DsgPrs_ArrowSide&                      SymbolPrs);
0082 
0083   //! Computes the interval position between two vertexs. FirstAttach,
0084   //! SecondAttach are the returned extreme points of the interval.
0085   Standard_EXPORT static void ComputeTwoVerticesLength(
0086     const occ::handle<Prs3d_Presentation>& aPresentation,
0087     const occ::handle<Prs3d_Drawer>&       aDrawer,
0088     const double                           ArrowSize,
0089     const TopoDS_Vertex&                   FirstVertex,
0090     const TopoDS_Vertex&                   SecondVertex,
0091     const occ::handle<Geom_Plane>&         Plane,
0092     const bool                             AutomaticPos,
0093     const bool                             IsSetBndBox,
0094     const Bnd_Box&                         BndBox,
0095     const PrsDim_TypeOfDist                TypeDist,
0096     gp_Pnt&                                Position,
0097     gp_Pnt&                                FirstAttach,
0098     gp_Pnt&                                SecondAttach,
0099     gp_Pnt&                                FirstExtreme,
0100     gp_Pnt&                                SecondExtreme,
0101     DsgPrs_ArrowSide&                      SymbolPrs);
0102 
0103   //! Compute the interval location between a vertex and an edge. Edge may be
0104   //! a line or a circle.
0105   Standard_EXPORT static void ComputeOneEdgeOneVertexLength(
0106     const occ::handle<Prs3d_Presentation>& aPresentation,
0107     const occ::handle<Prs3d_Drawer>&       aDrawer,
0108     const double                           ArrowSize,
0109     const TopoDS_Shape&                    FirstShape,
0110     const TopoDS_Shape&                    SecondShape,
0111     const occ::handle<Geom_Plane>&         Plane,
0112     const bool                             AutomaticPos,
0113     const bool                             IsSetBndBox,
0114     const Bnd_Box&                         BndBox,
0115     gp_Pnt&                                Position,
0116     gp_Pnt&                                FirstAttach,
0117     gp_Pnt&                                SecondAttach,
0118     gp_Pnt&                                FirstExtreme,
0119     gp_Pnt&                                SecondExtreme,
0120     DsgPrs_ArrowSide&                      SymbolPrs);
0121 
0122 private:
0123   Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
0124                                const occ::handle<Prs3d_Presentation>&         thePrs,
0125                                const int                                      theMode) override;
0126 
0127   Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
0128                                         const int                               theMode) override;
0129 
0130 private:
0131   TopoDS_Shape myShape3;
0132   TopoDS_Shape myShape4;
0133   gp_Pnt       myAttachPoint1;
0134   gp_Pnt       myAttachPoint2;
0135   gp_Pnt       myAttachPoint3;
0136   gp_Pnt       myAttachPoint4;
0137   gp_Pnt       myPoint1;
0138   gp_Pnt       myPoint2;
0139   gp_Pnt       myPoint3;
0140   gp_Pnt       myPoint4;
0141 };
0142 
0143 #endif // _PrsDim_EqualDistanceRelation_HeaderFile