1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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
22 #include <AIS_Dimension.hxx>
24 #include <gp_Circ.hxx>
25 #include <Standard.hxx>
26 #include <Standard_Macro.hxx>
27 #include <Standard_DefineHandle.hxx>
29 DEFINE_STANDARD_HANDLE(AIS_DiameterDimension,AIS_Dimension)
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
42 //! Constructs a diameter display object defined by the <br>
43 //! circle <theCircle>
44 Standard_EXPORT AIS_DiameterDimension(const gp_Circ& theCircle);
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);
51 Standard_EXPORT AIS_DiameterDimension (const TopoDS_Shape& theShape);
53 DEFINE_STANDARD_RTTI(AIS_DiameterDimension)
57 Standard_EXPORT virtual void computeValue();
59 //! Fills default plane object if it is possible to count plane automatically.
60 Standard_EXPORT virtual void countDefaultPlane();
64 virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
65 const Handle(Prs3d_Presentation)& thePresentation,
66 const Standard_Integer theMode = 0);