Blender V5.0
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
11
13
14#include "MEM_guardedalloc.h"
15
16namespace Freestyle {
17
18//
19// UnaryPredicate0D (base class for predicates in 0D)
20//
22
30 public:
31 bool result;
32 void *py_up0D;
33
36 {
37 py_up0D = 0;
38 }
39
41 virtual ~UnaryPredicate0D() {}
42
44 virtual string getName() const
45 {
46 return "UnaryPredicate0D";
47 }
48
54 virtual int operator()(Interface0DIterator &it);
55
56 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:UnaryPredicate0D")
57};
58
59//
60// BinaryPredicate0D (base class for predicates in 0D)
61//
63
70 public:
71 bool result;
72 void *py_bp0D;
73
76 {
77 py_bp0D = 0;
78 }
79
81 virtual ~BinaryPredicate0D() {}
82
84 virtual string getName() const
85 {
86 return "BinaryPredicate0D";
87 }
88
97 virtual int operator()(Interface0D &inter1, Interface0D &inter2);
98
99 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BinaryPredicate0D")
100};
101
102//
103// Predicates definitions
104//
106
107namespace Predicates0D {
108
109// TrueUP0D
112 public:
115
117 string getName() const
118 {
119 return "TrueUP0D";
120 }
121
124 {
125 result = true;
126 return 0;
127 }
128};
129
130// FalseUP0D
133 public:
136
138 string getName() const
139 {
140 return "FalseUP0D";
141 }
142
145 {
146 result = false;
147 return 0;
148 }
149};
150
151} // end of namespace Predicates0D
152
153} /* 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