Back to home page

EIC code displayed by LXR

 
 

    


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

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 DEFINE_STANDARD_HANDLE(PrsDim_EqualDistanceRelation, PrsDim_Relation)
0027 
0028 //! A framework to display equivalent distances between
0029 //! shapes and a given plane.
0030 //! The distance is the length of a projection from the
0031 //! shape to the plane.
0032 //! These distances are used to compare shapes by this vector alone.
0033 class PrsDim_EqualDistanceRelation : public PrsDim_Relation
0034 {
0035   DEFINE_STANDARD_RTTIEXT(PrsDim_EqualDistanceRelation, PrsDim_Relation)
0036 public:
0037 
0038   //! Constructs a framework to display equivalent
0039   //! distances between the shapes aShape1, aShape2,
0040   //! aShape3, aShape4 and the plane aPlane.
0041   //! The distance is the length of a projection from the
0042   //! shape to the plane.
0043   Standard_EXPORT PrsDim_EqualDistanceRelation(const TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2, const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape4, const Handle(Geom_Plane)& aPlane);
0044 
0045   //! Sets the shape aShape to be used as the shape
0046   //! aShape3 in the framework created at construction time.
0047   void SetShape3 (const TopoDS_Shape& aShape) { myShape3 = aShape; }
0048 
0049   //! Returns the shape aShape3 from the framework
0050   //! created at construction time.
0051   const TopoDS_Shape& Shape3() const { return myShape3; }
0052 
0053   //! Sets the shape aShape to be used as the shape
0054   //! aShape4 in the framework created at construction time.
0055   void SetShape4 (const TopoDS_Shape& aShape) { myShape4 = aShape; }
0056 
0057   //! Returns the shape aShape4 from the framework
0058   //! created at construction time.
0059   const TopoDS_Shape& Shape4() const { return myShape4; }
0060 
0061 public:
0062 
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 (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Edge& FirstEdge, const TopoDS_Edge& SecondEdge, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
0067   
0068   //! Computes the interval position between two vertexs. FirstAttach,
0069   //! SecondAttach are the returned extreme points of the interval.
0070   Standard_EXPORT static void ComputeTwoVerticesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Vertex& FirstVertex, const TopoDS_Vertex& SecondVertex, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, const PrsDim_TypeOfDist TypeDist, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
0071   
0072   //! Compute the interval location between a vertex and an edge. Edge may be
0073   //! a line or a circle.
0074   Standard_EXPORT static void ComputeOneEdgeOneVertexLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
0075 
0076 private:
0077 
0078   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0079                                         const Handle(Prs3d_Presentation)& thePrs,
0080                                         const Standard_Integer theMode) Standard_OVERRIDE;
0081 
0082   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0083                                                  const Standard_Integer theMode) Standard_OVERRIDE;
0084 
0085 private:
0086 
0087   TopoDS_Shape myShape3;
0088   TopoDS_Shape myShape4;
0089   gp_Pnt myAttachPoint1;
0090   gp_Pnt myAttachPoint2;
0091   gp_Pnt myAttachPoint3;
0092   gp_Pnt myAttachPoint4;
0093   gp_Pnt myPoint1;
0094   gp_Pnt myPoint2;
0095   gp_Pnt myPoint3;
0096   gp_Pnt myPoint4;
0097 
0098 };
0099 
0100 #endif // _PrsDim_EqualDistanceRelation_HeaderFile