1 // Copyright (c) 1999-2013 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 #ifndef _AIS_LengthDimension_HeaderFile
19 #define _AIS_LengthDimension_HeaderFile
22 #include <AIS_Dimension.hxx>
23 #include <AIS_Drawer.hxx>
24 #include <AIS_KindOfDimension.hxx>
25 #include <Geom_Plane.hxx>
26 #include <Geom_Transformation.hxx>
29 #include <Prs3d_DimensionAspect.hxx>
30 #include <Prs3d_Presentation.hxx>
31 #include <Prs3d_Projector.hxx>
32 #include <PrsMgr_PresentationManager3d.hxx>
33 #include <SelectMgr_Selection.hxx>
34 #include <Standard.hxx>
35 #include <Standard_Macro.hxx>
36 #include <Standard_DefineHandle.hxx>
38 #include <TopoDS_Vertex.hxx>
39 #include <TCollection_ExtendedString.hxx>
42 class TCollection_ExtendedString;
47 class PrsMgr_PresentationManager3d;
48 class Prs3d_Presentation;
49 class Prs3d_Projector;
50 class Geom_Transformation;
51 class SelectMgr_Selection;
56 class Standard_Transient;
57 class Handle(Standard_Type);
58 class Handle(AIS_Relation);
59 class AIS_LengthDimension;
61 DEFINE_STANDARD_HANDLE(AIS_LengthDimension,AIS_Dimension)
63 //! A dimension to display lengths. <br>
64 //! These can be lengths along a face or edge, or <br>
65 //! between two faces or two edges.
66 class AIS_LengthDimension : public AIS_Dimension
70 Standard_EXPORT AIS_LengthDimension (const gp_Pnt& theFirstPoint,
71 const gp_Pnt& theSecondPoint,
72 const gp_Pln& theDimensionPlane);
74 //! Constructs a length dimension between two shapes(vertices, edges, shapes) with custom working plane
75 Standard_EXPORT AIS_LengthDimension (const TopoDS_Shape& theFirstShape,
76 const TopoDS_Shape& theSecondShape,
77 const gp_Pln& theWorkingPlane);
79 Standard_EXPORT AIS_LengthDimension (const TopoDS_Edge& theEdge,
80 const gp_Pln& theWorkingPlane);
82 Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFirstFace,
83 const TopoDS_Face& theSecondFace);
85 Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFace,
86 const TopoDS_Edge& theEdge);
90 DEFINE_STANDARD_RTTI(AIS_LengthDimension)
94 Standard_Boolean initTwoEdgesLength (const TopoDS_Edge & theFirstEdge,
95 const TopoDS_Edge& theSecondEdge,
96 gp_Dir& theDirAttach);
98 //! Auxiliary method for <InitTwoShapesPoints()>
99 //! in case of the distance between edge and vertex
100 Standard_Boolean initEdgeVertexLength (const TopoDS_Edge & theEdge,
101 const TopoDS_Vertex & theVertex,
102 gp_Dir & theDirAttach,
103 Standard_Boolean isInfinite);
105 //! Auxiliary method for <InitTwoShapesPoints()>
106 //! in case of the distance between face and edge
107 Standard_Boolean initEdgeFaceLength (const TopoDS_Edge& theEdge,
108 const TopoDS_Face& theFace,
109 gp_Dir& theDirAttach);
111 //! Initialization of two attach points in case of two owner shapes
112 Standard_Boolean initTwoShapesPoints (const TopoDS_Shape& theFirstShape,
113 const TopoDS_Shape& theSecondShape);
115 //! Initialization of two attach points in case of one owner shape
116 Standard_Boolean initOneShapePoints (const TopoDS_Shape& theShape);
118 //! Compute length in display units.
119 virtual void computeValue();
121 virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
122 const Handle(Prs3d_Presentation)& thePresentation,
123 const Standard_Integer theMode = 0) ;