Frapper  1.0a
Public Member Functions | Private Attributes | List of all members
Frapper::ParameterGroup Class Reference

Class representing a group of parameters of a Node. More...

#include <ParameterGroup.h>

Inheritance diagram for Frapper::ParameterGroup:
Inheritance graph
[legend]
Collaboration diagram for Frapper::ParameterGroup:
Collaboration graph
[legend]

Public Member Functions

 ParameterGroup (const QString &name="")
 Constructor of the ParameterGroup class.
 
virtual ~ParameterGroup ()
 Destructor of the ParameterGroup class.
 
void setValue (const QString &name, const QVariant &value, bool triggerDirtying=false)
 Sets the value of the parameter with the given name to the given value while optionally triggering the dirtying chain.
 
void setValue (const QString &name, bool value, bool triggerDirtying=false)
 Convenience function for setting the value of a boolean parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, int value, bool triggerDirtying=false)
 Convenience function for setting the value of an integer parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, unsigned int value, bool triggerDirtying=false)
 Convenience function for setting the value of an unsigned integer parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, double value, bool triggerDirtying=false)
 Convenience function for setting the value of a double-precision floating point parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, char *value, bool triggerDirtying=false)
 Convenience function for setting the value of a string parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, const char *value, bool triggerDirtying=false)
 Convenience function for setting the value of a string parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, const QString &value, bool triggerDirtying=false)
 Convenience function for setting the value of a string parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, const QColor &value, bool triggerDirtying=false)
 Convenience function for setting the value of a color parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, const Ogre::Vector3 &value, bool triggerDirtying=false)
 Convenience function for setting the value of an OGRE vector parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, Ogre::SceneNode *value, bool triggerDirtying=false)
 Convenience function for setting the value of a scene node parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, const Ogre::TexturePtr value, bool triggerDirtying=false)
 Convenience function for setting the value of an OGRE texture parameter while optionally triggering the dirtying chain.
 
void setValue (const QString &name, ParameterGroup *value, bool triggerDirtying=false)
 Convenience function for setting the value of a parameter group parameter while optionally triggering the dirtying chain.
 
void setParameterEnabled (const QString &name, bool enabled)
 Convenience function for setting the enabled flag of a string parameter.
 
virtual void setEnabled (bool enabled, bool propagate=true)
 Sets whether the controls for editing the parameter group in the UI should be enabled.
 
virtual void setEnabled (bool enabled, bool propagate, bool diveInGroups)
 Sets whether the controls for editing the parameter group in the UI should be enabled.
 
virtual void setNode (Node *node)
 Sets the node to which this parameter group belongs.
 
virtual AbstractParameterclone ()
 Creates an exact copy of the parameter.
 
virtual bool isGroup () const
 Returns whether the parameter object derived from this class is a parameter group.
 
virtual void reset ()
 Resets the parameters contained in the group to their default values.
 
void disconnectParameters (QObject *receiver)
 Disconnects all signals from parameters contained in the group from slots of the given receiver object.
 
void clear ()
 Clears the parameter group by emptying the parameter data structures.
 
void destroyAllParameters ()
 Destroys all parameters in the group.
 
QList< Parameter * > filterParameters (QString searchText, bool diveInChildGroups, bool getAll=false) const
 Returns a list of parameters whose names contain the given search text.
 
bool containsGroup (const QString &name) const
 Returns whether the group contains a group with the given name.
 
bool contains (const QString &name) const
 Returns whether the group contains a parameter with the given name.
 
bool contains (Parameter *parameter) const
 Returns whether the group contains the given parameter.
 
bool contains (Parameter::Type parameterType) const
 Returns whether the group contains parameters of the given type.
 
bool contains (Parameter::PinType pinType) const
 Returns whether the group contains parameters of the given pin type.
 
bool contains (Parameter::PinType pinType, bool connected) const
 Returns whether the group contains parameters of the given pin type and of the given connection status.
 
