Commit fccda6e5 authored by Tobias Neeb's avatar Tobias Neeb
Browse files

[ADD #736] update methods to work with triangular points and resizePoints-enum

parent aecf0790
......@@ -31,7 +31,7 @@
#include "WTransferFunction2DBoxWidget.h"
#include "WTransferFunction2DScene.h"
WTransferFunction2DControlPoint::WTransferFunction2DControlPoint( BaseClass *parent, QPointF position, ResizePointsRect handleLocation )
WTransferFunction2DControlPoint::WTransferFunction2DControlPoint( BaseClass *parent, QPointF position, ResizePoints handleLocation )
{
m_parent = parent;
m_position = position;
......@@ -124,6 +124,15 @@ void WTransferFunction2DControlPoint::mouseMoveEvent( QGraphicsSceneMouseEvent *
case TOPLEFT:
emit( resizeHandleChanged( TOPLEFT, this->pos() ) );
break;
case LEFT_TRI:
emit( resizeHandleChanged( LEFT_TRI, this->pos() ) );
break;
case MID_TRI:
emit( resizeHandleChanged( MID_TRI, this->pos() ) );
break;
case RIGHT_TRI:
emit( resizeHandleChanged( RIGHT_TRI, this->pos() ) );
break;
default:
break;
}
......@@ -145,6 +154,9 @@ void WTransferFunction2DControlPoint::hoverEnterEvent( QGraphicsSceneHoverEvent
{
case TOPRIGHT:
case BOTTOMLEFT:
case LEFT_TRI:
case RIGHT_TRI:
case MID_TRI:
QGraphicsItem::setCursor( QCursor( Qt::SizeBDiagCursor ) );
break;
case BOTTOMRIGHT:
......
......@@ -47,7 +47,7 @@ public:
* @param position the coordinate where the control point should be placed
* @param handleLocation the location of the handle e.g. top left
*/
explicit WTransferFunction2DControlPoint( BaseClass *parent, QPointF position, ResizePointsRect handleLocation );
explicit WTransferFunction2DControlPoint( BaseClass *parent, QPointF position, ResizePoints handleLocation );
/**
* Destructor
......@@ -129,13 +129,13 @@ signals:
* @param location the handler e.g. top left
* @param position position of the handler to resize the box
* */
void resizeHandleChanged( ResizePointsRect location, QPointF position );
void resizeHandleChanged( ResizePoints location, QPointF position );
private:
BaseClass *m_parent; /*!< parent of this graphicsobject */
QPointF m_position; /*!< position of this graphicsobject */
double m_radius; /*!< radius of this graphicsobject */
ResizePointsRect m_handleLocation; /*!< Type of resize handler, which is currently selected */
ResizePoints m_handleLocation; /*!< Type of resize handler, which is currently selected */
bool m_pressed; /*!< Flag to check if mouse button is pressed */
};
......
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