Blender  V3.3
Predicates0D.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include "../view_map/Functions0D.h"
11 
12 #ifdef WITH_CXX_GUARDEDALLOC
13 # include "MEM_guardedalloc.h"
14 #endif
15 
16 namespace 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 
42  {
43  }
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 
86  {
87  }
88 
90  virtual string getName() const
91  {
92  return "BinaryPredicate0D";
93  }
94 
103  virtual int operator()(Interface0D &inter1, Interface0D &inter2);
104 
105 #ifdef WITH_CXX_GUARDEDALLOC
106  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BinaryPredicate0D")
107 #endif
108 };
109 
110 //
111 // Predicates definitions
112 //
114 
115 namespace Predicates0D {
116 
117 // TrueUP0D
119 class TrueUP0D : public UnaryPredicate0D {
120  public:
123  {
124  }
125 
127  string getName() const
128  {
129  return "TrueUP0D";
130  }
131 
134  {
135  result = true;
136  return 0;
137  }
138 };
139 
140 // FalseUP0D
142 class FalseUP0D : public UnaryPredicate0D {
143  public:
146  {
147  }
148 
150  string getName() const
151  {
152  return "FalseUP0D";
153  }
154 
157  {
158  result = false;
159  return 0;
160  }
161 };
162 
163 } // end of namespace Predicates0D
164 
165 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
virtual int operator()(Interface0D &inter1, Interface0D &inter2)
virtual string getName() const
Definition: Predicates0D.h:90
int operator()(Interface0DIterator &)
Definition: Predicates0D.h:156
int operator()(Interface0DIterator &)
Definition: Predicates0D.h:133
virtual int operator()(Interface0DIterator &it)
virtual string getName() const
Definition: Predicates0D.h:46
inherits from class Rep
Definition: AppCanvas.cpp:18