bool isEmpty () const
 Returns whether the group contains parameters or not.
 
void addParameter (AbstractParameter *parameter, bool prepend=false)
 Adds the given parameter to the group of parameters.
 
ParametergetParameter (const QString &name) const
 Returns the parameter with the given name.
 
ParameterremoveParameter (const QString &name, bool diveInGroups=true)
 Removes and deletes the parameter with the given name from the parameter group.
 
ParameterremoveParameter (Parameter *parameter, bool diveInGroups=true)
 Removes and deletes the given parameter from the parameter group.
 
void removeParameterGroup (const QString &name)
 Removes and deletes the given parameter group from the parameter group.
 
ParameterGroupgetParameterGroup (const QString &name, bool recursive=true) const
 Returns the parameter group with the given name.
 
AbstractParameter::ListgetParameterList ()
 Returns a pointer to the list of parameters and parameter groups that are contained in this group.
 
AbstractParameter::MapgetParameterMap ()
 Returns a pointer to the map of parameters and parameter groups that are contained in this group.
 
- Public Member Functions inherited from Frapper::AbstractParameter
 AbstractParameter (const QString &name)
 Constructor of the AbstractParameter class.
 
 AbstractParameter (const AbstractParameter &parameter)
 Copy constructor of the AbstractParameter class.
 
virtual ~AbstractParameter ()
 Destructor of the AbstractParameter class.
 
QString getName () const
 Returns the name of the parameter or parameter group.
 
bool isEnabled () const
 Returns whether the controls for editing the parameter or parameter group in the UI should be enabled.
 
virtual void setName (const QString &name)
 Sets name of the parameter.
 
NodegetNode () const
 Returns the node to which this parameter or parameter group belongs.
 

Private Attributes

AbstractParameter::List m_parameterList
 The list of parameters or parameter groups contained in this group.
 
AbstractParameter::Map m_parameterMap
 The map of parameters or parameter groups contained in this group.
 

Additional Inherited Members

- Public Types inherited from Frapper::AbstractParameter
typedef QHash< QString,
AbstractParameter * > 
Map
 Type definition for a map of parameters and parameter groups.
 
typedef QList
< AbstractParameter * > 
List
 Type definition for a list of parameters and parameter groups.
 
- Signals inherited from Frapper::AbstractParameter
void enabledChanged ()
 Signal that is emitted when the parameter is enabled or disabled.
 
- Protected Attributes inherited from Frapper::AbstractParameter
QString m_name
 The name of the parameter or parameter group.
 
bool m_enabled
 Flag that states whether the controls for editing the parameter or parameter group in the UI should be enabled.
 
Nodem_node
 The name of the parent node that this parameter or parameter group belongs to.
 

Detailed Description

Class representing a group of parameters of a Node.

Constructor & Destructor Documentation

Frapper::ParameterGroup::ParameterGroup ( const QString &  name = "")

Constructor of the ParameterGroup class.

Constructors and Destructors.

Parameters
nameThe name of the parameter group.

Constructor of the ParameterGroup class.

Parameters
nameThe name of the parameter group.
Frapper::ParameterGroup::~ParameterGroup ( )
virtual

Destructor of the ParameterGroup class.

Member Function Documentation

void Frapper::ParameterGroup::setValue ( const QString &  name,
const QVariant &  value,
bool  triggerDirtying = false 
)

Sets the value of the parameter with the given name to the given value while optionally triggering the dirtying chain.

Public Functions.

Parameters
nameThe name of the parameter to set the value for.
valueThe new value for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.

Public Value Setter Functions Sets the value of the parameter with the given name to the given value while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe new value for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
bool  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of a boolean parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
int  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of an integer parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
unsigned int  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of an unsigned integer parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
double  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of a double-precision floating point parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
char *  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of a string parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
const char *  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of a string parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
const QString &  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of a string parameter while optionally triggering the dirtying chain.

