Blender  V2.93
Modifiers.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 "TimeStamp.h"
25 
26 #ifdef WITH_CXX_GUARDEDALLOC
27 # include "MEM_guardedalloc.h"
28 #endif
29 
30 namespace Freestyle {
31 
32 /* ----------------------------------------- *
33  * *
34  * modifiers *
35  * *
36  * ----------------------------------------- */
37 
41 template<class Edge> struct EdgeModifier : public unary_function<Edge, void> {
43  EdgeModifier() : unary_function<Edge, void>()
44  {
45  }
46 
48  virtual void operator()(Edge &iEdge)
49  {
50  }
51 
52 #ifdef WITH_CXX_GUARDEDALLOC
53  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:EdgeModifier")
54 #endif
55 };
56 
58 template<class Edge> struct TimestampModifier : public EdgeModifier<Edge> {
61  {
62  }
63 
65  virtual void operator()(Edge &iEdge)
66  {
67  TimeStamp *timestamp = TimeStamp::instance();
68  iEdge.setTimeStamp(timestamp->getTimeStamp());
69  }
70 };
71 
72 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
Class defining a singleton used as timestamp.
static TimeStamp * instance()
Definition: TimeStamp.h:32
unsigned getTimeStamp() const
Definition: TimeStamp.h:37
inherits from class Rep
Definition: AppCanvas.cpp:32
virtual void operator()(Edge &iEdge)
Definition: Modifiers.h:48
virtual void operator()(Edge &iEdge)
Definition: Modifiers.h:65