a6eb515f |
1 | // Copyright (c) 1995-1999 Matra Datavision |
2 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
3 | // |
4 | // The content of this file is subject to the Open CASCADE Technology Public |
5 | // License Version 6.5 (the "License"). You may not use the content of this file |
6 | // except in compliance with the License. Please obtain a copy of the License |
7 | // at http://www.opencascade.org and read it completely before using this file. |
8 | // |
9 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
10 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
11 | // |
12 | // The Original Code and all software distributed under the License is |
13 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
14 | // Initial Developer hereby disclaims all such warranties, including without |
15 | // limitation, any warranties of merchantability, fitness for a particular |
16 | // purpose or non-infringement. Please see the License for the specific terms |
17 | // and conditions governing the rights and limitations under the License. |
18 | #ifndef _AIS_DiameterDimension_HeaderFile |
19 | #define _AIS_DiameterDimension_HeaderFile |
20 | |
21 | #include <AIS.hxx> |
22 | #include <AIS_Dimension.hxx> |
23 | #include <gp_Pnt.hxx> |
24 | #include <gp_Circ.hxx> |
25 | #include <Standard.hxx> |
26 | #include <Standard_Macro.hxx> |
27 | #include <Standard_DefineHandle.hxx> |
28 | |
29 | DEFINE_STANDARD_HANDLE(AIS_DiameterDimension,AIS_Dimension) |
30 | |
31 | //! A framework to display diameter dimensions. <br> |
32 | //! A diameter is displayed with arrows and text. The <br> |
33 | //! text gives the length of the diameter. <br> |
34 | //! The algorithm takes a length along a face and <br> |
35 | //! analyzes it as an arc. It then reconstructs the circle <br> |
36 | //! corresponding to the arc and calculates the <br> |
37 | //! diameter of this circle. This diameter serves as a <br> |
38 | //! relational reference in 3d presentations of the surface. <br> |
39 | class AIS_DiameterDimension : public AIS_Dimension |
40 | { |
41 | public: |
42 | //! Constructs a diameter display object defined by the <br> |
43 | //! circle <theCircle> |
44 | Standard_EXPORT AIS_DiameterDimension(const gp_Circ& theCircle); |
45 | //! Consctructor that allows to set a attach point <br> |
46 | //! on the circle <theCircle> where to attach dimension |
47 | Standard_EXPORT AIS_DiameterDimension (const gp_Circ& theCircle, |
48 | const gp_Pnt& theAttachPoint); |
49 | |
50 | Standard_EXPORT AIS_DiameterDimension (const gp_Circ& theCircle, |
51 | const Handle(Prs3d_DimensionAspect)& theDimensionStyle, |
52 | const Standard_Real theExtensionSize = 1.0); |
53 | |
54 | Standard_EXPORT AIS_DiameterDimension (const TopoDS_Shape& theShape); |
55 | |
a6eb515f |
56 | DEFINE_STANDARD_RTTI(AIS_DiameterDimension) |
57 | |
58 | protected: |
59 | |
60 | Standard_EXPORT virtual void computeValue (); |
61 | //! Fills default plane object if it is possible to count plane automatically. |
62 | Standard_EXPORT virtual void countDefaultPlane (); |
63 | |
64 | private: |
65 | |
66 | virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, |
67 | const Handle(Prs3d_Presentation)& thePresentation, |
68 | const Standard_Integer theMode = 0); |
69 | |
70 | // Fields |
71 | |
a6eb515f |
72 | gp_Circ myCircle; |
73 | }; |
74 | #endif |