Blender  V3.3
DrawingStyle.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #ifdef WITH_CXX_GUARDEDALLOC
11 # include "MEM_guardedalloc.h"
12 #endif
13 
14 namespace Freestyle {
15 
16 class DrawingStyle {
17  public:
18  enum STYLE {
23  };
24 
25  inline DrawingStyle()
26  {
27  Style = FILLED;
28  LineWidth = 2.0f;
29  PointSize = 2.0f;
30  LightingEnabled = true;
31  }
32 
33  inline explicit DrawingStyle(const DrawingStyle &iBrother);
34 
35  virtual ~DrawingStyle()
36  {
37  }
38 
40  inline DrawingStyle &operator=(const DrawingStyle &ds);
41 
42  inline void setStyle(const STYLE iStyle)
43  {
44  Style = iStyle;
45  }
46 
47  inline void setLineWidth(const float iLineWidth)
48  {
49  LineWidth = iLineWidth;
50  }
51 
52  inline void setPointSize(const float iPointSize)
53  {
54  PointSize = iPointSize;
55  }
56 
57  inline void setLightingEnabled(const bool on)
58  {
59  LightingEnabled = on;
60  }
61 
62  inline STYLE style() const
63  {
64  return Style;
65  }
66 
67  inline float lineWidth() const
68  {
69  return LineWidth;
70  }
71 
72  inline float pointSize() const
73  {
74  return PointSize;
75  }
76 
77  inline bool lightingEnabled() const
78  {
79  return LightingEnabled;
80  }
81 
82  private:
83  STYLE Style;
84  float LineWidth;
85  float PointSize;
86  bool LightingEnabled;
87 
88 #ifdef WITH_CXX_GUARDEDALLOC
89  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:DrawingStyle")
90 #endif
91 };
92 
94 {
95  Style = iBrother.Style;
96  LineWidth = iBrother.LineWidth;
97  PointSize = iBrother.PointSize;
98  LightingEnabled = iBrother.LightingEnabled;
99 }
100 
102 {
103  Style = ds.Style;
104  LineWidth = ds.LineWidth;
105  PointSize = ds.PointSize;
106  LightingEnabled = ds.LightingEnabled;
107 
108  return *this;
109 }
110 
111 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
bool lightingEnabled() const
Definition: DrawingStyle.h:77
float lineWidth() const
Definition: DrawingStyle.h:67
void setLineWidth(const float iLineWidth)
Definition: DrawingStyle.h:47
void setStyle(const STYLE iStyle)
Definition: DrawingStyle.h:42
void setPointSize(const float iPointSize)
Definition: DrawingStyle.h:52
float pointSize() const
Definition: DrawingStyle.h:72
void setLightingEnabled(const bool on)
Definition: DrawingStyle.h:57
DrawingStyle & operator=(const DrawingStyle &ds)
Definition: DrawingStyle.h:101
inherits from class Rep
Definition: AppCanvas.cpp:18