42cf5bc1 |
1 | // Created on: 1996-12-13 |
2 | // Created by: Jean-Pierre COMBE/Odile Olivier |
3 | // Copyright (c) 1996-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _AIS_PlaneTrihedron_HeaderFile |
18 | #define _AIS_PlaneTrihedron_HeaderFile |
19 | |
42cf5bc1 |
20 | #include <AIS_InteractiveObject.hxx> |
87432b82 |
21 | #include <TCollection_AsciiString.hxx> |
22 | |
42cf5bc1 |
23 | class AIS_Line; |
24 | class AIS_Point; |
87432b82 |
25 | class Geom_Plane; |
42cf5bc1 |
26 | |
27 | //! To construct a selectable 2d axis system in a 3d |
28 | //! drawing. This can be placed anywhere in the 3d |
29 | //! system, and provides a coordinate system for |
30 | //! drawing curves and shapes in a plane. |
31 | //! There are 3 selection modes: |
32 | //! - mode 0 selection of the whole plane "trihedron" |
33 | //! - mode 1 selection of the origin of the plane "trihedron" |
34 | //! - mode 2 selection of the axes. |
35 | //! Warning |
36 | //! For the presentation of planes and trihedra, the |
37 | //! millimetre is default unit of length, and 100 the default |
38 | //! value for the representation of the axes. If you modify |
39 | //! these dimensions, you must temporarily recover the |
40 | //! Drawer object. From inside it, take the Aspects in |
41 | //! which the values for length are stocked, for example, |
bc001a40 |
42 | //! PlaneAspect for planes and LineAspect for |
42cf5bc1 |
43 | //! trihedra. Change these values and recalculate the presentation. |
44 | class AIS_PlaneTrihedron : public AIS_InteractiveObject |
45 | { |
87432b82 |
46 | DEFINE_STANDARD_RTTIEXT(AIS_PlaneTrihedron, AIS_InteractiveObject) |
42cf5bc1 |
47 | public: |
48 | |
42cf5bc1 |
49 | //! Initializes the plane aPlane. The plane trihedron is |
50 | //! constructed from this and an axis. |
51 | Standard_EXPORT AIS_PlaneTrihedron(const Handle(Geom_Plane)& aPlane); |
52 | |
53 | //! Returns the component specified in SetComponent. |
54 | Standard_EXPORT Handle(Geom_Plane) Component(); |
55 | |
56 | //! Creates an instance of the component object aPlane. |
57 | Standard_EXPORT void SetComponent (const Handle(Geom_Plane)& aPlane); |
58 | |
59 | //! Returns the "XAxis". |
60 | Standard_EXPORT Handle(AIS_Line) XAxis() const; |
61 | |
62 | //! Returns the "YAxis". |
63 | Standard_EXPORT Handle(AIS_Line) YAxis() const; |
64 | |
65 | //! Returns the point of origin of the plane trihedron. |
66 | Standard_EXPORT Handle(AIS_Point) Position() const; |
67 | |
68 | //! Sets the length of the X and Y axes. |
69 | Standard_EXPORT void SetLength (const Standard_Real theLength); |
70 | |
71 | //! Returns the length of X and Y axes. |
72 | Standard_EXPORT Standard_Real GetLength() const; |
73 | |
74 | //! Returns true if the display mode selected, aMode, is valid. |
75 | Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE; |
b5163d2f |
76 | |
87432b82 |
77 | virtual Standard_Integer Signature() const Standard_OVERRIDE { return 4; } |
42cf5bc1 |
78 | |
87432b82 |
79 | //! Returns datum as the type of Interactive Object. |
82b856b8 |
80 | virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; } |
42cf5bc1 |
81 | |
87432b82 |
82 | //! Allows you to provide settings for the color aColor. |
226fce20 |
83 | Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE; |
42cf5bc1 |
84 | |
87432b82 |
85 | void SetXLabel (const TCollection_AsciiString& theLabel) { myXLabel = theLabel; } |
42cf5bc1 |
86 | |
87432b82 |
87 | void SetYLabel (const TCollection_AsciiString& theLabel) { myYLabel = theLabel; } |
42cf5bc1 |
88 | |
89 | protected: |
90 | |
decbff0d |
91 | Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& theprsMgr, |
92 | const Handle(Prs3d_Presentation)& thePrs, |
93 | const Standard_Integer theMode) Standard_OVERRIDE; |
42cf5bc1 |
94 | |
42cf5bc1 |
95 | private: |
96 | |
decbff0d |
97 | Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel, |
98 | const Standard_Integer theMode) Standard_OVERRIDE; |
42cf5bc1 |
99 | |
87432b82 |
100 | private: |
101 | |
42cf5bc1 |
102 | Handle(Geom_Plane) myPlane; |
103 | Handle(AIS_InteractiveObject) myShapes[3]; |
104 | TCollection_AsciiString myXLabel; |
105 | TCollection_AsciiString myYLabel; |
106 | |
42cf5bc1 |
107 | }; |
108 | |
87432b82 |
109 | DEFINE_STANDARD_HANDLE(AIS_PlaneTrihedron, AIS_InteractiveObject) |
42cf5bc1 |
110 | |
111 | #endif // _AIS_PlaneTrihedron_HeaderFile |