Blender  V2.93
Predicates0D.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 "../view_map/Functions0D.h"
25 
26 #ifdef WITH_CXX_GUARDEDALLOC
27 # include "MEM_guardedalloc.h"
28 #endif
29 
30 namespace Freestyle {
31 
32 //
33 // UnaryPredicate0D (base class for predicates in 0D)
34 //
36 
44  public:
45  bool result;
46  void *py_up0D;
47 
50  {
51  py_up0D = 0;
52  }
53 
56  {
57  }
58 
60  virtual string getName() const
61  {
62  return "UnaryPredicate0D";
63  }
64 
70  virtual int operator()(Interface0DIterator &it);
71 
72 #ifdef WITH_CXX_GUARDEDALLOC
73  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:UnaryPredicate0D")
74 #endif
75 };
76 
77 //
78 // BinaryPredicate0D (base class for predicates in 0D)
79 //
81 
88  public:
89  bool result;
90  void *py_bp0D;
91 
94  {
95  py_bp0D = 0;
96  }
97 
100  {
101  }
102 
104  virtual string getName() const
105  {
106  return "BinaryPredicate0D";
107  }
108 
117  virtual int operator()(Interface0D &inter1, Interface0D &inter2);
118 
119 #ifdef WITH_CXX_GUARDEDALLOC
120  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BinaryPredicate0D")
121 #endif
122 };
123 
124 //
125 // Predicates definitions
126 //
128 
129 namespace Predicates0D {
130 
131 // TrueUP0D
133 class TrueUP0D : public UnaryPredicate0D {
134  public:
137  {
138  }
139 
141  string getName() const
142  {
143  return "TrueUP0D";
144  }
145 
148  {
149  result = true;
150  return 0;
151  }
152 };
153 
154 // FalseUP0D
156 class FalseUP0D : public UnaryPredicate0D {
157  public:
160  {
161  }
162 
164  string getName() const
165  {
166  return "FalseUP0D";
167  }
168 
171  {
172  result = false;
173  return 0;
174  }
175 };
176 
177 } // end of namespace Predicates0D
178 
179 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
virtual int operator()(Interface0D &inter1, Interface0D &inter2)
virtual string getName() const
Definition: Predicates0D.h:104
int operator()(Interface0DIterator &)
Definition: Predicates0D.h:170
int operator()(Interface0DIterator &)
Definition: Predicates0D.h:147
virtual int operator()(Interface0DIterator &it)
virtual string getName() const
Definition: Predicates0D.h:60
inherits from class Rep
Definition: AppCanvas.cpp:32