If the parameter with the given name is not a string parameter the given value will be converted according to the parameter's type.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
const QColor &  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of a color parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
const Ogre::Vector3 &  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of an OGRE vector parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
Ogre::SceneNode value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of a scene node parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
const Ogre::TexturePtr  value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of an OGRE texture parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setValue ( const QString &  name,
ParameterGroup value,
bool  triggerDirtying = false 
)

Convenience function for setting the value of a parameter group parameter while optionally triggering the dirtying chain.

Parameters
nameThe name of the parameter to set the value for.
valueThe value to set for the parameter with the given name.
triggerDirtyingFlag to control whether to trigger the dirtying chain.
void Frapper::ParameterGroup::setParameterEnabled ( const QString &  name,
bool  enabled 
)

Convenience function for setting the enabled flag of a string parameter.

Parameters
nameThe name of the parameter to set the value for.
enabledThe enabled flag to set for the parameter with the given name.
void Frapper::ParameterGroup::setEnabled ( bool  enabled,
bool  propagate = true 
)
virtual

Sets whether the controls for editing the parameter group in the UI should be enabled.

Recursively sets the enabled state for all parameters and parameter groups contained in this group.

Parameters
enabledThe value for the parameters' enabled flags. Flag to control whether to emit the enabledChanched signal.

Reimplemented from Frapper::AbstractParameter.

void Frapper::ParameterGroup::setEnabled ( bool  enabled,
bool  propagate,
bool  diveInGroups 
)
virtual

Sets whether the controls for editing the parameter group in the UI should be enabled.

Recursively sets the enabled state for all parameters and parameter groups contained in this group.

Parameters
enabledThe value for the parameters' enabled flags. Flag to control whether to emit the enabledChanched signal. Flag to control whether to also process childs.

Recursively sets the enabled state for all parameters and parameter groups contained in this group.

Parameters
enabledThe value for the parameters' enabled flags. Flag to control whether to also process childs. Flag to control whether to emit the enabledChanched signal.
void Frapper::ParameterGroup::setNode ( Node node)
virtual

Sets the node to which this parameter group belongs.

Recursively sets the node for all parameters and parameter groups contained in this group.

Parameters
nodeThe node to which the parameter group belongs.

Reimplemented from Frapper::AbstractParameter.

AbstractParameter * Frapper::ParameterGroup::clone ( )
virtual

Creates an exact copy of the parameter.

Returns
An exact copy of the parameter.

Implements Frapper::AbstractParameter.

bool Frapper::ParameterGroup::isGroup ( ) const
virtual

Returns whether the parameter object derived from this class is a parameter group.

Returns
True if the parameter object is a parameter group, otherwise False.

Implements Frapper::AbstractParameter.

void Frapper::ParameterGroup::reset ( )
virtual

Resets the parameters contained in the group to their default values.

Implements Frapper::AbstractParameter.

void Frapper::ParameterGroup::disconnectParameters ( QObject *  receiver)

Disconnects all signals from parameters contained in the group from slots of the given receiver object.

Parameters
receiverThe object to disconnect the contained parameters from.
void Frapper::ParameterGroup::clear ( )

Clears the parameter group by emptying the parameter data structures.

void Frapper::ParameterGroup::destroyAllParameters ( )

Destroys all parameters in the group.

QList< Parameter * > Frapper::ParameterGroup::filterParameters ( QString  searchText,
bool  diveInChildGroups,
bool  getAll = false 
) const

Returns a list of parameters whose names contain the given search text.

Parameters
searchTextThe text to match the parameter names against.
diveInChildGroupsFlag to control whether to also process child groups.
getAllRetrieves all parameters.
Returns
A list of parameters whose names contain the given search text.
Parameters
searchTextThe text to match the parameter names against.
diveInChildGroupsFlag to control whether to also process child groups.
Returns
A list of parameters whose names contain the given search text.
bool Frapper::ParameterGroup::containsGroup ( const QString &  name) const

