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

Class representing nodes for head animation logic in a 3D scene. More...

#include <PoemReaderNode.h>

Inheritance diagram for PoemReaderNode::PoemReaderNode:
Inheritance graph
[legend]
Collaboration diagram for PoemReaderNode::PoemReaderNode:
Collaboration graph
[legend]

Public Slots

void loadXmlFile ()
 Loads the XML file.
 
void reloadXmlFile ()
 Reloads the XML file.
 
- Public Slots inherited from Frapper::ImageNode
void clearImageCache ()
 Clears the image cache by freeing all memory allocated for the cache.
 
- Public Slots inherited from Frapper::ViewNode
virtual void setEvaluate (bool evaluate)
 Sets whether this node should be evaluated in the network.
 
virtual void setView (bool view, bool suppressViewSetSignal=false)
 Sets whether the geometry of this node should be displayed in the viewport.
 
void setStageIndex (unsigned int stageIndex)
 Sets the index of the stage in which this node should be contained.
 

Signals

void emitGrammar (QString grammar)
 

Public Member Functions

 PoemReaderNode (QString name, ParameterGroup *parameterRoot)
 Constructor of the PoemReaderNode class.
 
virtual ~PoemReaderNode ()
 Destructor of the BorAnimationNode class.
 
void createPoemsData ()
 Public Methods.
 
void renderWords (QGraphicsScene *scene, QString word, qreal size, int &posx, int &posy, int &gWordHeight)
 Render the words in the scene view.
 
bool wordAccepted (QString word)
 Checks if the word is suitable to be in the cloud. For instance, it is not a connector (and, but, with...) or indicates location (this, there, that) ... and so on.
 
QString removeWildCards (QString word)
 Removes the wild cards provided to Kinect to understand better the words: "I choose" and "use ... please".
 
void replyFromCharacter (QString word)
 This function allows to elicit an empathic response from the character.
 
- Public Member Functions inherited from Frapper::ImageNode
 ImageNode (const QString &name, ParameterGroup *parameterRoot, bool cacheEnabled=true, const QString &outputImageName="Image")
 Constructor of the ImageNode class.
 
virtual ~ImageNode ()
 Destructor of the ImageNode class.
 
virtual Ogre::TexturePtr getImage ()
 Returns the image that is generated by this node.
 
bool isCached (int index) const
 Returns whether a cached image is available for the frame with the given index.
 
Ogre::Image * getCachedImage (int index) const
 Returns the image cached for the frame with the given index.
 
- Public Member Functions inherited from Frapper::ViewNode
 ViewNode (const QString &name, ParameterGroup *parameterRoot)
 Constructor of the ViewNode class.
 
virtual ~ViewNode ()
 Destructor of the ViewNode class.
 
unsigned int getStageIndex () const
 Returns the index of the stage in which this node is contained.
 
bool isViewed () const
 Returns whether the result of this node should be displayed in the viewport.
 
virtual Ogre::SceneNodegetSceneNode ()
 Returns the scene node that contains scene objects created or modified by this node.
 
- Public Member Functions inherited from Frapper::CurveEditorDataNode
 CurveEditorDataNode (const QString &name, ParameterGroup *parameterRoot)
 Constructor of the CurveEditorDataNode class.
 
virtual ~CurveEditorDataNode ()
 Destructor of the CurveEditorDataNode class.
 
ParameterGroupgetCurveEditorGoup () const
 Public Functions.
 
void setCurveEditorGoup (ParameterGroup *parameterGroup)
 
- Public Member Functions inherited from Frapper::Node
 Node (const QString &name, ParameterGroup *parameterRoot)
 Constructor of the Node class.
 
virtual ~Node ()
 Destructor of the Node class.
 
virtual void run (const QString &parameterName)
 Execute function for threading.
 
virtual bool process (const QString &parameterName)
 Processes the node's input data to generate the data for the parameter with the given name.
 
bool getTypeUnknown () const
 
ParametergetTimeParameter () const
 Returns the actual timeline intex.
 
QString getName () const
 Returns the name of the node. The name must be unique in the node network so that each node object can be uniquely identified by its name.
 
