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

#include <ParameterPlugin.h>

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

Signals

void forceRedraw ()
 is emmited to force the widget´s redraw
 
- Signals inherited from Frapper::Parameter
void dirtied ()
 Signal that is emitted when the value of the parameter becomes dirty.
 
void valueChanged ()
 Signal that is emitted when the parameter's value has changed.
 
void valueChanged (int index)
 Signal that is emitted when the parameter's value with the given index has changed.
 
void processingRequested ()
 Signal that is emitted when the value of the parameter should be processed.
 
void auxProcessingRequested ()
 Signal that is emitted when auxiliary changes in combination with the value happen.
 
void commandExecutionRequested ()
 Signal that is emitted when a command parameter is triggered.
 
void connectionEstablished ()
 Signal that is emitted when a connection is established.
 
void connectionDestroyed ()
 Signal that is emitted when a connection is destroyed.
 
- Signals inherited from Frapper::AbstractParameter
void enabledChanged ()
 Signal that is emitted when the parameter is enabled or disabled.
 

Public Member Functions

 ParameterPlugin (const QString &name, QString type, QMap< QString, QVariant > flags, const QVariant &value)
 Constructor of the ParameterPlugin class.
 
 ParameterPlugin (const QString &name, QString type, const QVariant &value)
 Constructor of the ParameterPlugin class Overload without flags.
 
 ParameterPlugin (const QString &name, const QVariant &value)
 Constructor of the ParameterPlugin class Overload without flags of call.
 
 ParameterPlugin (ParameterPlugin *parameter)
 Copy constructor.
 
virtual ~ParameterPlugin ()
 Destructor of the ParameterPlugin class.
 
void setFlags (QMap< QString, QVariant > flags)
 Sets the flags, replaces existing flags.
 
void addFlag (QString key, QVariant value)
 Adds a flag, overwrites the flag if existing.
 
QMap< QString, QVariant > getFlags ()
 returns all flags
 
QVariant getFlag (QString flag)
 returns the value of a certain flag
 
QString getCall ()
 returns the identification of the widget
 
void setCall (QString call)
 sets the identification of the widget
 
void triggerWidgetRedraw ()
 forces the associated widget to redraw
 
void copyParameterValue (Parameter *parameter)
 copies the value from another parameter to this parameter
 
void copyNumberParameterValue (NumberParameter *numberParameter)
 copies the value from a nuumber parameter to this parameter
 
bool getIntegerFlag (QString flag, int &number)
 Sets the value of a interger to the integer value of a flag.
 
bool getFloatFlag (QString flag, float &number)
 Sets the value of a float to the float value of a flag.
 
bool getStringFlag (QString flag, QString &string)
 Sets the value of a QString to the QString value of a flag.
 
bool getBoolFlag (QString flag, bool &boolean)
 Sets the value of a bool to the bool value of a flag.
 
QVariant::Type getFlagType (QString flag)
 Returns the type of a flag.
 
QVariant::Type getParameterType ()
 Returns the type of the parameters value.
 
QList< QVariant > * TransformFloatToVariantList (QList< float > *list)
 Transforms a List of floats into a list of QVariants.
 
QList< float > * TransformVariantToFloatList (QList< QVariant > *list)
 Transforms a List of QVariants into a list of floats.
 
- Public Member Functions inherited from Frapper::Parameter
 Parameter (const QString &name, Type type, const QVariant &value)
 Constructor of the Parameter class.
 
 Parameter (const Parameter &parameter)
 Copy constructor of the Parameter class.
 
virtual ~Parameter ()
 Destructor of the Parameter class.
 
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.
 
Type getType () const
 Returns the parameter's type.
 
Size getSize () const
 Returns the parameter's size specifying how many values of the given type it stores.
 
void setSize (Size size)
 Sets the parameter's size specifying how many values of the given type it stores.
 
int getMultiplicity () const
 Returns the parameter's multiplicity specifying how many parameters of the given type can be connected to it.
 
void setMultiplicity (int multiplicity)
 Sets the parameter's multiplicity specifying how many parameters of the given type can be connected to it.
 
int getNumberOfConnections () const
 Returns the parameter's number of connections.
 
virtual QVariant getValue (bool triggerEvaluation=false)
 Returns the parameter's value while optionally triggering the evaluation chain.
 
virtual const QVariantList & getValueList () const
 Returns the parameter's value list. Which contains the values of all connected parameters.
 
void setValue (const QVariant &value, bool triggerDirtying=false)
 Sets the parameter's value to the given value.
 
