Blender  V2.93
StrokeLayer.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 #include <deque>
25 
26 #ifdef WITH_CXX_GUARDEDALLOC
27 # include "MEM_guardedalloc.h"
28 #endif
29 
30 namespace Freestyle {
31 
32 class Stroke;
33 class StrokeRenderer;
34 class StrokeLayer {
35  public:
36  typedef std::deque<Stroke *> stroke_container;
37 
38  protected:
40 
41  public:
43  {
44  }
45 
46  StrokeLayer(const stroke_container &iStrokes)
47  {
48  _strokes = iStrokes;
49  }
50 
51  StrokeLayer(const StrokeLayer &iBrother)
52  {
53  _strokes = iBrother._strokes;
54  }
55 
56  virtual ~StrokeLayer();
57 
59  void ScaleThickness(float iFactor);
60  void Render(const StrokeRenderer *iRenderer);
61  void RenderBasic(const StrokeRenderer *iRenderer);
62 
64  void clear();
65 
67  inline stroke_container::iterator strokes_begin()
68  {
69  return _strokes.begin();
70  }
71 
72  inline stroke_container::iterator strokes_end()
73  {
74  return _strokes.end();
75  }
76 
77  inline int strokes_size() const
78  {
79  return _strokes.size();
80  }
81 
82  inline bool empty() const
83  {
84  return _strokes.empty();
85  }
86 
88  inline void setStrokes(stroke_container &iStrokes)
89  {
90  _strokes = iStrokes;
91  }
92 
93  inline void AddStroke(Stroke *iStroke)
94  {
95  _strokes.push_back(iStroke);
96  }
97 
98 #ifdef WITH_CXX_GUARDEDALLOC
99  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:StrokeLayer")
100 #endif
101 };
102 
103 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
void Render(const StrokeRenderer *iRenderer)
Definition: StrokeLayer.cpp:42
bool empty() const
Definition: StrokeLayer.h:82
stroke_container _strokes
Definition: StrokeLayer.h:39
stroke_container::iterator strokes_begin()
Definition: StrokeLayer.h:67
StrokeLayer(const StrokeLayer &iBrother)
Definition: StrokeLayer.h:51
void setStrokes(stroke_container &iStrokes)
Definition: StrokeLayer.h:88
StrokeLayer(const stroke_container &iStrokes)
Definition: StrokeLayer.h:46
int strokes_size() const
Definition: StrokeLayer.h:77
std::deque< Stroke * > stroke_container
Definition: StrokeLayer.h:36
void AddStroke(Stroke *iStroke)
Definition: StrokeLayer.h:93
stroke_container::iterator strokes_end()
Definition: StrokeLayer.h:72
void RenderBasic(const StrokeRenderer *iRenderer)
Definition: StrokeLayer.cpp:51
void ScaleThickness(float iFactor)
Definition: StrokeLayer.cpp:33
inherits from class Rep
Definition: AppCanvas.cpp:32