Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::Properties Class Reference

Associative parameter map for constructing subclasses of ConfigurableObject. More...

#include <mitsuba/core/properties.h>

Classes

struct  Data
 Simple pointer-size pair for passing arbitrary data (e.g. between plugins) More...
 

Public Types

enum  EPropertyType {
  EBoolean = 0, EInteger, EFloat, EPoint,
  EVector, ETransform, EAnimatedTransform, ESpectrum,
  EString, EData
}
 Supported types of properties. More...
 

Public Member Functions

 Properties ()
 Construct an empty property container. More...
 
 Properties (const std::string &pluginName)
 Construct an empty property container and set the plugin name. More...
 
 Properties (const Properties &props)
 Copy constructor. More...
 
 ~Properties ()
 Release all memory. More...
 
void setPluginName (const std::string &name)
 Set the associated plugin name. More...
 
const std::string & getPluginName () const
 Get the associated plugin name. More...
 
const std::string & getID () const
 Returns the associated identifier (or the string "unnamed") More...
 
void setID (const std::string &id)
 Set the associated identifier. More...
 
void setBoolean (const std::string &name, const bool &value, bool warnDuplicates=true)
 Set a boolean value. More...
 
bool getBoolean (const std::string &name) const
 Get an boolean value. More...
 
bool getBoolean (const std::string &name, const bool &defVal) const
 Get an boolean value (with default);. More...
 
void setInteger (const std::string &name, const int &value, bool warnDuplicates=true)
 Set an integer value. More...
 
int getInteger (const std::string &name) const
 Get an integer value. More...
 
int getInteger (const std::string &name, const int &defVal) const
 Get an integer value (with default);. More...
 
void setLong (const std::string &name, const int64_t &value, bool warnDuplicates=true)
 Set an integer value. More...
 
int64_t getLong (const std::string &name) const
 Get an integer value. More...
 
int64_t getLong (const std::string &name, const int64_t &defVal) const
 Get an integer value (with default);. More...
 
void setSize (const std::string &name, const size_t &value, bool warnDuplicates=true)
 Set a size value. More...
 
size_t getSize (const std::string &name) const
 Get a size value. More...
 
size_t getSize (const std::string &name, const size_t &defVal) const
 Get an size value (with default);. More...
 
void setFloat (const std::string &name, const Float &value, bool warnDuplicates=true)
 Set a single precision floating point value. More...
 
Float getFloat (const std::string &name) const
 Get a single precision floating point value. More...
 
Float getFloat (const std::string &name, const Float &defVal) const
 Get a single precision floating point value (with default) More...
 
void setData (const std::string &name, const Data &value, bool warnDuplicates=true)
 Set an arbitrary data value. More...
 
Data getData (const std::string &name) const
 Get an arbitrary data value. More...
 
Data getData (const std::string &name, const Data &defVal) const
 Get an arbitrary data value (with default) More...
 
void setTransform (const std::string &name, const Transform &value, bool warnDuplicates=true)
 Set a linear transformation. More...
 
Transform getTransform (const std::string &name) const
 Get a linear transformation. More...
 
Transform getTransform (const std::string &name, const Transform &defVal) const
 Get a linear transformation (with default) More...
 
void setAnimatedTransform (const std::string &name, const AnimatedTransform *value, bool warnDuplicates=true)
 Set an animated linear transformation. More...
 
ref< const AnimatedTransformgetAnimatedTransform (const std::string &name) const
 Get an animated linear transformation. More...
 
ref< const AnimatedTransformgetAnimatedTransform (const std::string &name, const AnimatedTransform *defVal) const
 Get an animated linear transformation (with default) More...
 
ref< const AnimatedTransformgetAnimatedTransform (const std::string &name, const Transform &defVal) const
 Get an animated linear transformation (with default) More...
 
void setSpectrum (const std::string &name, const Spectrum &value, bool warnDuplicates=true)
 Set a spectral power distribution. More...
 
Spectrum getSpectrum (const std::string &name) const
 Get a spectral power distribution. More...
 
Spectrum getSpectrum (const std::string &name, const Spectrum &defVal) const
 Get a spectral power distribution (with default) More...
 
void setPoint (const std::string &name, const Point &value, bool warnDuplicates=true)
 Set a 3d point. More...
 
Point getPoint (const std::string &name) const
 Get a 3d point. More...
 
Point getPoint (const std::string &name, const Point &defVal) const
 Get a 3d point (with default) More...
 
void setVector (const std::string &name, const Vector &value, bool warnDuplicates=true)
 Set a 3d vector. More...
 
Vector getVector (const std::string &name) const
 Get a 3d vector. More...
 
Vector getVector (const std::string &name, const Vector &defVal) const
 Get a 3d vector (with default) More...
 
void setString (const std::string &name, const std::string &value, bool warnDuplicates=true)
 Set a string. More...
 
std::string getString (const std::string &name) const
 Get a string. More...
 