Returns whether the group contains a group with the given name.

Parameters
nameThe group name to find in the group.
Returns
True if the group contains a group with the given name, otherwise False.
bool Frapper::ParameterGroup::contains ( const QString &  name) const

Returns whether the group contains a parameter with the given name.

Parameters
nameThe parameter name to find in the group.
Returns
True if the group contains a parameter with the given name, otherwise False.
bool Frapper::ParameterGroup::contains ( Parameter parameter) const

Returns whether the group contains the given parameter.

Parameters
parameterThe parameter to find in the group.
Returns
True if the group contains the given parameter, otherwise False.
bool Frapper::ParameterGroup::contains ( Parameter::Type  parameterType) const

Returns whether the group contains parameters of the given type.

Parameters
parameterTypeThe parameter type to find in the group.
Returns
True if the group contains parameters of the given type, otherwise False.
bool Frapper::ParameterGroup::contains ( Parameter::PinType  pinType) const

Returns whether the group contains parameters of the given pin type.

Parameters
pinTypeThe pin type of parameters to look for in the group.
Returns
True if the group contains parameters of the given pin type, otherwise False.
bool Frapper::ParameterGroup::contains ( Parameter::PinType  pinType,
bool  connected 
) const

Returns whether the group contains parameters of the given pin type and of the given connection status.

Parameters
pinTypeThe pin type of parameters to look for in the group.
connectedThe connection status of parameters to look for in the group.
Returns
True if the group contains parameters of the given pin type and of the given connection status, otherwise False.
bool Frapper::ParameterGroup::isEmpty ( ) const

Returns whether the group contains parameters or not.

void Frapper::ParameterGroup::addParameter ( AbstractParameter parameter,
bool  prepend = false 
)

Adds the given parameter to the group of parameters.

Adds the given parameter to the list of parameters.

Parameters
parameterThe parameter to add.
prependFlag to control whether to insert the parameter at the beginning of the parameter list.
Parameter * Frapper::ParameterGroup::getParameter ( const QString &  name) const

Returns the parameter with the given name.

Parameters
nameThe name of the parameter to return.
Returns
The parameter with the given name.
Parameter * Frapper::ParameterGroup::removeParameter ( const QString &  name,
bool  diveInGroups = true 
)

Removes and deletes the parameter with the given name from the parameter group.

Parameters
nameThe name of the parameter to remove and delete.
Returns
0.
Parameter * Frapper::ParameterGroup::removeParameter ( Parameter parameter,
bool  diveInGroups = true 
)

Removes and deletes the given parameter from the parameter group.

Parameters
parameterThe parameter to remove and delete.
Returns
0.
void Frapper::ParameterGroup::removeParameterGroup ( const QString &  name)

Removes and deletes the given parameter group from the parameter group.

Parameters
parameterThe parameter group to remove and delete.
ParameterGroup * Frapper::ParameterGroup::getParameterGroup ( const QString &  name,
bool  recursive = true 
) const

Returns the parameter group with the given name.

Parameters
nameThe name of the parameter group to return.
Returns
The parameter group with the given name.
AbstractParameter::List * Frapper::ParameterGroup::getParameterList ( )

Returns a pointer to the list of parameters and parameter groups that are contained in this group.

Returns
A pointer to the list of parameters of this group.
AbstractParameter::Map * Frapper::ParameterGroup::getParameterMap ( )

Returns a pointer to the map of parameters and parameter groups that are contained in this group.

Returns
A pointer to the map of parameters of this group.

Member Data Documentation

AbstractParameter::List Frapper::ParameterGroup::m_parameterList
private

The list of parameters or parameter groups contained in this group.

AbstractParameter::Map Frapper::ParameterGroup::m_parameterMap
private

The map of parameters or parameter groups contained in this group.


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