CustusX  18.04
An IGT application
cx::TransferFunctionColorWidget Class Reference

#include <cxTransferFunctionColorWidget.h>

Inheritance diagram for cx::TransferFunctionColorWidget:
cx::BaseWidget cx::OptimizedUpdateWidget

Classes

struct  ColorPoint
 Internal placeholder for a color point. More...
 

Public Slots

void activeImageTransferFunctionsChangedSlot ()
 Acts when the image's transfer function is changed. More...
 
- Public Slots inherited from cx::BaseWidget
void adjustSizeSlot ()
 
- Public Slots inherited from cx::OptimizedUpdateWidget
virtual void setModified ()
 

Public Member Functions

 TransferFunctionColorWidget (ActiveDataPtr activeData, QWidget *parent)
 
virtual ~TransferFunctionColorWidget ()
 
void setData (ImagePtr image, ImageTFDataPtr tfData)
 
- Public Member Functions inherited from cx::BaseWidget
 BaseWidget (QWidget *parent, QString objectName, QString windowTitle)
 
virtual ~BaseWidget ()
 
QWidget * createMethodWidget (QWidget *inputWidget, QWidget *outputWidget, QString methodname, bool inputChecked=false, bool outputVisible=true)
 Create a specialized widget for filters, with input/ouput, enable and options. More...
 
QGroupBox * createGroupbox (QWidget *widget, QString boxname)
 Create a group box with a given name. More...
 
QGroupBox * wrapInGroupBox (QWidget *base, QString name)
 
CXFramewrapInFrame (QWidget *base)
 
QAction * createAction2 (QObject *parent, QIcon iconName, QString text, QString tip, QLayout *layout=NULL, QToolButton *button=new QToolButton())
 
template<class T >
QAction * createAction (QObject *parent, QIcon iconName, QString text, QString tip, T slot, QLayout *layout=NULL, QToolButton *button=new QToolButton())
 
- Public Member Functions inherited from cx::OptimizedUpdateWidget
 OptimizedUpdateWidget (QWidget *parent=NULL)
 
virtual ~OptimizedUpdateWidget ()
 
void forcePrePaint ()
 

Protected Slots

void removeColorSlot ()
 
void setColorSlot ()
 
void setColorSlotDelayed ()
 

Protected Member Functions

ColorPoint selectPoint (QPoint pos) const
 
std::pair< int, int > findAllowedMoveRangeAroundColorPoint (int selectedPointIntensity)
 
void paintColorPointsAndGenerateCache (QPainter &painter)
 
void paintColorBar (QPainter &painter)
 
void updateTooltip (QPoint pos)
 
void updateTooltip (ColorPoint point)
 
bool isEndpoint (int intensity) const
 
void contextMenuEvent (QContextMenuEvent *event)
 Decides what happens when you rightclick in a view. More...
 
QPoint getPlotPoint (int iScalar)
 Calculate the screen point of a given scalar (x-axis) and value (y-axis) More...
 
ColorPoint getCurrentColorPoint ()
 Calculate the color point (position and color) based on clicked x coordinate. More...
 
ColorPoint getCurrentColorPoint (int clickX)
 
void moveSelectedPointTo (ColorPoint newPoint)
 
virtual void enterEvent (QEvent *event)
 
