Blender V4.3
DrawingStyle.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#ifdef WITH_CXX_GUARDEDALLOC
13# include "MEM_guardedalloc.h"
14#endif
15
16namespace Freestyle {
17
19 public:
26
27 inline DrawingStyle()
28 {
29 Style = FILLED;
30 LineWidth = 2.0f;
31 PointSize = 2.0f;
32 LightingEnabled = true;
33 }
34
35 inline explicit DrawingStyle(const DrawingStyle &iBrother);
36
37 virtual ~DrawingStyle() {}
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
float lineWidth() const
void setLineWidth(const float iLineWidth)
void setStyle(const STYLE iStyle)
void setPointSize(const float iPointSize)
float pointSize() const
void setLightingEnabled(const bool on)
DrawingStyle & operator=(const DrawingStyle &ds)
inherits from class Rep
Definition AppCanvas.cpp:20