efc186a97738e7aecbce2c6c1ef3e316a93b03ac
[occt.git] / src / AIS / AIS_DiameterDimension.hxx
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
46   //! Constructor that allows to set a attach point <br>
47   //! on the circle <theCircle> where to attach dimension
48   Standard_EXPORT  AIS_DiameterDimension (const gp_Circ& theCircle,
49                                           const gp_Pnt& theAttachPoint);
50
51   Standard_EXPORT  AIS_DiameterDimension (const TopoDS_Shape& theShape);
52
53   DEFINE_STANDARD_RTTI(AIS_DiameterDimension)
54
55 protected:
56
57   Standard_EXPORT  virtual void computeValue();
58
59     //! Fills default plane object if it is possible to count plane automatically.
60   Standard_EXPORT  virtual void countDefaultPlane();
61
62 private: 
63
64   virtual  void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
65                          const Handle(Prs3d_Presentation)& thePresentation,
66                          const Standard_Integer theMode = 0);
67
68 // Fields
69 private:
70
71   gp_Circ myCircle;
72 };
73 #endif