Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:55

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 
0032   //! Initializes the point aComponent from which the point
0033   //! datum will be built.
0034   Standard_EXPORT AIS_Point(const Handle(Geom_Point)& aComponent);
0035   
0036   //! Returns index 1, the default index for a point.
0037   virtual Standard_Integer Signature() const Standard_OVERRIDE { return 1; }
0038 
0039   //! Indicates that a point is a datum.
0040   virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; }
0041 
0042   //! Returns the component specified in SetComponent.
0043   Standard_EXPORT Handle(Geom_Point) Component();
0044   
0045   //! Constructs an instance of the point aComponent.
0046   Standard_EXPORT void SetComponent (const Handle(Geom_Point)& aComponent);
0047   
0048   //! Returns true if the display mode selected is valid for point datums.
0049   Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
0050 
0051   //! Allows you to provide settings for the Color.
0052   Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
0053 
0054   //! Allows you to remove color settings.
0055   Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
0056   
0057   //! Allows you to provide settings for a marker. These include
0058   //! -   type of marker,
0059   //! -   marker color,
0060   //! -   scale factor.
0061   Standard_EXPORT void SetMarker (const Aspect_TypeOfMarker aType);
0062   
0063   //! Removes the marker settings.
0064   Standard_EXPORT void UnsetMarker();
0065   
0066   //! Returns true if the point datum has a marker.
0067   Standard_Boolean HasMarker() const { return myHasTOM; }
0068 
0069   //! Converts a point into a vertex.
0070   Standard_EXPORT TopoDS_Vertex Vertex() const;
0071 
0072 protected:
0073 
0074   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0075                                         const Handle(Prs3d_Presentation)& thePrs,
0076                                         const Standard_Integer theMode) Standard_OVERRIDE;
0077 
0078 private:
0079 
0080   Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
0081 
0082   Standard_EXPORT void UpdatePointValues();
0083 
0084   //! Replace aspects of already computed groups with the new value.
0085   void replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect);
0086 
0087 private:
0088 
0089   Handle(Geom_Point) myComponent;
0090   Standard_Boolean myHasTOM;
0091   Aspect_TypeOfMarker myTOM;
0092 
0093 };
0094 
0095 DEFINE_STANDARD_HANDLE(AIS_Point, AIS_InteractiveObject)
0096 
0097 #endif // _AIS_Point_HeaderFile