Blender V5.0
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
11
12#include "MEM_guardedalloc.h"
13
14namespace Freestyle {
15
17 public:
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
38 inline DrawingStyle &operator=(const DrawingStyle &ds);
39
40 inline void setStyle(const STYLE iStyle)
41 {
42 Style = iStyle;
43 }
44
45 inline void setLineWidth(const float iLineWidth)
46 {
47 LineWidth = iLineWidth;
48 }
49
50 inline void setPointSize(const float iPointSize)
51 {
52 PointSize = iPointSize;
53 }
54
55 inline void setLightingEnabled(const bool on)
56 {
57 LightingEnabled = on;
58 }
59
60 inline STYLE style() const
61 {
62 return Style;
63 }
64
65 inline float lineWidth() const
66 {
67 return LineWidth;
68 }
69
70 inline float pointSize() const
71 {
72 return PointSize;
73 }
74
75 inline bool lightingEnabled() const
76 {
77 return LightingEnabled;
78 }
79
80 private:
81 STYLE Style;
82 float LineWidth;
83 float PointSize;
84 bool LightingEnabled;
85
86 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:DrawingStyle")
87};
88
90{
91 Style = iBrother.Style;
92 LineWidth = iBrother.LineWidth;
93 PointSize = iBrother.PointSize;
94 LightingEnabled = iBrother.LightingEnabled;
95}
96
98{
99 Style = ds.Style;
100 LineWidth = ds.LineWidth;
101 PointSize = ds.PointSize;
102 LightingEnabled = ds.LightingEnabled;
103
104 return *this;
105}
106
107} /* 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