7c2fcd3c70d8428dd672fdea325cbb54d4650291
[occt.git] / src / Prs3d / Prs3d_PointAspect.hxx
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
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 _Prs3d_PointAspect_HeaderFile
18 #define _Prs3d_PointAspect_HeaderFile
19
20 #include <Prs3d_BasicAspect.hxx>
21 #include <Graphic3d_AspectMarker3d.hxx>
22 #include <Graphic3d_MarkerImage.hxx>
23
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
28 {
29   DEFINE_STANDARD_RTTIEXT(Prs3d_PointAspect, Prs3d_BasicAspect)
30 public:
31
32   Standard_EXPORT Prs3d_PointAspect(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale);
33   
34   //! Defines the user defined marker point.
35   Standard_EXPORT Prs3d_PointAspect (const Quantity_Color& theColor,
36                                      const Standard_Integer theWidth,
37                                      const Standard_Integer theHeight,
38                                      const Handle(TColStd_HArray1OfByte)& theTexture);
39   
40   Prs3d_PointAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) : myAspect (theAspect) {}
41
42   //! defines the color to be used when drawing a point.
43   //! Default value: Quantity_NOC_YELLOW
44   void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
45
46   //! defines the type of representation to be used when drawing a point.
47   //! Default value: Aspect_TOM_PLUS
48   void SetTypeOfMarker (const Aspect_TypeOfMarker theType) { myAspect->SetType (theType); }
49   
50   //! defines the size of the marker used when drawing a point.
51   //! Default value: 1.
52   void SetScale (const Standard_Real theScale) { myAspect->SetScale (theScale); }
53   
54   const Handle(Graphic3d_AspectMarker3d)& Aspect() const { return myAspect; }
55
56   void SetAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) { myAspect = theAspect; }
57
58   //! Returns marker's texture size.
59   void GetTextureSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const { myAspect->GetTextureSize (theWidth, theHeight); }
60   
61   //! Returns marker's texture.
62   const Handle(Graphic3d_MarkerImage)& GetTexture() const { return myAspect->GetMarkerImage(); }
63
64 protected:
65
66   Handle(Graphic3d_AspectMarker3d) myAspect;
67
68 };
69
70 DEFINE_STANDARD_HANDLE(Prs3d_PointAspect, Prs3d_BasicAspect)
71
72 #endif // _Prs3d_PointAspect_HeaderFile