void setValue (int index, const QVariant &value, bool triggerDirtying=false)
 Sets the parameter's value with the given index to the given value.
 
bool hasDefaultValue () const
 Returns whether the parameter's current value is the default value.
 
void setDefaultValue (const QVariant &defaultValue)
 Sets the parameter's default value to the given value.
 
virtual void reset ()
 Resets the parameter to its default value.
 
List getAffectedParameters () const
 Returns the list of parameters that are affected when the value of this parameter is changed.
 
void addAffectedParameter (Parameter *affectedParameter)
 Adds a parameter to the list of parameters that are affected when the value of this parameter is changed.
 
void removeAffectedParameter (Parameter *affectedParameter)
 Removes a parameter from the list of parameters that are affected when the value of this parameter is changed.
 
List getAffectingParameters () const
 Returns the list of parameters that affect this parameter when their value is changed.
 
void addAffectingParameter (Parameter *affectingParameter)
 Adds a parameter to the list of parameters that are affected when the value of this parameter is changed.
 
void removeAffectingParameter (Parameter *affectingParameter)
 Removes a parameter from the list of parameters that are affected when the value of this parameter is changed.
 
QString getDescription () const
 Returns the description of the parameter.
 
void setDescription (const QString &description)
 Sets the description for the parameter.
 
PinType getPinType () const
 Returns the type of pin that should be created to represent the parameter.
 
void setPinType (PinType pinType)
 Sets the type of pin that should be created to represent the parameter.
 
Connection::Map getConnectionMap () const
 Returns all connections currently connected to this parameter.
 
void addConnection (Connection *connection)
 Adds the given connection to the list of connections.
 
void removeConnection (Connection::ID id)
 Removes the given connection from the list of connections.
 
bool isConnected () const
 Returns whether the parameter is connected to at least one other parameter.
 
ParametergetConnectedParameter () const
 Returns the first parameter connected to this parameter.
 
bool isDirty ()
 Returns whether the parameter's value has changed.
 
virtual void setDirty (bool dirty)
 Sets whether the parameter's value has changed.
 
bool isAuxDirty ()
 Returns the auxiliary dirty flag.
 
virtual void setAuxDirty (bool dirty)
 Sets the auxiliary dirty flag.
 
bool isVisible () const
 Returns the visibility for this parameter.
 
void setVisible (bool visible)
 Sets the visibility for this parameter.
 
bool isReadOnly () const
 Returns whether the parameter can not be modified using a control in the UI.
 
void setReadOnly (bool readOnly)
 Sets whether the parameter can not be modified using a control in the UI.
 
void setSelfEvaluating (bool selfEvaluating)
 Sets whether the parameter is self-evaluating.
 
bool isSelfEvaluating () const
 Returns wether the parameter is self-evaluating.
 
void propagateDirty (bool setFirstTrue=true)
 Sets the dirty flag for all parameters that are connected with and affected by this parameter.
 
void propagateAuxDirty ()
 Sets the aux dirty flag for all parameters that are affecting this parameter..
 
void propagateEvaluation ()
 Propagates the evaluation of nodes.
 
void setChangeFunction (const char *changeFunction)
 Sets the function to call when the parameter's value changes.
 
void setProcessingFunction (const char *processingFunction)
 Sets the function to use for computing the parameter's value.
 
void setAuxProcessingFunction (const char *processingFunction)
 Sets the function to use for computing auxiliary value dependant things.
 
void setCommandFunction (const char *commandFunction)
 Sets the function to use for executing the command represented by the parameter.
 
void setOnConnectFunction (const char *onConnectFunction)
 Sets the function which should be called on parameter's connection.
 
void setOnDisconnectFunction (const char *onDisconnectFunction)
 Sets the function which should be called on parameter's disconnection.
 
void executeCommand ()
 Emits the commandExecutionRequested signal to notify connected objects that the command represented by the parameter should be executed.
 
QString getValueString ()
 Returns the parameter's value as a character string.
 
- 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 setEnabled (bool enabled, bool propagate=true)
 Sets 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.
 
virtual void setNode (Node *node)
 Sets the node to which this parameter or parameter group belongs.
 

Private Attributes

QString m_call
 Holds the identification of the associated plugin widget.
 
QMap< QString, QVariant > m_flags
 Holds the flags.
 

Additional Inherited Members

- Public Types inherited from Frapper::Parameter
enum  Type {
  T_Unknown = -1, T_Bool, T_Int, T_UnsignedInt,
  T_Float, T_String, T_Filename, T_Color,
  T_Enumeration, T_TextInfo, T_Command, T_Geometry,
  T_Light, T_Camera, T_Image, T_Group,
  T_PlugIn, T_Generic, T_NumTypes
}
 Nested enumeration for the different types of parameters. More...
 
