19 #if !defined(__NORI_PROPLIST_H)
20 #define __NORI_PROPLIST_H
22 #include <nori/color.h>
23 #include <nori/transform.h>
36 bool has(
const std::string & name)
const {
37 return (m_properties.find(name) != m_properties.end());
41 void setBoolean(
const std::string &name,
const bool &value);
47 bool getBoolean(
const std::string &name,
const bool &defaultValue)
const;
50 void setInteger(
const std::string &name,
const int &value);
56 int getInteger(
const std::string &name,
const int &defaultValue)
const;
59 void setFloat(
const std::string &name,
const float &value);
65 float getFloat(
const std::string &name,
const float &defaultValue)
const;
68 void setString(
const std::string &name,
const std::string &value);
71 std::string
getString(
const std::string &name)
const;
74 std::string
getString(
const std::string &name,
const std::string &defaultValue)
const;
133 Boolean_type, Integer_type, Float_type,
134 String_type, Color_type, Point3_type,
135 Vector3_type, Point2_type,
136 Vector2_type, Transform_type
142 Value() : Boolean_value(
false) { }
148 std::string String_value;
157 Property() : type(Boolean_type) { }
160 std::map<std::string, Property> m_properties;
This is an associative container used to supply the constructors of NoriObject subclasses with parame...
Vector3f getVector3(const std::string &name) const
Get a vector property, and throw an exception if it does not exist.
void setFloat(const std::string &name, const float &value)
Set a float property.
void setColor(const std::string &name, const Color3f &value)
Set a color property.
Transform getTransform(const std::string &name) const
Get a transform property, and throw an exception if it does not exist.
Point2f getPoint2(const std::string &name) const
Get a point property, and throw an exception if it does not exist.
Transform getTransform(const std::string &name, const Transform &defaultValue) const
Get a transform property, and use a default value if it does not exist.
int getInteger(const std::string &name, const int &defaultValue) const
Get am integer property, and use a default value if it does not exist.
void setPoint3(const std::string &name, const Point3f &value)
Set a point property.
void setBoolean(const std::string &name, const bool &value)
Set a boolean property.
Vector3f getVector3(const std::string &name, const Vector3f &defaultValue) const
Get a vector property, and use a default value if it does not exist.
float getFloat(const std::string &name) const
Get a float property, and throw an exception if it does not exist.
bool getBoolean(const std::string &name, const bool &defaultValue) const
Get a boolean property, and use a default value if it does not exist.
void setVector3(const std::string &name, const Vector3f &value)
Set a vector property.
std::string getString(const std::string &name) const
Get a string property, and throw an exception if it does not exist.
Vector2f getVector2(const std::string &name, const Vector2f &defaultValue) const
Get a vector property, and use a default value if it does not exist.
Point3f getPoint3(const std::string &name) const
Get a point property, and throw an exception if it does not exist.
Vector2f getVector2(const std::string &name) const
Get a vector property, and throw an exception if it does not exist.
bool getBoolean(const std::string &name) const
Get a boolean property, and throw an exception if it does not exist.
Color3f getColor(const std::string &name) const
Get a color property, and throw an exception if it does not exist.
void setVector2(const std::string &name, const Vector2f &value)
Set a vector property.
void setString(const std::string &name, const std::string &value)
Set a string property.
Color3f getColor(const std::string &name, const Color3f &defaultValue) const
Get a color property, and use a default value if it does not exist.
Point2f getPoint2(const std::string &name, const Point2f &defaultValue) const
Get a point property, and use a default value if it does not exist.
void setPoint2(const std::string &name, const Point2f &value)
Set a point property.
Point3f getPoint3(const std::string &name, const Point3f &defaultValue) const
Get a point property, and use a default value if it does not exist.
int getInteger(const std::string &name) const
Get an integer property, and throw an exception if it does not exist.
float getFloat(const std::string &name, const float &defaultValue) const
Get a float property, and use a default value if it does not exist.
std::string getString(const std::string &name, const std::string &defaultValue) const
Get a string property, and use a default value if it does not exist.
void setTransform(const std::string &name, const Transform &value)
Set a transform property.
void setInteger(const std::string &name, const int &value)
Set an integer property.
Represents a linear RGB color value.