Blender  V2.93
DrawingStyle.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #ifdef WITH_CXX_GUARDEDALLOC
25 # include "MEM_guardedalloc.h"
26 #endif
27 
28 namespace Freestyle {
29 
30 class DrawingStyle {
31  public:
32  enum STYLE {
37  };
38 
39  inline DrawingStyle()
40  {
41  Style = FILLED;
42  LineWidth = 2.0f;
43  PointSize = 2.0f;
44  LightingEnabled = true;
45  }
46 
47  inline explicit DrawingStyle(const DrawingStyle &iBrother);
48 
49  virtual ~DrawingStyle()
50  {
51  }
52 
54  inline DrawingStyle &operator=(const DrawingStyle &ds);
55 
56  inline void setStyle(const STYLE iStyle)
57  {
58  Style = iStyle;
59  }
60 
61  inline void setLineWidth(const float iLineWidth)
62  {
63  LineWidth = iLineWidth;
64  }
65 
66  inline void setPointSize(const float iPointSize)
67  {
68  PointSize = iPointSize;
69  }
70 
71  inline void setLightingEnabled(const bool on)
72  {
73  LightingEnabled = on;
74  }
75 
76  inline STYLE style() const
77  {
78  return Style;
79  }
80 
81  inline float lineWidth() const
82  {
83  return LineWidth;
84  }
85 
86  inline float pointSize() const
87  {
88  return PointSize;
89  }
90 
91  inline bool lightingEnabled() const
92  {
93  return LightingEnabled;
94  }
95 
96  private:
97  STYLE Style;
98  float LineWidth;
99  float PointSize;
100  bool LightingEnabled;
101 
102 #ifdef WITH_CXX_GUARDEDALLOC
103  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:DrawingStyle")
104 #endif
105 };
106 
108 {
109  Style = iBrother.Style;
110  LineWidth = iBrother.LineWidth;
111  PointSize = iBrother.PointSize;
112  LightingEnabled = iBrother.LightingEnabled;
113 }
114 
116 {
117  Style = ds.Style;
118  LineWidth = ds.LineWidth;
119  PointSize = ds.PointSize;
120  LightingEnabled = ds.LightingEnabled;
121 
122  return *this;
123 }
124 
125 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
bool lightingEnabled() const
Definition: DrawingStyle.h:91
float lineWidth() const
Definition: DrawingStyle.h:81
void setLineWidth(const float iLineWidth)
Definition: DrawingStyle.h:61
void setStyle(const STYLE iStyle)
Definition: DrawingStyle.h:56
void setPointSize(const float iPointSize)
Definition: DrawingStyle.h:66
float pointSize() const
Definition: DrawingStyle.h:86
void setLightingEnabled(const bool on)
Definition: DrawingStyle.h:71
DrawingStyle & operator=(const DrawingStyle &ds)
Definition: DrawingStyle.h:115
inherits from class Rep
Definition: AppCanvas.cpp:32