29 #include <boost/filesystem.hpp>
31 #include "WProperties.h"
32 #include "WPropertyBase.h"
33 #include "WPropertyGroupBase.h"
34 #include "WPropertyVariable.h"
35 #include "WTransferFunction.h"
36 #include "exceptions/WPropertyNameMalformed.h"
41 m_description( description ),
43 m_purpose( PV_PURPOSE_PARAMETER ),
44 signal_PropertyChange(),
48 if( (
m_name.find( std::string(
"/" ) ) != std::string::npos ) ||
m_name.empty() )
51 "\" is malformed. Do not use slashes (\"/\") or empty strings in property names." ) );
57 m_name( from.m_name ),
58 m_description( from.m_description ),
59 m_hidden( from.m_hidden ),
60 m_type( from.m_type ),
61 m_purpose( from.m_purpose ),
62 signal_PropertyChange(),
118 return std::dynamic_pointer_cast< WPVInt >( shared_from_this() );
123 return std::dynamic_pointer_cast< WPVDouble >( shared_from_this() );
128 return std::dynamic_pointer_cast< WPVBool >( shared_from_this() );
133 return std::dynamic_pointer_cast< WPVString >( shared_from_this() );
138 return std::dynamic_pointer_cast< WPVFilename >( shared_from_this() );
143 return std::dynamic_pointer_cast< WPVSelection >( shared_from_this() );
148 return std::dynamic_pointer_cast< WPVColor >( shared_from_this() );
153 return std::dynamic_pointer_cast< WPVPosition >( shared_from_this() );
158 return std::dynamic_pointer_cast< WPVGroup >( shared_from_this() );
163 return std::dynamic_pointer_cast< WPropertyGroupBase >( shared_from_this() );
168 return std::dynamic_pointer_cast< WPVMatrix4X4 >( shared_from_this() );
173 return std::dynamic_pointer_cast< WPVTrigger >( shared_from_this() );
178 return std::dynamic_pointer_cast< WPVTransferFunction >( shared_from_this() );
188 return std::dynamic_pointer_cast< WPVInterval >( shared_from_this() );
Class allowing multiple conditions to be used for one waiting cycle.
Abstract base class for all properties.
bool isHidden() const
Determines whether the property is hidden or not.
PROPERTY_TYPE m_type
Type of the PropertyVariable instance.
std::shared_ptr< WPropertyGroupBase > toPropGroupBase()
Convert the property to a WPropertyGroupBase.
WPropInterval toPropInterval()
Helper converts this instance to its native type.
WPropString toPropString()
Helper converts this instance to its native type.
WPropDouble toPropDouble()
Helper converts this instance to its native type.
std::string m_description
Description of the property.
WPropTransferFunction toPropTransferFunction()
Helper converts this instance to its native type.
PROPERTY_PURPOSE m_purpose
The purpose of this property.
std::string getName() const
Gets the name of the class.
std::shared_ptr< WConditionSet > m_updateCondition
Condition notified whenever something changes.
WPropBool toPropBool()
Helper converts this instance to its native type.
virtual PROPERTY_TYPE getType() const
Gets the real WPropertyVariable type of this instance.
bool m_hidden
Flag denoting whether the property is hidden or not.
WPropColor toPropColor()
Helper converts this instance to its native type.
void setHidden(bool hidden=true)
Sets the property hidden.
std::string getDescription() const
Gets the description of the property.
std::string m_name
Name of the property.
WPropFilename toPropFilename()
Helper converts this instance to its native type.
virtual std::shared_ptr< WCondition > getUpdateCondition() const
This method returns a condition which gets fired whenever the property changes somehow.
WPropMatrix4X4 toPropMatrix4X4()
Helper converts this instance to its native type.
WPropInt toPropInt()
Helper converts this instance to its native type.
WPropPosition toPropPosition()
Helper converts this instance to its native type.
virtual void setPurpose(PROPERTY_PURPOSE purpose)
Sets the purpose of the property.
WPropertyBase(std::string name, std::string description)
Create an empty named property.
virtual PROPERTY_PURPOSE getPurpose() const
Gets the purpose of a property.
WPropTrigger toPropTrigger()
Helper converts this instance to its native type.
virtual void updateType()
Calculates the type of the property.
WPropSelection toPropSelection()
Helper converts this instance to its native type.
virtual ~WPropertyBase()
Destructor.
WPropGroup toPropGroup()
Helper converts this instance to its native type.
std::shared_ptr< WPropertyGroupBase > SPtr
Convenience typedef for a std::shared_ptr< WPropertyGroupBase >.