enum  Multiplicity { M_Invalid = -1, M_OneOrMore }
 Nested enumeration for special types of multiplicity. More...
 
enum  PinType { PT_None = -1, PT_Input, PT_Output }
 Nested enumeration for the different types of pins to represent parameters. More...
 
typedef unsigned int Size
 Type definition for the size of a parameter, specifying how many values of the given type the parameter can store.
 
- Static Public Member Functions inherited from Frapper::Parameter
static QString getTypeName (Type type)
 Returns the name of the given parameter type.
 
static QColor getTypeColor (Type type)
 Returns the color of the given parameter type.
 
static Type getTypeByName (const QString &typeName)
 Returns the parameter type corresponding to the given name.
 
static QVariant getDefaultValue (Type type)
 Returns the default value for parameters of the given type.
 
static QColor decodeIntColor (const QString &color)
 Converts the given string to a color value. The string should contain comma-separated integer values for the red, green and blue channels respectively.
 
static QColor decodeDoubleColor (const QString &color)
 Converts the given string to a color value. The string should contain comma-separated double-precision floating point values for the red, green and blue channels respectively.
 
static Size decodeSize (const QString &size)
 Converts the given string to a size value.
 
static int decodeMultiplicity (const QString &multiplicity)
 Converts the given string to a multiplicity value.
 
static PinType decodePinType (const QString &pinTypeString)
 Converts the given string to a pin type value.
 
static Parametercreate (const QString &name, Type type, QVariant defaultValue=QVariant())
 Creates a parameter with the given name and type.
 
static Parametercreate (const QDomElement &element)
 Creates a parameter from the given XML element.
 
static Parameterclone (const Parameter &parameter)
 Creates a copy of the given parameter.
 
static QString extractFirstGroupName (QString *path)
 Extracts the name of first group found in the given parameter path.
 
static ParametercreateImageParameter (const QString &name, Ogre::TexturePtr texturePointer=Ogre::TexturePtr(0))
 Creates an image parameter with the given name.
 
static ParametercreateGroupParameter (const QString &name, ParameterGroup *parameterGroup=0)
 Creates a group parameter with the given name.
 
- Static Public Attributes inherited from Frapper::Parameter
static const QString PathSeparator = " > "
 The string that separates parts in parameter paths.
 
static const QString EnumerationSeparator = "---"
 The string that identifies enumeration separators.
 
- Protected Attributes inherited from Frapper::Parameter
QMutex m_mutex
 Mutex for threaded programming.
 
QStringList m_mutexList
 
Type m_type
 The type of the parameter's value.
 
int m_size
 The parameter's size specifying how many values of the given type it stores.
 
int m_multiplicity
 The parameter's multiplicity specifying how many parameters of the given type can be connected to it.
 
QVariant m_defaultValue
 The parameter's default value.
 
QVariant m_value
 The parameter's value.
 
QVariantList m_valueList
 The parameter's value.
 
QString m_description
 A description of the parameter.
 
PinType m_pinType
 The type of pin that should be created to represent the parameter.
 
Connection::Map m_connectionMap
 The map of connections that are connected to this connector with connection IDs as keys.
 
List m_affectedParameters
 A list of parameter names that are affected when the value of this parameter is changed.
 
List m_affectingParameters
 A list of parameter names that affect this parameter.
 
bool m_dirty
 Flag that states whether the parameter's value has changed.
 
bool m_auxDirty
 Auxiliary dirty flag.
 
bool m_visible
 Flag that states whether the parameter's should be visible in e.g. ParameterPanel or not.
 
bool m_readOnly
 Flag that states whether the parameter's value can not be changed using an input control in the UI.
 
bool m_selfEvaluating
 Flag that states whether the parameter is self-evaluating.
 

Constructor & Destructor Documentation

Frapper::ParameterPlugin::ParameterPlugin ( const QString &  name,
QString  type,
QMap< QString, QVariant >  flags,
const QVariant &  value 
)

Constructor of the ParameterPlugin class.

Constructors and Destructors.

Parameters
nameThe name of the parameter.
typeThe type of the parameter's widget.
falgsThe flags of the parameter.
valueThe parameter's value.

Constructor of the ParameterPlugin class.

Parameters
nameThe name of the parameter.
typeThe type of the parameter's widget.
falgsThe flags of the parameter.
valueThe parameter's value.
Frapper::ParameterPlugin::ParameterPlugin ( const QString &  name,
QString  type,
const QVariant &  value 
)