void setName (const QString &name)
 Sets the name of the node. The name must be unique in the node network so that each node object can be uniquely identified by its name.
 
QString getTypeName () const
 Returns the name of the node's type.
 
void setTypeName (const QString &typeName)
 Set the name of the node's type.
 
bool isTypeUnknown () const
 Returns whether a plugin for the node's type is available.
 
void setTypeUnknown (bool typeUnknown=true)
 Sets the flag that indicates whether a plugin for the node's type is available.
 
bool isEvaluated () const
 Returns whether this node should be evaluated in the network.
 
bool isSelected () const
 Returns whether this node is currently selected.
 
virtual void setSelected (bool selected)
 Sets whether this node is currently selected.
 
bool isSelfEvaluating () const
 Returns whether the node is self-evaluating.
 
bool isSaveable () const
 Returns whether the node is saveable.
 
void setSelfEvaluating (bool selfEvaluating)
 Sets whether the node is self-evaluating.
 
void setSaveable (bool saveable)
 Sets whether the node is saveable.
 
QString getSearchText () const
 Returns the search text currently set for the node.
 
void setSearchText (const QString &searchText)
 Sets the text to use when filtering parameters of the node before creating editing widgets in a parameter editor panel.
 
ParameterGroupgetParameterRoot () const
 Returns the root of the tree of parameters and parameter groups for the node.
 
ParameterGroupgetParameterGroup (const QString &name) const
 Returns the parameter group with the given name.
 
void fillParameterLists (AbstractParameter::List *inputParameters, AbstractParameter::List *outputParameters)
 Iterates over the children of the parameter root and fills the given lists with input and output parameters and parameter groups containing input and output parameters.
 
void fillParameterLists (AbstractParameter::List *connectedInputParameters, AbstractParameter::List *connectedOutputParameters, bool *unconnectedInputParametersAvailable, bool *unconnectedOutputParametersAvailable)
 Iterates over the children of the parameter root and fills the given lists with connected input and output parameters and parameter groups containing connected input and output parameters.
 
AbstractParameter::List getParameters (Parameter::PinType pinType, bool connected, ParameterGroup *parameterGroup=0)
 Returns a list of parameters contained in the given parameter group that are of the given pin type and that are connected or not.
 
bool hasParameter (const QString &name) const
 Returns whether the node contains a parameter with the given name.
 
ParametergetParameter (const QString &name) const
 Returns the parameter with the given name.
 
NumberParametergetNumberParameter (const QString &name) const
 Returns the number parameter with the given name.
 
FilenameParametergetFilenameParameter (const QString &name) const
 Returns the filename parameter with the given name.
 
EnumerationParametergetEnumerationParameter (const QString &name) const
 Returns the enumeration parameter with the given name.
 
GeometryParametergetGeometryParameter (const QString &name) const
 Returns the geometry parameter with the given name.
 
LightParametergetLightParameter (const QString &name) const
 Returns the light parameter with the given name.
 
CameraParametergetCameraParameter (const QString &name) const
 Returns the camera parameter with the given name.
 
void setDirty (const QString &name, bool dirty)
 Sets the dirty state of the parameter with the given name to the given state.
 
void setDirty (bool dirty)
 Sets the dirty state of the node and all child parameters.
 
void setNodeDirty (bool dirty)
 Sets the dirty state of the node.
 
bool isNodeDirty ()
 Returns the dirty state of the node.
 
void removeParameter (const QString &name, bool diveInGroups=true)
 Removes and deletes the parameter with the given name.
 
void removeParameter (Parameter *parameter, bool diveInGroups=true)
 Removes and deletes the given parameter.
 
void addAffection (const QString &parameterName, const QString &affectedParameterName)
 Adds a affection between two parameters.
 
QVariant getValue (const QString &name, bool triggerEvaluation=false)
 Returns the value of the parameter with the given name while optionally triggering the evaluation chain.
 
bool getBoolValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of a boolean parameter while optionally triggering the evaluation chain.
 
int getIntValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of an integer parameter while optionally triggering the evaluation chain.
 
