1 // Created on: 1993-04-26
2 // Created by: Jean-Louis Frenkel
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Prs3d_PointAspect_HeaderFile
18 #define _Prs3d_PointAspect_HeaderFile
20 #include <Prs3d_BasicAspect.hxx>
21 #include <Graphic3d_AspectMarker3d.hxx>
22 #include <Graphic3d_MarkerImage.hxx>
24 //! This class defines attributes for the points
25 //! The points are drawn using markers, whose size does not depend on
26 //! the zoom value of the views.
27 class Prs3d_PointAspect : public Prs3d_BasicAspect
29 DEFINE_STANDARD_RTTIEXT(Prs3d_PointAspect, Prs3d_BasicAspect)
32 Standard_EXPORT Prs3d_PointAspect(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale);
34 Standard_EXPORT Prs3d_PointAspect(const Aspect_TypeOfMarker theType, const Quantity_NameOfColor theColor, const Standard_Real theScale);
36 //! Defines the user defined marker point.
37 Standard_EXPORT Prs3d_PointAspect (const Quantity_Color& theColor,
38 const Standard_Integer theWidth,
39 const Standard_Integer theHeight,
40 const Handle(TColStd_HArray1OfByte)& theTexture);
42 Prs3d_PointAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) : myAspect (theAspect) {}
44 void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
46 //! defines the color to be used when drawing a point.
47 //! Default value: Quantity_NOC_YELLOW
48 void SetColor (const Quantity_NameOfColor theColor) { myAspect->SetColor (Quantity_Color (theColor)); }
50 //! defines the type of representation to be used when drawing a point.
51 //! Default value: Aspect_TOM_PLUS
52 void SetTypeOfMarker (const Aspect_TypeOfMarker theType) { myAspect->SetType (theType); }
54 //! defines the size of the marker used when drawing a point.
56 void SetScale (const Standard_Real theScale) { myAspect->SetScale (theScale); }
58 const Handle(Graphic3d_AspectMarker3d)& Aspect() const { return myAspect; }
60 void SetAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) { myAspect = theAspect; }
62 //! Returns marker's texture size.
63 void GetTextureSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const { myAspect->GetTextureSize (theWidth, theHeight); }
65 //! Returns marker's texture.
66 const Handle(Graphic3d_MarkerImage)& GetTexture() const { return myAspect->GetMarkerImage(); }
70 Handle(Graphic3d_AspectMarker3d) myAspect;
74 DEFINE_STANDARD_HANDLE(Prs3d_PointAspect, Prs3d_BasicAspect)
76 #endif // _Prs3d_PointAspect_HeaderFile