Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-31 08:29:45

0001 // Created on: 1995-08-09
0002 // Created by: Arnaud BOUZY
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _AIS_Point_HeaderFile
0018 #define _AIS_Point_HeaderFile
0019 
0020 #include <AIS_InteractiveObject.hxx>
0021 
0022 class Geom_Point;
0023 class TopoDS_Vertex;
0024 
0025 //! Constructs point datums to be used in construction of
0026 //! composite shapes. The datum is displayed as the plus marker +.
0027 class AIS_Point : public AIS_InteractiveObject
0028 {
0029   DEFINE_STANDARD_RTTIEXT(AIS_Point, AIS_InteractiveObject)
0030 public:
0031   //! Initializes the point aComponent from which the point
0032   //! datum will be built.
0033   Standard_EXPORT AIS_Point(const Handle(Geom_Point)& aComponent);
0034 
0035   //! Returns index 1, the default index for a point.
0036   virtual Standard_Integer Signature() const Standard_OVERRIDE { return 1; }
0037 
0038   //! Indicates that a point is a datum.
0039   virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE
0040   {
0041     return AIS_KindOfInteractive_Datum;
0042   }
0043 
0044   //! Returns the component specified in SetComponent.
0045   Standard_EXPORT Handle(Geom_Point) Component();
0046 
0047   //! Constructs an instance of the point aComponent.
0048   Standard_EXPORT void SetComponent(const Handle(Geom_Point)& aComponent);
0049 
0050   //! Returns true if the display mode selected is valid for point datums.
0051   Standard_EXPORT Standard_Boolean
0052     AcceptDisplayMode(const Standard_Integer aMode) const Standard_OVERRIDE;
0053 
0054   //! Allows you to provide settings for the Color.
0055   Standard_EXPORT virtual void SetColor(const Quantity_Color& theColor) Standard_OVERRIDE;
0056 
0057   //! Allows you to remove color settings.
0058   Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
0059 
0060   //! Allows you to provide settings for a marker. These include
0061   //! -   type of marker,
0062   //! -   marker color,
0063   //! -   scale factor.
0064   Standard_EXPORT void SetMarker(const Aspect_TypeOfMarker aType);
0065 
0066   //! Removes the marker settings.
0067   Standard_EXPORT void UnsetMarker();
0068 
0069   //! Returns true if the point datum has a marker.
0070   Standard_Boolean HasMarker() const { return myHasTOM; }
0071 
0072   //! Converts a point into a vertex.
0073   Standard_EXPORT TopoDS_Vertex Vertex() const;
0074 
0075 protected:
0076   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0077                                        const Handle(Prs3d_Presentation)&         thePrs,
0078                                        const Standard_Integer theMode) Standard_OVERRIDE;
0079 
0080 private:
0081   Standard_EXPORT void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
0082                                         const Standard_Integer             aMode) Standard_OVERRIDE;
0083 
0084   Standard_EXPORT void UpdatePointValues();
0085 
0086   //! Replace aspects of already computed groups with the new value.
0087   void replaceWithNewPointAspect(const Handle(Prs3d_PointAspect)& theAspect);
0088 
0089 private:
0090   Handle(Geom_Point)  myComponent;
0091   Standard_Boolean    myHasTOM;
0092   Aspect_TypeOfMarker myTOM;
0093 };
0094 
0095 DEFINE_STANDARD_HANDLE(AIS_Point, AIS_InteractiveObject)
0096 
0097 #endif // _AIS_Point_HeaderFile