0029787: Visualization - Avoid in presentation edges of certain continuity class
[occt.git] / src / AIS / AIS_Point.hxx
CommitLineData
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 <Aspect_TypeOfMarker.hxx>
21#include <AIS_InteractiveObject.hxx>
87432b82 22
42cf5bc1 23class Geom_Point;
42cf5bc1 24class TopoDS_Vertex;
25
42cf5bc1 26//! Constructs point datums to be used in construction of
27//! composite shapes. The datum is displayed as the plus marker +.
28class AIS_Point : public AIS_InteractiveObject
29{
87432b82 30 DEFINE_STANDARD_RTTIEXT(AIS_Point, AIS_InteractiveObject)
42cf5bc1 31public:
32
42cf5bc1 33 //! Initializes the point aComponent from which the point
34 //! datum will be built.
35 Standard_EXPORT AIS_Point(const Handle(Geom_Point)& aComponent);
36
37 //! Returns index 1, the default index for a point.
87432b82 38 virtual Standard_Integer Signature() const Standard_OVERRIDE { return 1; }
39
42cf5bc1 40 //! Indicates that a point is a datum.
87432b82 41 virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
42
42cf5bc1 43 //! Returns the component specified in SetComponent.
44 Standard_EXPORT Handle(Geom_Point) Component();
45
46 //! Constructs an instance of the point aComponent.
47 Standard_EXPORT void SetComponent (const Handle(Geom_Point)& aComponent);
48
49 //! Returns true if the display mode selected is valid for point datums.
50 Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
51
52 //! computes the presentation according to a point of view
53 //! given by <aProjector>.
54 //! To be Used when the associated degenerated Presentations
55 //! have been transformed by <aTrsf> which is not a Pure
56 //! Translation. The HLR Prs can't be deducted automatically
57 //! WARNING :<aTrsf> must be applied
58 //! to the object to display before computation !!!
59 Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
87432b82 60
61 //! Allows you to provide settings for the Color.
62 Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
63
42cf5bc1 64 //! Allows you to remove color settings.
65 Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
66
67 //! Allows you to provide settings for a marker. These include
68 //! - type of marker,
69 //! - marker color,
70 //! - scale factor.
71 Standard_EXPORT void SetMarker (const Aspect_TypeOfMarker aType);
72
73 //! Removes the marker settings.
74 Standard_EXPORT void UnsetMarker();
75
76 //! Returns true if the point datum has a marker.
87432b82 77 Standard_Boolean HasMarker() const { return myHasTOM; }
78
42cf5bc1 79 //! Converts a point into a vertex.
80 Standard_EXPORT TopoDS_Vertex Vertex() const;
81
42cf5bc1 82protected:
83
42cf5bc1 84 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
85
42cf5bc1 86private:
42cf5bc1 87
88 Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
87432b82 89
79104795 90 Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
87432b82 91
42cf5bc1 92 Standard_EXPORT void UpdatePointValues();
93
87432b82 94private:
95
42cf5bc1 96 Handle(Geom_Point) myComponent;
97 Standard_Boolean myHasTOM;
98 Aspect_TypeOfMarker myTOM;
99
42cf5bc1 100};
101
87432b82 102DEFINE_STANDARD_HANDLE(AIS_Point, AIS_InteractiveObject)
42cf5bc1 103
104#endif // _AIS_Point_HeaderFile