unsigned int getUnsignedIntValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of an unsigned integer parameter while optionally triggering the evaluation chain.
 
float getFloatValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of a 32bit-precision floating point parameter while optionally triggering the evaluation chain.
 
double getDoubleValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of a double-precision floating point parameter while optionally triggering the evaluation chain.
 
QString getStringValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of a string parameter while optionally triggering the evaluation chain.
 
QColor getColorValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of a color parameter while optionally triggering the evaluation chain.
 
Ogre::Vector3 getVectorValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of an OGRE vector parameter while optionally triggering the evaluation chain.
 
Ogre::SceneNodegetSceneNodeValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of a scene node parameter while optionally triggering the evaluation chain.
 
Ogre::TexturePtr getTextureValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of an OGRE texture parameter while optionally triggering the evaluation chain.
 
ParameterGroupgetGroupValue (const QString &name, bool triggerEvaluation=false)
 Convenience function for getting the value of a parameter group parameter while optionally triggering the evaluation chain.
 
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.
 
void setChangeFunction (const QString &name, const char *changeFunction)
 Sets the function to call when a parameter's value changes.
 
void setProcessingFunction (const QString &name, const char *processingFunction)
 Sets the function to use for computing a parameter's value.
 
void setAuxProcessingFunction (const QString &name, const char *processingFunction)
 Sets the auxiliary function to use for computing a parameter's value.
 
void setCommandFunction (const QString &name, const char *commandFunction)
 Sets the function to use for executing the command represented by a parameter.
 
void setOnConnectFunction (const QString &name, const char *onConnectFunction)
 Sets the function which should be called on parameter's connection.
 
void setOnDisconnectFunction (const QString &name, const char *onDisconnectFunction)
 Sets the function which should be called on parameter's disconnection.
 
void notifyChange ()
 Notify when something has changed in the node. (Parameters added/deleted)
 
virtual void setUpTimeDependencies (Parameter *timeParameter)
 Sets up time dependencies for node parameters.
 
virtual void evaluateConnection (Connection *connection)
 Evaluates the given new connection for the node.
 
void deleteConnection (Connection *connection)
 Signal that is emitted in order to delete a connection (through SceneModel)
 
void renderSingleFrame ()
 Render a single frame.
 

Public Attributes

TagCloudViewm_tagCloudView
 

Protected Attributes

ParameterGroupm_wordsGroup
 
ParameterGroupm_poemsGroup
 
ParameterGroupm_poemLinesGroup
 
ParametergroupParameter
 
ParameteroutputImageParameter
 
ParameterinputStringParameter
 
ParameterinputTagParameter
 
ParameteranimStateParameter
 
int m_numberWordsSelected
 
Parameterm_poemSelected
 
Parameterm_alphaParameter
 
- Protected Attributes inherited from Frapper::ImageNode
bool m_cacheEnabled
 Flag that states whether the image cache for this node is enabled.
 
bool m_cacheInvalid
 Flag that states whether the cache is invalid and should be cleared.
 
QString m_outputImageName
 The name of the image output parameter.
 
int m_numberOfImagesToCache
 The total number of images to cache.
 
QMap< int, Ogre::Image * > m_imageCache
 The data structure to use for caching the loaded images.
 
- Protected Attributes inherited from Frapper::ViewNode
unsigned int m_stageIndex
 The index of the stage in which this node is contained.
 
bool m_view
 Flag that states whether the result of this node should be displayed in the viewport.
 
- Protected Attributes inherited from Frapper::CurveEditorDataNode
ParameterGroupm_parameterGroup
 The parameter group containing informations about datastructure.
 
- Protected Attributes inherited from Frapper::Node
QString m_name
 The name of the node.
 
QString m_typeName
 The type of the node.
 
bool m_dirty
 The dirty bit.
 
Parameterm_timeParameter
 The global time parameter to use when addressing image sequences.
 
bool m_typeUnknown
 Flag that states whether a plugin for the node's type is available.
 
bool m_evaluate
 Flag that states whether this node should be evaluated in the network.
 
bool m_selected
 Flag that states whether this node is currently selected.
 
bool m_selfEvaluating
 Flag that states whether the node is self-evaluating.
 
