Commit 3da5ca1e authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[DOC][STYLE]

parent 376433b5
......@@ -46,7 +46,7 @@ class WQtNetworkInputPort;
*/
class WQtNetworkArrow : public QGraphicsLineItem
{
public:
public:
/**
* This customize the return value of type()
......@@ -117,7 +117,7 @@ class WQtNetworkArrow : public QGraphicsLineItem
*/
QVariant itemChange( GraphicsItemChange change, const QVariant &value );
protected:
protected:
/**
* Draw some customized stuff in the scene.
......@@ -142,7 +142,7 @@ class WQtNetworkArrow : public QGraphicsLineItem
*/
void hoverLeaveEvent( QGraphicsSceneHoverEvent * event );
private:
private:
/**
* This method changes the color of the arrow.
......
......@@ -55,7 +55,6 @@ public:
/**
* default constructor
*
* \param title Title will be displayed above the widget
* \param parent The widget that manages this widget
*/
explicit WQtNetworkEditor( WMainWindow* parent = 0 );
......@@ -67,7 +66,7 @@ public:
/**
* Create a new WQtNetworkItem for a given WModule
* \param a new WModule
* \param module a new WModule
*/
void addModule( boost::shared_ptr< WModule > module );
......@@ -100,20 +99,18 @@ protected:
/**
* Everytime a module is associated, ready, connected, disconnected, removed or
* deleted the kernels emits a signal and here we look how to behave.
*
* \param event the event that should be handled here.
*/
virtual bool event( QEvent* event );
/**
* Determines compatible prototypes
* \return list of modules without possible input connectors
*/
WQtCombinerToolbar* createCompatibleButtons( boost::shared_ptr< WModule >module );
/**
* This event is called every 'timerID' in ms. If the WQtNetworkItems don't
* move as result of the calculated forces the timer won't be reseted.
*
* \param event the timer event
*/
void timerEvent( QTimerEvent *event );
void timerEvent( QTimerEvent* event );
private:
......
......@@ -40,7 +40,7 @@ class WQtNetworkArrow;
*/
class WQtNetworkInputPort : public WQtNetworkPort
{
public:
public:
/**
* Constructor
......@@ -92,7 +92,7 @@ class WQtNetworkInputPort : public WQtNetworkPort
* \param portNumber the number of the current port (distinguised by in-
* and outport
* \param rect the rect of the parent item
* \param inOut is it an in- or outport
* \param outPort is it an in- or outport
*/
void alignPosition( int size, int portNumber, QRectF rect, bool outPort );
......@@ -134,8 +134,10 @@ class WQtNetworkInputPort : public WQtNetworkPort
/**
* Adds an arrow to the port
*
* \param arrow the arrow to add
*/
void addArrow( WQtNetworkArrow *arrow );
void addArrow( WQtNetworkArrow* arrow );
/**
* Get a QList of all arrows connected to this port
......@@ -143,7 +145,7 @@ class WQtNetworkInputPort : public WQtNetworkPort
*/
QList< WQtNetworkArrow *> getArrowList();
private:
private:
bool m_isOutPort; //!< is the port an outport
......
......@@ -43,11 +43,14 @@ class QGraphicsWidget;
*/
class WQtNetworkItem : public QGraphicsRectItem
{
public:
public:
/**
* Constructor of the item.
* Constructs new item in the network scene.
*
* \param editor the editor containing this item
* \param module the module represented by the item
*/
explicit WQtNetworkItem( WQtNetworkEditor *editor, boost::shared_ptr< WModule > module );
WQtNetworkItem( WQtNetworkEditor *editor, boost::shared_ptr< WModule > module );
/**
* Destructor.
......@@ -70,25 +73,29 @@ class WQtNetworkItem : public QGraphicsRectItem
/**
* Add a port to the item.
*
* \param inPort the input port
*/
void addInputPort( WQtNetworkInputPort *inPort );
void addInputPort( WQtNetworkInputPort* inPort );
/**
* Add a port to the item.
*
* \param outPort the output port
*/
void addOutputPort( WQtNetworkOutputPort *outPort );
void addOutputPort( WQtNetworkOutputPort* outPort );
/**
* Returns the item inports.
* \return the item inports
*/
QList< WQtNetworkInputPort *> getInPorts();
QList< WQtNetworkInputPort* > getInPorts();
/**
* Returns the item outports
* \return the item outports
*/
QList< WQtNetworkOutputPort *> getOutPorts();
QList< WQtNetworkOutputPort* > getOutPorts();
/**
* This method aligns the in- and outports as well as the modulename
......@@ -101,7 +108,7 @@ class WQtNetworkItem : public QGraphicsRectItem
*
* \param text the caption
*/
void setTextItem( QGraphicsTextItem *text );
void setTextItem( QGraphicsTextItem* text );
/**
* Get the caption as QString
......@@ -136,7 +143,7 @@ class WQtNetworkItem : public QGraphicsRectItem
*/
bool advance();
protected:
protected:
/**
* If the item is changed we want to get notified.
......@@ -145,7 +152,7 @@ class WQtNetworkItem : public QGraphicsRectItem
* \param value
* \return
*/
QVariant itemChange( GraphicsItemChange change, const QVariant &value );
QVariant itemChange( GraphicsItemChange change, const QVariant& value );
/**
* If the WQtNetworkItem is moved, then the contained ports have to update
......@@ -153,21 +160,21 @@ class WQtNetworkItem : public QGraphicsRectItem
*
* \param mouseEvent the mouse event
*/
void mouseMoveEvent( QGraphicsSceneMouseEvent *mouseEvent );
void mouseMoveEvent( QGraphicsSceneMouseEvent* mouseEvent );
/**
* If the cursor enters the item, the item gets a green color.
*
* \param event the hover event
*/
void hoverEnterEvent( QGraphicsSceneHoverEvent *event );
void hoverEnterEvent( QGraphicsSceneHoverEvent* event );
/**
* If the cursor leaves the item, the item gets his default color.
*
* \param event the hover event
*/
void hoverLeaveEvent( QGraphicsSceneHoverEvent *event );
void hoverLeaveEvent( QGraphicsSceneHoverEvent* event );
/**
* This method changes the coloration of gradient.
......@@ -186,13 +193,13 @@ class WQtNetworkItem : public QGraphicsRectItem
void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* w );
private:
private:
boost::shared_ptr< WModule > m_module; //!< the module
QList< WQtNetworkInputPort *> m_inPorts; //!< the input ports of the item
QList< WQtNetworkInputPort* > m_inPorts; //!< the input ports of the item
QList< WQtNetworkOutputPort *> m_outPorts; //!< the output ports of the item
QList< WQtNetworkOutputPort* > m_outPorts; //!< the output ports of the item
QLinearGradient m_gradient; //!< the gradient for a nice coloring of the item
......@@ -204,10 +211,10 @@ class WQtNetworkItem : public QGraphicsRectItem
float m_height; //!< the height of the rect
QGraphicsTextItem *m_text; //!< the caption
QGraphicsTextItem* m_text; //!< the caption
QPointF m_newPos; //!< the new position in the WQtNetworkScene
WQtNetworkEditor *m_networkEditor; //!< the related WQtNetworkEditor
WQtNetworkEditor* m_networkEditor; //!< the related WQtNetworkEditor
};
#endif // WQTNETWORKITEM_H
......@@ -40,7 +40,7 @@ class WQtNetworkArrow;
*/
class WQtNetworkOutputPort : public WQtNetworkPort
{
public:
public:
/**
* Constructor
......@@ -93,7 +93,7 @@ class WQtNetworkOutputPort : public WQtNetworkPort
* \param portNumber the number of the current port (distinguised by in-
* and outport
* \param rect the rect of the parent item
* \param inOut is it an in- or outport
* \param outPort is it an in- or outport
*/
void alignPosition( int size, int portNumber, QRectF rect, bool outPort );
......@@ -136,6 +136,8 @@ class WQtNetworkOutputPort : public WQtNetworkPort
/**
* Adds an arrow to the port
*
* \param arrow the arrow to add
*/
void addArrow( WQtNetworkArrow *arrow );
......@@ -145,7 +147,7 @@ class WQtNetworkOutputPort : public WQtNetworkPort
*/
QList< WQtNetworkArrow *> getArrowList();
private:
private:
bool m_isOutPort; //!< is the port an outport
......
......@@ -41,7 +41,7 @@
*/
class WQtNetworkPort : public QGraphicsRectItem
{
public:
public:
WQtNetworkPort();
......@@ -115,17 +115,19 @@ class WQtNetworkPort : public QGraphicsRectItem
/**
* Adds an arrow to the port
*
* \param arrow the arrow to add
*/
virtual void addArrow( WQtNetworkArrow *arrow ) = 0;
virtual void addArrow( WQtNetworkArrow* arrow ) = 0;
/**
* Get a QList of all arrows connected to this port
*
* \return a QList of WQtNetworkArrows
*/
virtual QList< WQtNetworkArrow *> getArrowList() = 0;
virtual QList< WQtNetworkArrow* > getArrowList() = 0;
protected:
protected:
/**
* Start drawing an arrow temporary.
......@@ -151,8 +153,8 @@ class WQtNetworkPort : public QGraphicsRectItem
*/
void mouseReleaseEvent( QGraphicsSceneMouseEvent *mouseEvent );
private:
private:
QGraphicsLineItem *line; //!< the temporary line when u connect two ports
QGraphicsLineItem *line; //!< the temporary line when you connect two ports
};
#endif // WQTNETWORKPORT_H
......@@ -28,11 +28,14 @@
#include <QtGui/QGraphicsScene>
#include <QtGui/QGraphicsItem>
class WQtNetworkScene : public QGraphicsScene
/**
* The scene containing the whole graph
*/
class WQtNetworkScene: public QGraphicsScene
{
Q_OBJECT
Q_OBJECT
public:
public:
/**
* Constructor
......@@ -48,9 +51,9 @@ class WQtNetworkScene : public QGraphicsScene
* Set a fakeitem to the scene to avoid that groups of connected items
* or single items in the scene push away each other.
*
* \param the fakeitem
* \param fake the fake item
*/
void setFakeItem( QGraphicsItem *fake );
void setFakeItem( QGraphicsItem* fake );
/**
* Return the fakeitem in the scene to calculate forces in a more
......@@ -58,21 +61,25 @@ class WQtNetworkScene : public QGraphicsScene
*/
QGraphicsItem* getFakeItem();
protected:
protected:
/**
* Emits a Signal to notify the WQtNetworkEditor to build a default WQtCombinerToolbar
*
* \param mouseEvent the mouse event
*/
void mousePressEvent( QGraphicsSceneMouseEvent *mouseEvent );
void mousePressEvent( QGraphicsSceneMouseEvent* mouseEvent );
/**
* Controls how to respond on key events.
* Current it only delets selected items.
*
* \param keyEvent the key press event
*/
void keyPressEvent( QKeyEvent *keyEvent );
private:
void keyPressEvent( QKeyEvent* keyEvent );
private:
QGraphicsItem *m_fakeItem; //!< the fakeitem for the forcebased layout
};
#endif // WQTNETWORKSCENE_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment