42cf5bc1 |
1 | // Created on: 1995-08-09 |
2 | // Created by: Arnaud BOUZY |
3 | // Copyright (c) 1995-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_Point_HeaderFile |
18 | #define _AIS_Point_HeaderFile |
19 | |
42cf5bc1 |
20 | #include <AIS_InteractiveObject.hxx> |
87432b82 |
21 | |
42cf5bc1 |
22 | class Geom_Point; |
42cf5bc1 |
23 | class TopoDS_Vertex; |
24 | |
42cf5bc1 |
25 | //! Constructs point datums to be used in construction of |
26 | //! composite shapes. The datum is displayed as the plus marker +. |
27 | class AIS_Point : public AIS_InteractiveObject |
28 | { |
87432b82 |
29 | DEFINE_STANDARD_RTTIEXT(AIS_Point, AIS_InteractiveObject) |
42cf5bc1 |
30 | public: |
31 | |
42cf5bc1 |
32 | //! Initializes the point aComponent from which the point |
33 | //! datum will be built. |
34 | Standard_EXPORT AIS_Point(const Handle(Geom_Point)& aComponent); |
35 | |
36 | //! Returns index 1, the default index for a point. |
87432b82 |
37 | virtual Standard_Integer Signature() const Standard_OVERRIDE { return 1; } |
38 | |
42cf5bc1 |
39 | //! Indicates that a point is a datum. |
82b856b8 |
40 | virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; } |
87432b82 |
41 | |
42cf5bc1 |
42 | //! Returns the component specified in SetComponent. |
43 | Standard_EXPORT Handle(Geom_Point) Component(); |
44 | |
45 | //! Constructs an instance of the point aComponent. |
46 | Standard_EXPORT void SetComponent (const Handle(Geom_Point)& aComponent); |
47 | |
48 | //! Returns true if the display mode selected is valid for point datums. |
49 | Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE; |
87432b82 |
50 | |
51 | //! Allows you to provide settings for the Color. |
226fce20 |
52 | Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE; |
87432b82 |
53 | |
42cf5bc1 |
54 | //! Allows you to remove color settings. |
226fce20 |
55 | Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE; |
42cf5bc1 |
56 | |
57 | //! Allows you to provide settings for a marker. These include |
58 | //! - type of marker, |
59 | //! - marker color, |
60 | //! - scale factor. |
61 | Standard_EXPORT void SetMarker (const Aspect_TypeOfMarker aType); |
62 | |
63 | //! Removes the marker settings. |
64 | Standard_EXPORT void UnsetMarker(); |
65 | |
66 | //! Returns true if the point datum has a marker. |
87432b82 |
67 | Standard_Boolean HasMarker() const { return myHasTOM; } |
68 | |
42cf5bc1 |
69 | //! Converts a point into a vertex. |
70 | Standard_EXPORT TopoDS_Vertex Vertex() const; |
71 | |
42cf5bc1 |
72 | protected: |
73 | |
decbff0d |
74 | Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr, |
75 | const Handle(Prs3d_Presentation)& thePrs, |
76 | const Standard_Integer theMode) Standard_OVERRIDE; |
42cf5bc1 |
77 | |
42cf5bc1 |
78 | private: |
87432b82 |
79 | |
79104795 |
80 | Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; |
87432b82 |
81 | |
42cf5bc1 |
82 | Standard_EXPORT void UpdatePointValues(); |
83 | |
226fce20 |
84 | //! Replace aspects of already computed groups with the new value. |
85 | void replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect); |
86 | |
87432b82 |
87 | private: |
88 | |
42cf5bc1 |
89 | Handle(Geom_Point) myComponent; |
90 | Standard_Boolean myHasTOM; |
91 | Aspect_TypeOfMarker myTOM; |
92 | |
42cf5bc1 |
93 | }; |
94 | |
87432b82 |
95 | DEFINE_STANDARD_HANDLE(AIS_Point, AIS_InteractiveObject) |
42cf5bc1 |
96 | |
97 | #endif // _AIS_Point_HeaderFile |