std::string getString (const std::string &name, const std::string &defVal) const
 Get a string (with default) More...
 
std::string getAsString (const std::string &name) const
 Return one of the parameters (converting it to a string if necessary) More...
 
std::string getAsString (const std::string &name, const std::string &defVal) const
 Return one of the parameters (converting it to a string if necessary, with default value) More...
 
void copyAttribute (const Properties &properties, const std::string &sourceName, const std::string &targetName)
 Copy an attribute from another Properties object and potentially rename it. More...
 
void putPropertyNames (std::vector< std::string > &results) const
 Store an array containing the names of all stored properties. More...
 
std::vector< std::string > getPropertyNames () const
 Return an array containing the names of all stored properties. More...
 
void markQueried (const std::string &name) const
 Manually mark a certain property as queried. More...
 
bool wasQueried (const std::string &name) const
 Check if a certain property was queried. More...
 
bool hasProperty (const std::string &name) const
 Verify if a value with the specified name exists. More...
 
bool removeProperty (const std::string &name)
 Remove a property with the specified name. More...
 
EPropertyType getType (const std::string &name) const
 Return the property of a type. More...
 
std::vector< std::string > getUnqueried () const
 Return the list of un-queried attributed. More...
 
void operator= (const Properties &props)
 Assignment operator. More...
 
bool operator== (const Properties &props) const
 Equality comparison operator. More...
 
bool operator!= (const Properties &props) const
 Inequality comparision operator. More...
 
void merge (const Properties &props)
 Merge a properties record into the current one. More...
 
std::string toString () const
 Return a string representation. More...
 

Detailed Description

Associative parameter map for constructing subclasses of ConfigurableObject.

Note that the Python bindings for this class do not implement the various type-dependent getters and setters. Instead, they are accessed just like a normal Python map, e.g:

myProps = mitsuba.core.Properties("pluginName")
myProps["stringProperty"] = "hello"
myProps["spectrumProperty"] = mitsuba.core.Spectrum(1.0)

Member Enumeration Documentation

Supported types of properties.

Enumerator
EBoolean 

Boolean value (true/false)

EInteger 

64-bit signed integer

EFloat 

Floating point value.

EPoint 

3D point

EVector 

3D vector

ETransform 

4x4 transform for homogeneous coordinates

EAnimatedTransform 

An animated 4x4 transformation.

ESpectrum 

Discretized color spectrum.

EString 

Arbitrary-length string.

EData 

Arbitrary data (pointer+size)

Constructor & Destructor Documentation

mitsuba::Properties::Properties ( )

Construct an empty property container.

mitsuba::Properties::Properties ( const std::string &  pluginName)

Construct an empty property container and set the plugin name.

mitsuba::Properties::Properties ( const Properties props)

Copy constructor.

mitsuba::Properties::~Properties ( )

Release all memory.

Member Function Documentation

void mitsuba::Properties::copyAttribute ( const Properties properties,
const std::string &  sourceName,
const std::string &  targetName 
)

Copy an attribute from another Properties object and potentially rename it.

ref<const AnimatedTransform> mitsuba::Properties::getAnimatedTransform ( const std::string &  name) const

Get an animated linear transformation.

ref<const AnimatedTransform> mitsuba::Properties::getAnimatedTransform ( const std::string &  name,
const AnimatedTransform defVal 
) const

Get an animated linear transformation (with default)

ref<const AnimatedTransform> mitsuba::Properties::getAnimatedTransform ( const std::string &  name,
const Transform defVal 
) const

Get an animated linear transformation (with default)

std::string mitsuba::Properties::getAsString ( const std::string &  name) const

Return one of the parameters (converting it to a string if necessary)

std::string mitsuba::Properties::getAsString ( const std::string &  name,
const std::string &  defVal 
) const

Return one of the parameters (converting it to a string if necessary, with default value)

bool mitsuba::Properties::getBoolean ( const std::string &  name) const

Get an boolean value.

bool mitsuba::Properties::getBoolean ( const std::string &  name,
const bool defVal 
) const

Get an boolean value (with default);.

Data mitsuba::Properties::getData ( const std::string &  name) const

Get an arbitrary data value.

Data mitsuba::Properties::getData ( const std::string &  name,
const Data defVal 
) const

Get an arbitrary data value (with default)

Float mitsuba::Properties::getFloat ( const std::string &  name) const

Get a single precision floating point value.

Float mitsuba::Properties::getFloat ( const std::string &  name,
const Float defVal 
) const

Get a single precision floating point value (with default)

const std::string& mitsuba::Properties::getID ( ) const
inline

Returns the associated identifier (or the string "unnamed")

int mitsuba::Properties::getInteger ( const std::string &  name) const

Get an integer value.

int mitsuba::Properties::getInteger ( const std::string &  name,
const int &  defVal 
) const

Get an integer value (with default);.

int64_t mitsuba::Properties::getLong ( const std::string &  name) const

Get an integer value.

