|
@@ -33,6 +33,7 @@
|
|
|
#include "ctkTransferFunctionRepresentation.h"
|
|
|
#include "ctkTransferFunctionScene.h"
|
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
class ctkTransferFunctionGradientItemPrivate:public ctkPrivate<ctkTransferFunctionGradientItem>
|
|
|
{
|
|
|
public:
|
|
@@ -40,6 +41,7 @@ public:
|
|
|
bool Mask;
|
|
|
};
|
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
ctkTransferFunctionGradientItemPrivate::ctkTransferFunctionGradientItemPrivate()
|
|
|
{
|
|
|
this->Mask = true;
|
|
@@ -70,6 +72,10 @@ void ctkTransferFunctionGradientItem::paint(
|
|
|
Q_UNUSED(option);
|
|
|
Q_UNUSED(widget);
|
|
|
|
|
|
+ if (this->transferFunction()->count() <= 0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
//ctkTransferFunctionScene* tfScene = dynamic_cast<ctkTransferFunctionScene*>(this->scene());
|
|
|
//Q_ASSERT(tfScene);
|
|
|
ctkTransferFunctionRepresentation* tfRep = this->transferFunction()->representation();
|
|
@@ -78,8 +84,7 @@ void ctkTransferFunctionGradientItem::paint(
|
|
|
|
|
|
if ( this->mask() )
|
|
|
{
|
|
|
- const QPainterPath& curve = tfScene->curve();
|
|
|
- QPainterPath closedPath = curve;
|
|
|
+ QPainterPath closedPath = tfRep->curve();
|
|
|
QRectF position = this->rect();
|
|
|
// link to last point
|
|
|
closedPath.lineTo(position.x() + position.width(), position.y() + position.height());
|