Constructor of the ParameterPlugin class Overload without flags.

Parameters
nameThe name of the parameter.
typeThe type of the parameter's widget.
valueThe parameter's value.
Frapper::ParameterPlugin::ParameterPlugin ( const QString &  name,
const QVariant &  value 
)

Constructor of the ParameterPlugin class Overload without flags of call.

Constructor of the ParameterPlugin class Overload without flags or call.

Parameters
nameThe name of the parameter.
valueThe parameter's value.
Frapper::ParameterPlugin::ParameterPlugin ( ParameterPlugin parameter)

Copy constructor.

Parameters
parameterThe parameter to copy
Frapper::ParameterPlugin::~ParameterPlugin ( )
virtual

Destructor of the ParameterPlugin class.

Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.

Member Function Documentation

void Frapper::ParameterPlugin::setFlags ( QMap< QString, QVariant >  flags)

Sets the flags, replaces existing flags.

Public Functions.

Parameters
flagsQMap of flags

Sets the flags, replaces existing flags

Parameters
flagsQMap of flags
void Frapper::ParameterPlugin::addFlag ( QString  key,
QVariant  value 
)

Adds a flag, overwrites the flag if existing.

Parameters
keyThe name of the flag
valueThe value of the flag
QMap< QString, QVariant > Frapper::ParameterPlugin::getFlags ( )

returns all flags

Returns
A QMap of all flags
QVariant Frapper::ParameterPlugin::getFlag ( QString  flag)

returns the value of a certain flag

Parameters
flagThe name of the flag
Returns
the Value of the flag
QString Frapper::ParameterPlugin::getCall ( )

returns the identification of the widget

Returns
The name of the associated plugin widget
void Frapper::ParameterPlugin::setCall ( QString  call)

sets the identification of the widget

Parameters
callThe name of the associated widget
void Frapper::ParameterPlugin::triggerWidgetRedraw ( )

forces the associated widget to redraw

void Frapper::ParameterPlugin::copyParameterValue ( Parameter parameter)

copies the value from another parameter to this parameter

Parameters
parameterPointer of the source parameter
void Frapper::ParameterPlugin::copyNumberParameterValue ( NumberParameter numberParameter)

copies the value from a nuumber parameter to this parameter

Parameters
numberParameterPointer of the source NumberParameter
bool Frapper::ParameterPlugin::getIntegerFlag ( QString  flag,
int &  number 
)

Sets the value of a interger to the integer value of a flag.

Sets the value of a integer to the integer value of a flag.

Parameters
flagName of the flag
numberPointer to the number variable to be set
Returns
True if number was changed
bool Frapper::ParameterPlugin::getFloatFlag ( QString  flag,
float &  number 
)

Sets the value of a float to the float value of a flag.

Parameters
flagName of the flag
numberPointer to the number variable to be set
Returns
True if number was changed
bool Frapper::ParameterPlugin::getStringFlag ( QString  flag,
QString &  string 
)

Sets the value of a QString to the QString value of a flag.

Parameters
flagName of the flag
stringPointer to the string variable to be set
Returns
True if string was changed
Parameters
flagName of the flag
numberPointer to the string variable to be set
Returns
True if string was changed
bool Frapper::ParameterPlugin::getBoolFlag ( QString  flag,
bool &  boolean 
)

Sets the value of a bool to the bool value of a flag.

Parameters
flagName of the flag
booleanPointer to the boolean variable to be set
Returns
True if boolean variabe was changed
QVariant::Type Frapper::ParameterPlugin::getFlagType ( QString  flag)

Returns the type of a flag.

Parameters
flagNam of the flag
Returns
Type of the flag
QVariant::Type Frapper::ParameterPlugin::getParameterType ( )

Returns the type of the parameters value.

Returns
Type of the parameters value
QList< QVariant > * Frapper::ParameterPlugin::TransformFloatToVariantList ( QList< float > *  list)

Transforms a List of floats into a list of QVariants.

Parameters
listQList of float values
Returns
QList of QVariant values
QList< float > * Frapper::ParameterPlugin::TransformVariantToFloatList ( QList< QVariant > *  list)

Transforms a List of QVariants into a list of floats.

Parameters
listQList of QVariant values
Returns
QList of float values
void Frapper::ParameterPlugin::forceRedraw ( )
signal

is emmited to force the widget´s redraw

Member Data Documentation

QString Frapper::ParameterPlugin::m_call
private

Holds the identification of the associated plugin widget.

QMap<QString, QVariant> Frapper::ParameterPlugin::m_flags
private

Holds the flags.


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