Blender V5.0
Modifiers.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 "TimeStamp.h"
13
14#include "MEM_guardedalloc.h"
15
16namespace Freestyle {
17
18/* ----------------------------------------- *
19 * *
20 * modifiers *
21 * *
22 * ----------------------------------------- */
23
27template<class Edge> struct EdgeModifier : public unary_function<Edge, void> {
29 EdgeModifier() : unary_function<Edge, void>() {}
30
32 virtual void operator()(Edge &iEdge) {}
33
34 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:EdgeModifier")
35};
36
38template<class Edge> struct TimestampModifier : public EdgeModifier<Edge> {
41
43 virtual void operator()(Edge &iEdge)
44 {
45 TimeStamp *timestamp = TimeStamp::instance();
46 iEdge.setTimeStamp(timestamp->getTimeStamp());
47 }
48};
49
50} /* namespace Freestyle */
Read Guarded memory(de)allocation.
Class defining a singleton used as timestamp.
uint getTimeStamp() const
Definition TimeStamp.h:25
static TimeStamp * instance()
Definition TimeStamp.h:20
inherits from class Rep
Definition AppCanvas.cpp:20
virtual void operator()(Edge &iEdge)
Definition Modifiers.h:32
virtual void operator()(Edge &iEdge)
Definition Modifiers.h:43