20 #if !defined(__MITSUBA_CORE_PROPERTIES_H_)
21 #define __MITSUBA_CORE_PROPERTIES_H_
23 #include <mitsuba/mitsuba.h>
28 struct PropertyElement;
78 return ptr == d.
ptr && size == d.
size;
82 return !operator==(d);
99 inline void setPluginName(
const std::string &name) { m_pluginName = name; }
104 inline const std::string &
getID()
const {
return m_id; }
106 inline void setID(
const std::string &
id) { m_id = id; }
109 void setBoolean(
const std::string &name,
const bool &value,
bool warnDuplicates =
true);
111 bool getBoolean(
const std::string &name)
const;
113 bool getBoolean(
const std::string &name,
const bool &defVal)
const;
116 void setInteger(
const std::string &name,
const int &value,
bool warnDuplicates =
true);
118 int getInteger(
const std::string &name)
const;
120 int getInteger(
const std::string &name,
const int &defVal)
const;
123 void setLong(
const std::string &name,
const int64_t &value,
bool warnDuplicates =
true);
125 int64_t getLong(
const std::string &name)
const;
127 int64_t getLong(
const std::string &name,
const int64_t &defVal)
const;
130 void setSize(
const std::string &name,
const size_t &value,
bool warnDuplicates =
true);
132 size_t getSize(
const std::string &name)
const;
134 size_t getSize(
const std::string &name,
const size_t &defVal)
const;
137 void setFloat(
const std::string &name,
const Float &value,
bool warnDuplicates =
true);
139 Float getFloat(
const std::string &name)
const;
141 Float getFloat(
const std::string &name,
const Float &defVal)
const;
144 void setData(
const std::string &name,
const Data &value,
bool warnDuplicates =
true);
146 Data getData(
const std::string &name)
const;
148 Data getData(
const std::string &name,
const Data &defVal)
const;
151 void setTransform(
const std::string &name,
const Transform &value,
bool warnDuplicates =
true);
153 Transform getTransform(
const std::string &name)
const;
158 void setAnimatedTransform(
const std::string &name,
const AnimatedTransform *value,
bool warnDuplicates =
true);
167 void setSpectrum(
const std::string &name,
const Spectrum &value,
bool warnDuplicates =
true);
169 Spectrum getSpectrum(
const std::string &name)
const;
171 Spectrum getSpectrum(
const std::string &name,
const Spectrum &defVal)
const;
174 void setPoint(
const std::string &name,
const Point &value,
bool warnDuplicates =
true);
176 Point getPoint(
const std::string &name)
const;
178 Point getPoint(
const std::string &name,
const Point &defVal)
const;
181 void setVector(
const std::string &name,
const Vector &value,
bool warnDuplicates =
true);
183 Vector getVector(
const std::string &name)
const;
185 Vector getVector(
const std::string &name,
const Vector &defVal)
const;
188 void setString(
const std::string &name,
const std::string &value,
bool warnDuplicates =
true);
190 std::string getString(
const std::string &name)
const;
192 std::string getString(
const std::string &name,
const std::string &defVal)
const;
195 std::string getAsString(
const std::string &name)
const;
197 std::string getAsString(
const std::string &name,
const std::string &defVal)
const;
200 void copyAttribute(
const Properties &properties,
201 const std::string &sourceName,
const std::string &targetName);
204 void putPropertyNames(std::vector<std::string> &results)
const;
208 std::vector<std::string> results;
209 putPropertyNames(results);
214 void markQueried(
const std::string &name)
const;
217 bool wasQueried(
const std::string &name)
const;
220 bool hasProperty(
const std::string &name)
const;
226 bool removeProperty(
const std::string &name);
229 EPropertyType getType(
const std::string &name)
const;
232 std::vector<std::string> getUnqueried()
const;
238 bool operator==(
const Properties &props)
const;
242 return !operator==(props);
249 std::string toString()
const;
251 std::map<std::string, PropertyElement> *m_elements;
252 std::string m_pluginName, m_id;
bool operator!=(const Properties &props) const
Inequality comparision operator.
Definition: properties.h:241
3D vector
Definition: properties.h:59
std::vector< std::string > getPropertyNames() const
Return an array containing the names of all stored properties.
Definition: properties.h:207
EPropertyType
Supported types of properties.
Definition: properties.h:49
bool operator!=(const Data &d) const
Definition: properties.h:81
void setPluginName(const std::string &name)
Set the associated plugin name.
Definition: properties.h:99
void setID(const std::string &id)
Set the associated identifier.
Definition: properties.h:106
#define MTS_EXPORT_CORE
Definition: getopt.h:29
bool operator==(const Data &d) const
Definition: properties.h:77
4x4 transform for homogeneous coordinates
Definition: properties.h:61
3D point
Definition: properties.h:57
Discretized color spectrum.
Definition: properties.h:65
const std::string & getPluginName() const
Get the associated plugin name.
Definition: properties.h:101
const std::string & getID() const
Returns the associated identifier (or the string "unnamed")
Definition: properties.h:104
Reference counting helper.
Definition: ref.h:40
Arbitrary-length string.
Definition: properties.h:67
size_t size
Definition: properties.h:75
uint8_t * ptr
Definition: properties.h:74
Simple pointer-size pair for passing arbitrary data (e.g. between plugins)
Definition: properties.h:73
64-bit signed integer
Definition: properties.h:53
Associative parameter map for constructing subclasses of ConfigurableObject.
Definition: properties.h:46
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
An animated 4x4 transformation.
Definition: properties.h:63
Floating point value.
Definition: properties.h:55