3131
3232// VTK includes
3333#include < vtkAxis.h>
34+ #include < vtkChart.h>
3435#include < vtkChartXY.h>
3536#include < vtkColorTransferControlPointsItem.h>
3637#include < vtkColorTransferFunction.h>
@@ -333,14 +334,15 @@ void ctkVTKScalarsToColorsWidget::setCurrentControlPointsItem(vtkControlPointsIt
333334 }
334335 this ->qvtkReconnect (d->CurrentControlPointsItem , item, vtkCommand::ModifiedEvent,
335336 this , SLOT (updateCurrentPoint ()));
337+ vtkChart* chart = d->View ->abstractChart ();
336338 this ->qvtkReconnect (d->CurrentControlPointsItem ?
337- d->CurrentControlPointsItem ->GetXAxis () : d-> View -> chart () ->GetAxis (0 ),
338- item ? item->GetXAxis () : d-> View -> chart () ->GetAxis (0 ),
339+ d->CurrentControlPointsItem ->GetXAxis () : chart->GetAxis (0 ),
340+ item ? item->GetXAxis () : chart->GetAxis (0 ),
339341 vtkCommand::ModifiedEvent,
340342 this , SLOT (onAxesModified ()));
341343 this ->qvtkReconnect (d->CurrentControlPointsItem ?
342- d->CurrentControlPointsItem ->GetYAxis () : d-> View -> chart () ->GetAxis (1 ),
343- item ? item->GetYAxis () : d-> View -> chart () ->GetAxis (1 ),
344+ d->CurrentControlPointsItem ->GetYAxis () : chart->GetAxis (1 ),
345+ item ? item->GetYAxis () : chart->GetAxis (1 ),
344346 vtkCommand::ModifiedEvent,
345347 this , SLOT (onAxesModified ()));
346348 d->CurrentControlPointsItem = item;
@@ -420,7 +422,7 @@ void ctkVTKScalarsToColorsWidget::updateCurrentPoint()
420422 d->CurrentControlPointsItem ->GetControlPoint (pointId, point);
421423
422424 vtkAxis* xAxis = d->CurrentControlPointsItem ?
423- d->CurrentControlPointsItem ->GetXAxis () : d->View ->chart ()->GetAxis (vtkAxis::BOTTOM);
425+ d->CurrentControlPointsItem ->GetXAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::BOTTOM);
424426 Q_ASSERT (xAxis);
425427 if (xAxis && (xAxis->GetMinimumLimit () > point[0 ] || xAxis->GetMaximumLimit () < point[0 ]))
426428 {
@@ -544,7 +546,7 @@ void ctkVTKScalarsToColorsWidget::xRange(double* range)const
544546{
545547 Q_D (const ctkVTKScalarsToColorsWidget);
546548 vtkAxis* xAxis = d->CurrentControlPointsItem ?
547- d->CurrentControlPointsItem ->GetXAxis () : d->View ->chart ()->GetAxis (vtkAxis::BOTTOM);
549+ d->CurrentControlPointsItem ->GetXAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::BOTTOM);
548550 Q_ASSERT (xAxis);
549551 range[0 ] = xAxis->GetMinimum ();
550552 range[1 ] = xAxis->GetMaximum ();
@@ -555,7 +557,7 @@ void ctkVTKScalarsToColorsWidget::setXRange(double min, double max)
555557{
556558 Q_D (ctkVTKScalarsToColorsWidget);
557559 vtkAxis* xAxis = d->CurrentControlPointsItem ?
558- d->CurrentControlPointsItem ->GetXAxis () : d->View ->chart ()->GetAxis (vtkAxis::BOTTOM);
560+ d->CurrentControlPointsItem ->GetXAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::BOTTOM);
559561 Q_ASSERT (xAxis);
560562 if (xAxis->GetMinimum () != min || xAxis->GetMaximum () != max)
561563 {
@@ -570,7 +572,7 @@ void ctkVTKScalarsToColorsWidget::yRange(double* range)const
570572{
571573 Q_D (const ctkVTKScalarsToColorsWidget);
572574 vtkAxis* yAxis = d->CurrentControlPointsItem ?
573- d->CurrentControlPointsItem ->GetYAxis () : d->View ->chart ()->GetAxis (vtkAxis::LEFT);
575+ d->CurrentControlPointsItem ->GetYAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::LEFT);
574576 Q_ASSERT (yAxis);
575577 range[0 ] = yAxis->GetMinimum ();
576578 range[1 ] = yAxis->GetMaximum ();
@@ -581,7 +583,7 @@ void ctkVTKScalarsToColorsWidget::setYRange(double min, double max)
581583{
582584 Q_D (ctkVTKScalarsToColorsWidget);
583585 vtkAxis* yAxis = d->CurrentControlPointsItem ?
584- d->CurrentControlPointsItem ->GetYAxis () : d->View ->chart ()->GetAxis (vtkAxis::LEFT);
586+ d->CurrentControlPointsItem ->GetYAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::LEFT);
585587 Q_ASSERT (yAxis);
586588 if (yAxis->GetMinimum () != min || yAxis->GetMaximum () != max)
587589 {
@@ -596,14 +598,14 @@ void ctkVTKScalarsToColorsWidget::resetRange()
596598{
597599 Q_D (ctkVTKScalarsToColorsWidget);
598600 vtkAxis* xAxis = d->CurrentControlPointsItem ?
599- d->CurrentControlPointsItem ->GetXAxis () : d->View ->chart ()->GetAxis (vtkAxis::BOTTOM);
601+ d->CurrentControlPointsItem ->GetXAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::BOTTOM);
600602 if (xAxis)
601603 {
602604 this ->setXRange (xAxis->GetMinimumLimit (), xAxis->GetMaximumLimit ());
603605 }
604606
605607 vtkAxis* yAxis = d->CurrentControlPointsItem ?
606- d->CurrentControlPointsItem ->GetYAxis () : d->View ->chart ()->GetAxis (vtkAxis::LEFT);
608+ d->CurrentControlPointsItem ->GetYAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::LEFT);
607609 if (yAxis)
608610 {
609611 this ->setYRange (yAxis->GetMinimumLimit (), yAxis->GetMaximumLimit ());
@@ -615,7 +617,7 @@ void ctkVTKScalarsToColorsWidget::onAxesModified()
615617{
616618 Q_D (ctkVTKScalarsToColorsWidget);
617619 vtkAxis* xAxis = d->CurrentControlPointsItem ?
618- d->CurrentControlPointsItem ->GetXAxis () : d->View ->chart ()->GetAxis (vtkAxis::BOTTOM);
620+ d->CurrentControlPointsItem ->GetXAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::BOTTOM);
619621 Q_ASSERT (xAxis);
620622
621623 bool wasBlocking = d->XRangeSlider ->blockSignals (true );
@@ -627,7 +629,7 @@ void ctkVTKScalarsToColorsWidget::onAxesModified()
627629 d->XRangeSlider ->blockSignals (wasBlocking);
628630
629631 vtkAxis* yAxis = d->CurrentControlPointsItem ?
630- d->CurrentControlPointsItem ->GetYAxis () : d->View ->chart ()->GetAxis (vtkAxis::LEFT);
632+ d->CurrentControlPointsItem ->GetYAxis () : d->View ->abstractChart ()->GetAxis (vtkAxis::LEFT);
631633 Q_ASSERT (yAxis);
632634
633635 wasBlocking = d->YRangeSlider ->blockSignals (true );
0 commit comments