QString m_searchText
 The text to use for filtering parameters of this node before creating editing widgets in a parameter editor panel.
 
bool m_saveable
 Flag that states whether the node is saveable.
 

Private Slots

void reduceWordsCloud ()
 Processes the output parameter depending on its name .
 
void notifySelection ()
 Notifies that the output parameter with the line of the selected poem has changed.
 
void updatePoemSelected ()
 Notifies that the output parameter with the line of the selected poem has changed.
 
void triggerPoemLines ()
 Triggers the poem line when the input value regarding the state of the animation is false.
 
void updateFadingOutTimer ()
 
void updateFadingInTimer ()
 
void fadingOut ()
 
void fadingIn ()
 
void readGrammar (QString grammar)
 

Private Member Functions

bool findWord (QString str)
 Finds a given word in the ParameterList of the Node.
 
bool obtainWord (QString word)
 
void createWordsTable (QString word)
 Creates the widget that holds the words to be represented in the cloud.
 
void setPoemSelected (QString name)
 Updates the value of the output parameter selected poem. Due to issues with the voice synthesis the poem is split in lines and the update is done by lines and passed to the TcpClient line by line.
 

Private Attributes

QTableWidget * m_wordsTable
 
int m_numberWords
 
QString poemsIndexStr
 
QStringList m_poemsindex
 
int rowsInTable
 
int poemLine
 
QStringList poems
 
QTimer * m_foutTimer
 
QTimer * m_finTimer
 
QWidget * parent
 
ParameterGroupparameterRoot
 

Additional Inherited Members

- Static Public Attributes inherited from Frapper::ImageNode
static const int NumberUnknown = -1
 A constant value indicating that the number of images (to cache) is not known yet.
 
- Protected Member Functions inherited from Frapper::ImageNode
void setNumberOfImagesToCache (unsigned int numberOfImagesToCache)
 Sets the number of images to cache to the given value.
 
Ogre::Image * createImageFromTexture (Ogre::TexturePtr texturePointer)
 Creates an image from the given texture.
 
void cacheImage (int index, Ogre::Image *image)
 Stores the given image in the cache for the frame with the given index.
 
void setOutputImage (Ogre::Image *image)
 Sets the given image as the output image in the output image parameter.
 

Detailed Description

Class representing nodes for head animation logic in a 3D scene.

Constructor & Destructor Documentation

PoemReaderNode::PoemReaderNode::PoemReaderNode ( QString  name,
ParameterGroup parameterRoot 
)

Constructor of the PoemReaderNode class.

Constructors and Destructors.

Parameters
nameThe name for the new node.
parameterRootA copy of the parameter tree specific for the type of the node.

Constructor of the PoemReaderNode class.

Parameters
nameThe name for the new node.
parameterRootA copy of the parameter tree specific for the type of the node.
PoemReaderNode::PoemReaderNode::~PoemReaderNode ( )
virtual

Destructor of the BorAnimationNode class.

Destructor of the PoemReaderNode 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 PoemReaderNode::PoemReaderNode::createPoemsData ( )

Public Methods.

Private Methods Creates the parameters that will contain the poems data

void PoemReaderNode::PoemReaderNode::renderWords ( QGraphicsScene *  scene,
QString  word,
qreal  size,
int &  posx,
int &  posy,
int &  gWordHeight 
)

Render the words in the scene view.

\param scene The scene where to render
Parameters
wordThe string to render.
sizeIs the point size of the word according to its frequency of appearance
posxIs the position in X that the word will occupy
posyIs the position in Y that the word will occupy
gWordHeightContains the height of the word with the greates height in one line
bool PoemReaderNode::PoemReaderNode::wordAccepted ( QString  word)

Checks if the word is suitable to be in the cloud. For instance, it is not a connector (and, but, with...) or indicates location (this, there, that) ... and so on.

QString PoemReaderNode::PoemReaderNode::removeWildCards ( QString  word)

Removes the wild cards provided to Kinect to understand better the words: "I choose" and "use ... please".

Eliminates the wildcards "I choose" and "use ... please".

void PoemReaderNode::PoemReaderNode::replyFromCharacter ( QString  word)

This function allows to elicit an empathic response from the character.

void PoemReaderNode::PoemReaderNode::loadXmlFile ( )
slot

Loads the XML file.

Private Slots.

load node settings from XML File

void PoemReaderNode::PoemReaderNode::reloadXmlFile ( )
slot

Reloads the XML file.

wrapper function for loadXmlFile()

bool PoemReaderNode::PoemReaderNode::findWord ( QString  str)
private

Finds a given word in the ParameterList of the Node.

bool PoemReaderNode::PoemReaderNode::obtainWord ( QString  word)
private
void PoemReaderNode::PoemReaderNode::createWordsTable ( QString  word)
private

Creates the widget that holds the words to be represented in the cloud.

void PoemReaderNode::PoemReaderNode::setPoemSelected ( QString  name)
private

Updates the value of the output parameter selected poem. Due to issues with the voice synthesis the poem is split in lines and the update is done by lines and passed to the TcpClient line by line.

void PoemReaderNode::PoemReaderNode::reduceWordsCloud ( )
privateslot

Processes the output parameter depending on its name .

Reduces the amount of words in the wordCloud.

void PoemReaderNode::PoemReaderNode::notifySelection ( )
privateslot

Notifies that the output parameter with the line of the selected poem has changed.

void PoemReaderNode::PoemReaderNode::updatePoemSelected ( )
privateslot

Notifies that the output parameter with the line of the selected poem has changed.

void PoemReaderNode::PoemReaderNode::triggerPoemLines ( )
privateslot

Triggers the poem line when the input value regarding the state of the animation is false.

void PoemReaderNode::PoemReaderNode::updateFadingOutTimer ( )
privateslot
void PoemReaderNode::PoemReaderNode::updateFadingInTimer ( )
privateslot
void PoemReaderNode::PoemReaderNode::fadingOut ( )
privateslot
void PoemReaderNode::PoemReaderNode::fadingIn ( )
privateslot
void PoemReaderNode::PoemReaderNode::readGrammar ( QString  grammar)
privateslot
void PoemReaderNode::PoemReaderNode::emitGrammar ( QString  grammar)
signal

Member Data Documentation

TagCloudView* PoemReaderNode::PoemReaderNode::m_tagCloudView
QTableWidget* PoemReaderNode::PoemReaderNode::m_wordsTable
private
int PoemReaderNode::PoemReaderNode::m_numberWords
private
QString PoemReaderNode::PoemReaderNode::poemsIndexStr
private
QStringList PoemReaderNode::PoemReaderNode::m_poemsindex
private
int PoemReaderNode::PoemReaderNode::rowsInTable
private
int PoemReaderNode::PoemReaderNode::poemLine
private
QStringList PoemReaderNode::PoemReaderNode::poems
private
QTimer* PoemReaderNode::PoemReaderNode::m_foutTimer
private
QTimer* PoemReaderNode::PoemReaderNode::m_finTimer
private
QWidget* PoemReaderNode::PoemReaderNode::parent
private
ParameterGroup* PoemReaderNode::PoemReaderNode::parameterRoot
private
ParameterGroup* PoemReaderNode::PoemReaderNode::m_wordsGroup
protected
ParameterGroup* PoemReaderNode::PoemReaderNode::m_poemsGroup
protected
ParameterGroup* PoemReaderNode::PoemReaderNode::m_poemLinesGroup
protected
Parameter* PoemReaderNode::PoemReaderNode::groupParameter
protected
Parameter* PoemReaderNode::PoemReaderNode::outputImageParameter
protected
Parameter* PoemReaderNode::PoemReaderNode::inputStringParameter
protected
Parameter* PoemReaderNode::PoemReaderNode::inputTagParameter
protected
Parameter* PoemReaderNode::PoemReaderNode::animStateParameter
protected
int PoemReaderNode::PoemReaderNode::m_numberWordsSelected
protected
Parameter* PoemReaderNode::PoemReaderNode::m_poemSelected
protected
Parameter* PoemReaderNode::PoemReaderNode::m_alphaParameter
protected

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