Blender V4.3
Predicates0D.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
13
14#ifdef WITH_CXX_GUARDEDALLOC
15# include "MEM_guardedalloc.h"
16#endif
17
18namespace Freestyle {
19
20//
21// UnaryPredicate0D (base class for predicates in 0D)
22//
24
32 public:
33 bool result;
34 void *py_up0D;
35
38 {
39 py_up0D = 0;
40 }
41
43 virtual ~UnaryPredicate0D() {}
44
46 virtual string getName() const
47 {
48 return "UnaryPredicate0D";
49 }
50
56 virtual int operator()(Interface0DIterator &it);
57
58#ifdef WITH_CXX_GUARDEDALLOC
59 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:UnaryPredicate0D")
60#endif
61};
62
63//
64// BinaryPredicate0D (base class for predicates in 0D)
65//
67
74 public:
75 bool result;
76 void *py_bp0D;
77
80 {
81 py_bp0D = 0;
82 }
83
85 virtual ~BinaryPredicate0D() {}
86
88 virtual string getName() const
89 {
90 return "BinaryPredicate0D";
91 }
92
101 virtual int operator()(Interface0D &inter1, Interface0D &inter2);
102
103#ifdef WITH_CXX_GUARDEDALLOC
104 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BinaryPredicate0D")
105#endif
106};
107
108//
109// Predicates definitions
110//
112
113namespace Predicates0D {
114
115// TrueUP0D
118 public:
121
123 string getName() const
124 {
125 return "TrueUP0D";
126 }
127
130 {
131 result = true;
132 return 0;
133 }
134};
135
136// FalseUP0D
139 public:
142
144 string getName() const
145 {
146 return "FalseUP0D";
147 }
148
151 {
152 result = false;
153 return 0;
154 }
155};
156
157} // end of namespace Predicates0D
158
159} /* namespace Freestyle */
Functions taking 0D input.
Read Guarded memory(de)allocation.
virtual int operator()(Interface0D &inter1, Interface0D &inter2)
virtual string getName() const
int operator()(Interface0DIterator &)
int operator()(Interface0DIterator &)
virtual int operator()(Interface0DIterator &it)
virtual string getName() const
inherits from class Rep
Definition AppCanvas.cpp:20