120{
121
122public:
123
124
125
126 typedef boost::intrusive_ptr<ProceduralField> Ptr;
127
130
131
132
135
136 static const char *staticClassName()
137 {
138 return "ProceduralField";
139 }
140
141 static const char *staticClassType()
142 {
144 }
145
146
147
150 { }
151
152
153
154 virtual Data_T lsSample(
const V3d &
lsP)
const = 0;
155
156
157
159
160
161
164 virtual Data_T value(
int i,
int j,
int k)
const = 0;
165
166
167
171 Data_T typedIntMetadata(const std::string &name,
176 Data_T typedFloatMetadata(const std::string &name,
178
179private:
180
181
182
184
185
186
188
189};
190
191
192
193
194
201
202
203
204
205
207
208
209
210
211
212template <>
216{
217 return metadata().intMetadata(name,
static_cast<int>(
defaultVal));
218}
219
220
221
222template <>
223inline float
226{
227 return metadata().intMetadata(name,
static_cast<int>(
defaultVal));
228}
229
230
231
232template <>
233inline double
236{
237 return metadata().intMetadata(name,
static_cast<int>(
defaultVal));
238}
239
240
241
242template <>
246{
248}
249
250
251
252template <>
256{
258}
259
260
261
262template <>
266{
268}
269
270
271
272template <>
276{
277 return metadata().floatMetadata(name,
static_cast<float>(
defaultVal));
278}
279
280
281
282template <>
283inline float
286{
287 return metadata().floatMetadata(name,
defaultVal);
288}
289
290
291
292template <>
293inline double
296{
297 return metadata().floatMetadata(name,
static_cast<float>(
defaultVal));
298}
299
300
301
302template <>
306{
308}
309
310
311
312template <>
316{
318}
319
320
321
322template <>
326{
328}
329
330
331
333
334
335
336#endif
337
#define FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION(field)
#define FIELD3D_CLASSNAME_CLASSTYPE_IMPLEMENTATION
ProceduralField< V3f > ProceduralField3f
ProceduralField< half > ProceduralFieldh
ProceduralField< float > ProceduralFieldf
ProceduralField< V3h > ProceduralField3h
ProceduralField< V3d > ProceduralField3d
ProceduralField< double > ProceduralFieldd
#define DEFINE_FIELD_RTTI_ABSTRACT_CLASS
FIELD3D_NAMESPACE_OPENtypedef ::half half
std::string name
Optional name of the field.
Data_T typedIntMetadata(const std::string &name, const Data_T &defaultVal) const
Calls either sampleIntMetadata() if the ProceduralField is scalar (half, float, or double),...
Data_T typedFloatMetadata(const std::string &name, const Data_T &defaultVal) const
Calls either sampleFloatMetadata() if the ProceduralField is scalar (half, float, or double),...
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Used to return a string for the name of a templated field.