int64_t mitsuba::Properties::getLong ( const std::string &  name,
const int64_t &  defVal 
) const

Get an integer value (with default);.

const std::string& mitsuba::Properties::getPluginName ( ) const
inline

Get the associated plugin name.

Point mitsuba::Properties::getPoint ( const std::string &  name) const

Get a 3d point.

Point mitsuba::Properties::getPoint ( const std::string &  name,
const Point defVal 
) const

Get a 3d point (with default)

std::vector<std::string> mitsuba::Properties::getPropertyNames ( ) const
inline

Return an array containing the names of all stored properties.

size_t mitsuba::Properties::getSize ( const std::string &  name) const

Get a size value.

size_t mitsuba::Properties::getSize ( const std::string &  name,
const size_t &  defVal 
) const

Get an size value (with default);.

Spectrum mitsuba::Properties::getSpectrum ( const std::string &  name) const

Get a spectral power distribution.

Spectrum mitsuba::Properties::getSpectrum ( const std::string &  name,
const Spectrum defVal 
) const

Get a spectral power distribution (with default)

std::string mitsuba::Properties::getString ( const std::string &  name) const

Get a string.

std::string mitsuba::Properties::getString ( const std::string &  name,
const std::string &  defVal 
) const

Get a string (with default)

Transform mitsuba::Properties::getTransform ( const std::string &  name) const

Get a linear transformation.

Transform mitsuba::Properties::getTransform ( const std::string &  name,
const Transform defVal 
) const

Get a linear transformation (with default)

EPropertyType mitsuba::Properties::getType ( const std::string &  name) const

Return the property of a type.

std::vector<std::string> mitsuba::Properties::getUnqueried ( ) const

Return the list of un-queried attributed.

Vector mitsuba::Properties::getVector ( const std::string &  name) const

Get a 3d vector.

Vector mitsuba::Properties::getVector ( const std::string &  name,
const Vector defVal 
) const

Get a 3d vector (with default)

bool mitsuba::Properties::hasProperty ( const std::string &  name) const

Verify if a value with the specified name exists.

void mitsuba::Properties::markQueried ( const std::string &  name) const

Manually mark a certain property as queried.

void mitsuba::Properties::merge ( const Properties props)

Merge a properties record into the current one.

bool mitsuba::Properties::operator!= ( const Properties props) const
inline

Inequality comparision operator.

void mitsuba::Properties::operator= ( const Properties props)

Assignment operator.

bool mitsuba::Properties::operator== ( const Properties props) const

Equality comparison operator.

void mitsuba::Properties::putPropertyNames ( std::vector< std::string > &  results) const

Store an array containing the names of all stored properties.

bool mitsuba::Properties::removeProperty ( const std::string &  name)

Remove a property with the specified name.

Returns
true upon success
void mitsuba::Properties::setAnimatedTransform ( const std::string &  name,
const AnimatedTransform value,
bool  warnDuplicates = true 
)

Set an animated linear transformation.

void mitsuba::Properties::setBoolean ( const std::string &  name,
const bool value,
bool  warnDuplicates = true 
)

Set a boolean value.

void mitsuba::Properties::setData ( const std::string &  name,
const Data value,
bool  warnDuplicates = true 
)

Set an arbitrary data value.

void mitsuba::Properties::setFloat ( const std::string &  name,
const Float value,
bool  warnDuplicates = true 
)

Set a single precision floating point value.

void mitsuba::Properties::setID ( const std::string &  id)
inline

Set the associated identifier.

void mitsuba::Properties::setInteger ( const std::string &  name,
const int &  value,
bool  warnDuplicates = true 
)

Set an integer value.

void mitsuba::Properties::setLong ( const std::string &  name,
const int64_t &  value,
bool  warnDuplicates = true 
)

Set an integer value.

void mitsuba::Properties::setPluginName ( const std::string &  name)
inline

Set the associated plugin name.

void mitsuba::Properties::setPoint ( const std::string &  name,
const Point value,
bool  warnDuplicates = true 
)

Set a 3d point.

void mitsuba::Properties::setSize ( const std::string &  name,
const size_t &  value,
bool  warnDuplicates = true 
)

Set a size value.

void mitsuba::Properties::setSpectrum ( const std::string &  name,
const Spectrum value,
bool  warnDuplicates = true 
)

Set a spectral power distribution.

void mitsuba::Properties::setString ( const std::string &  name,
const std::string &  value,
bool  warnDuplicates = true 
)

Set a string.

void mitsuba::Properties::setTransform ( const std::string &  name,
const Transform value,
bool  warnDuplicates = true 
)

Set a linear transformation.

void mitsuba::Properties::setVector ( const std::string &  name,
const Vector value,
bool  warnDuplicates = true 
)

Set a 3d vector.

std::string mitsuba::Properties::toString ( ) const

Return a string representation.

bool mitsuba::Properties::wasQueried ( const std::string &  name) const

Check if a certain property was queried.


The documentation for this class was generated from the following file: