tuchulcha  0.10.1
Graphical Workflow Configuration Editor
NodeProperty Class Reference

Property(/Parameter) of a node. More...

#include <NodeProperty.h>

Inheritance diagram for NodeProperty:

Public Member Functions

 NodeProperty (Node *parentNode, QString name, int propNr, bool input, const ParameterFileModel *pFile)
 default constructor More...
 
 NodeProperty (Node *parentNode, QString name, QString displayname, int propNr, bool input, const ParameterFileModel *pFile)
 default constructor More...
 
void addConnection (ConnectionLine *cl)
 add a connectionline to the property More...
 
virtual QRectF boundingRect () const
 area for hover event
 
bool canConnect (NodeProperty *prop)
 checks if connection is possible More...
 
void changeConnectionLineColor (QColor lineColor, bool isHover=true)
 change color all connected line of hovering property isHover set to true when the property was hovered
 
QString getFullName () const
 property name including node instance name
 
QPointF getSocketCenter () const
 socket center including node position
 
QString getType () const
 get property type
 
bool isInput () const
 returns the PropType of the property More...
 
void moveBy (qreal dx, qreal dy)
 moves the property and if connected all connectionlines More...
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 draws the property
 
void setColor (QColor socketColor)
 Set the color of the socket.
 

Protected Member Functions

virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 update tool tip
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 clear color of connected line when leave hoverevent
 

Private Member Functions

QRectF _getSocketRect () const
 center of the socket, used to draw end and start of connectionline
 

Static Private Member Functions

static QColor _getSocketColor (QString typeName)
 get color from type
 

Private Attributes

QColor _color
 Socket color.
 
QList< ConnectionLine * > _connectionList
 list of all connectionlines
 
QString _displayname
 name of the property
 
bool _isInput
 pointer to PropType of the property
 
QString _name
 name of the property
 
Node_node
 pointer to parent node
 
const ParameterFileModel_pFile
 link to parameter file
 
unsigned int _propNr
 number of property
 

Detailed Description

Definition at line 35 of file NodeProperty.h.

Constructor & Destructor Documentation

NodeProperty::NodeProperty ( Node parentNode,
QString  name,
int  propNr,
bool  input,
const ParameterFileModel pFile 
)
Parameters
parentNodethe node which the property belongs to
namename of the property
propNrnumber of the property (needed for correct positioning)
inputinput output type of the property
pFilelink to given parameter file

Definition at line 34 of file NodeProperty.cpp.

References _color, and _node.

NodeProperty::NodeProperty ( Node parentNode,
QString  name,
QString  displayname,
int  propNr,
bool  input,
const ParameterFileModel pFile 
)
Parameters
parentNodethe node which the property belongs to
namename of the property
displaynamedisplay name of the property
propNrnumber of the property (needed for correct positioning)
inputinput output type of the property
pFilelink to given parameter file

Definition at line 50 of file NodeProperty.cpp.

References _color, and _node.

Member Function Documentation

void NodeProperty::addConnection ( ConnectionLine cl)
Parameters
clConnectionLine to add

Definition at line 77 of file NodeProperty.cpp.

References _connectionList.

bool NodeProperty::canConnect ( NodeProperty prop)
Parameters
propproperty to connect to
Returns
true if connection is possible
bool NodeProperty::isInput ( ) const
Returns
the PropType of the property

Definition at line 134 of file NodeProperty.cpp.

References _isInput.

void NodeProperty::moveBy ( qreal  dx,
qreal  dy 
)
Parameters
dxx coordinate of movement
dyy coordinate of movement

Definition at line 66 of file NodeProperty.cpp.

References _connectionList, _getSocketRect(), ConnectionLine::getStartProp(), ConnectionLine::setEndPoint(), and ConnectionLine::setStartPoint().


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