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 | |
19 | //! A framework to define display of radii. <br> |
20 | //! These displays serve as relational references in 3D <br> |
21 | //! presentations of surfaces, and are particularly useful <br> |
22 | //! in viewing fillets. The display consists of arrows and <br> |
23 | //! text giving the length of a radius. This display is <br> |
24 | //! recalculated if the applicative owner shape changes <br> |
25 | //! in dimension, and the text gives the modified length. <br> |
26 | //! The algorithm analyzes a length along a face as an <br> |
27 | //! arc. It then reconstructs the circle corresponding to <br> |
28 | //! the arc and calculates the radius of this circle. <br> |
29 | |
30 | #ifndef _AIS_RadiusDimension_HeaderFile |
31 | #define _AIS_RadiusDimension_HeaderFile |
32 | |
33 | #include <AIS.hxx> |
34 | #include <AIS_Dimension.hxx> |
35 | #include <gp_Circ.hxx> |
36 | #include <gp_Pnt.hxx> |
37 | #include <Prs3d_DimensionAspect.hxx> |
38 | #include <Standard.hxx> |
39 | #include <Standard_Macro.hxx> |
40 | #include <TopoDS_Shape.hxx> |
41 | |
42 | DEFINE_STANDARD_HANDLE(AIS_RadiusDimension,AIS_Dimension) |
43 | |
44 | class AIS_RadiusDimension : public AIS_Dimension |
45 | { |
46 | public: |
a6eb515f |
47 | |
d7bffd44 |
48 | Standard_EXPORT AIS_RadiusDimension (const gp_Circ& theCircle); |
a6eb515f |
49 | |
50 | Standard_EXPORT AIS_RadiusDimension (const gp_Circ& theCircle, |
d7bffd44 |
51 | const gp_Pnt& theAttachPoint); |
a6eb515f |
52 | |
a6eb515f |
53 | //! Constructs the radius display object defined by the <br> |
54 | //! shape aShape, the dimension aVal, and the text aText. |
55 | Standard_EXPORT AIS_RadiusDimension (const TopoDS_Shape& aShape); |
56 | |
a6eb515f |
57 | DEFINE_STANDARD_RTTI(AIS_RadiusDimension) |
58 | |
59 | protected: |
d7bffd44 |
60 | |
a6eb515f |
61 | //! Computes dimension value in display units |
62 | Standard_EXPORT virtual void computeValue (); |
d7bffd44 |
63 | |
a6eb515f |
64 | //! Fills default plane object if it is possible to count plane automatically. |
65 | Standard_EXPORT virtual void countDefaultPlane (); |
66 | |
d7bffd44 |
67 | private: |
68 | |
69 | virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, |
70 | const Handle(Prs3d_Presentation)& thePresentation, |
71 | const Standard_Integer theMode = 0); |
a6eb515f |
72 | |
73 | // Fields |
d7bffd44 |
74 | private: |
a6eb515f |
75 | |
a6eb515f |
76 | gp_Circ myCircle; |
77 | }; |
78 | #endif |