virtual void leaveEvent (QEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 Reimplemented from superclass. More...
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 Reimplemented from superclass. More...
 
virtual void mouseMoveEvent (QMouseEvent *event)
 Reimplemented from superclass. More...
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void resizeEvent (QResizeEvent *evt)
 Reimplemented from superclass. More...
 
virtual void paintEvent (QPaintEvent *event)
 Reimplemented from superclass. Paints the transferfunction GUI. More...
 
virtual QSize sizeHint () const
 
int screenX2imageIntensity (int screenX)
 Define a recommended size. More...
 
int imageIntensity2screenX (int intensity)
 
- Protected Member Functions inherited from cx::BaseWidget
virtual void showEvent (QShowEvent *event)
 
- Protected Member Functions inherited from cx::OptimizedUpdateWidget
virtual void prePaintEvent ()
 

Protected Attributes

QAction * mCustomColorAction
 Action for choosing custom color. More...
 
QAction * mRemoveColorAction
 Action for removing a color. More...
 
QRect mFullArea
 The full widget area. More...
 
QRect mPlotArea
 The plot area. More...
 
int mBorder
 The size of the border around the transferfunction. The size of the rectangles are mBorder * 2. More...
 
std::map< int, QRect > mPointRects
 Cache with all point rectangles. More...
 
ColorPoint mSelectedPoint
 The currently selected point. More...
 
QPoint mCurrentClickPos
 
ImagePtr mImage
 
ImageTFDataPtr mImageTF
 
ActiveImageProxyPtr mActiveImageProxy
 

Additional Inherited Members

- Static Public Member Functions inherited from cx::BaseWidget
static QFrame * createHorizontalLine ()
 Creates a horizontal line which can be inserted into widgets. More...
 

Detailed Description

Date
Apr 01, 2009 \author Ole Vegard Solberg, SINTEF

Definition at line 37 of file cxTransferFunctionColorWidget.h.

Constructor & Destructor Documentation

cx::TransferFunctionColorWidget::TransferFunctionColorWidget ( ActiveDataPtr  activeData,
QWidget *  parent 
)

Definition at line 36 of file cxTransferFunctionColorWidget.cpp.

cx::TransferFunctionColorWidget::~TransferFunctionColorWidget ( )
virtual

Definition at line 56 of file cxTransferFunctionColorWidget.cpp.

Member Function Documentation

void cx::TransferFunctionColorWidget::activeImageTransferFunctionsChangedSlot ( )
slot

Acts when the image's transfer function is changed.

Definition at line 80 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::contextMenuEvent ( QContextMenuEvent *  event)
protected

Decides what happens when you rightclick in a view.

Definition at line 291 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::enterEvent ( QEvent *  event)
protectedvirtual

Definition at line 59 of file cxTransferFunctionColorWidget.cpp.

std::pair< int, int > cx::TransferFunctionColorWidget::findAllowedMoveRangeAroundColorPoint ( int  selectedPointIntensity)
protected

Definition at line 364 of file cxTransferFunctionColorWidget.cpp.

TransferFunctionColorWidget::ColorPoint cx::TransferFunctionColorWidget::getCurrentColorPoint ( )
protected

Calculate the color point (position and color) based on clicked x coordinate.

Definition at line 308 of file cxTransferFunctionColorWidget.cpp.

TransferFunctionColorWidget::ColorPoint cx::TransferFunctionColorWidget::getCurrentColorPoint ( int  clickX)
protected

Definition at line 313 of file cxTransferFunctionColorWidget.cpp.

QPoint cx::TransferFunctionColorWidget::getPlotPoint ( int  iScalar)
protected

Calculate the screen point of a given scalar (x-axis) and value (y-axis)

int cx::TransferFunctionColorWidget::imageIntensity2screenX ( int  intensity)
protected

Definition at line 161 of file cxTransferFunctionColorWidget.cpp.

bool cx::TransferFunctionColorWidget::isEndpoint ( int  intensity) const
protected

Definition at line 282 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Definition at line 138 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::leaveEvent ( QEvent *  event)
protectedvirtual

Definition at line 64 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

Reimplemented from superclass.

Definition at line 104 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Reimplemented from superclass.

Definition at line 85 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::mouseReleaseEvent ( QMouseEvent *  event)
protectedvirtual

Reimplemented from superclass.

Definition at line 97 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::moveSelectedPointTo ( ColorPoint  newPoint)
protected

Definition at line 348 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::paintColorBar ( QPainter &  painter)
protected

Definition at line 195 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::paintColorPointsAndGenerateCache ( QPainter &  painter)
protected

Definition at line 224 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::paintEvent ( QPaintEvent *  event)
protectedvirtual

Reimplemented from superclass. Paints the transferfunction GUI.

Reimplemented from cx::OptimizedUpdateWidget.

Definition at line 178 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::removeColorSlot ( )
protectedslot

Definition at line 409 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::resizeEvent ( QResizeEvent *  evt)
protectedvirtual

Reimplemented from superclass.

Definition at line 254 of file cxTransferFunctionColorWidget.cpp.

int cx::TransferFunctionColorWidget::screenX2imageIntensity ( int  screenX)
protected

Define a recommended size.

Calculate the correct position within the color transfer function, based on a screen x coordinate

Definition at line 171 of file cxTransferFunctionColorWidget.cpp.

TransferFunctionColorWidget::ColorPoint cx::TransferFunctionColorWidget::selectPoint ( QPoint  pos) const
protected

Definition at line 264 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::setColorSlot ( )
protectedslot

Definition at line 388 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::setColorSlotDelayed ( )
protectedslot

Definition at line 394 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::setData ( ImagePtr  image,
ImageTFDataPtr  tfData 
)

Definition at line 70 of file cxTransferFunctionColorWidget.cpp.

virtual QSize cx::TransferFunctionColorWidget::sizeHint ( ) const
inlineprotectedvirtual

Definition at line 117 of file cxTransferFunctionColorWidget.h.

void cx::TransferFunctionColorWidget::updateTooltip ( QPoint  pos)
protected

Definition at line 119 of file cxTransferFunctionColorWidget.cpp.

void cx::TransferFunctionColorWidget::updateTooltip ( ColorPoint  point)
protected

Definition at line 128 of file cxTransferFunctionColorWidget.cpp.

Member Data Documentation

ActiveImageProxyPtr cx::TransferFunctionColorWidget::mActiveImageProxy
protected

Definition at line 95 of file cxTransferFunctionColorWidget.h.

int cx::TransferFunctionColorWidget::mBorder
protected

The size of the border around the transferfunction. The size of the rectangles are mBorder * 2.

Definition at line 79 of file cxTransferFunctionColorWidget.h.

QPoint cx::TransferFunctionColorWidget::mCurrentClickPos
protected

Definition at line 84 of file cxTransferFunctionColorWidget.h.

QAction* cx::TransferFunctionColorWidget::mCustomColorAction
protected

Action for choosing custom color.

Definition at line 74 of file cxTransferFunctionColorWidget.h.

QRect cx::TransferFunctionColorWidget::mFullArea
protected

The full widget area.

Definition at line 77 of file cxTransferFunctionColorWidget.h.

ImagePtr cx::TransferFunctionColorWidget::mImage
protected

Definition at line 93 of file cxTransferFunctionColorWidget.h.

ImageTFDataPtr cx::TransferFunctionColorWidget::mImageTF
protected

Definition at line 94 of file cxTransferFunctionColorWidget.h.

QRect cx::TransferFunctionColorWidget::mPlotArea
protected

The plot area.

Definition at line 78 of file cxTransferFunctionColorWidget.h.

std::map<int, QRect> cx::TransferFunctionColorWidget::mPointRects
protected

Cache with all point rectangles.

Definition at line 81 of file cxTransferFunctionColorWidget.h.

QAction* cx::TransferFunctionColorWidget::mRemoveColorAction
protected

Action for removing a color.

Definition at line 75 of file cxTransferFunctionColorWidget.h.

ColorPoint cx::TransferFunctionColorWidget::mSelectedPoint
protected

The currently selected point.

Definition at line 82 of file cxTransferFunctionColorWidget.h.


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