===========================================================================**/
#include <QFileDialog>
+#include <QShortcut>
// vv
#include "vvToolProfile.h"
{
// GUI Initialization
Ui_vvToolProfile::setupUi(mToolWidget);
+
+ QShortcut *shortcutPoint1 = new QShortcut(QKeySequence("Ctrl+1"), parent);
+ shortcutPoint1->setContext(Qt::ApplicationShortcut);
+ QObject::connect(shortcutPoint1, SIGNAL(activated()), this, SLOT(selectPoint1()));
+ QShortcut *shortcutPoint2 = new QShortcut(QKeySequence("Ctrl+2"), parent);
+ shortcutPoint2->setContext(Qt::ApplicationShortcut);
+ QObject::connect(shortcutPoint2, SIGNAL(activated()), this, SLOT(selectPoint2()));
// Connect signals & slots
connect(mSelectPoint1Button, SIGNAL(clicked()), this, SLOT(selectPoint1()));
//------------------------------------------------------------------------------
vvToolProfile::~vvToolProfile()
{
- connect(mCurrentSlicerManager, SIGNAL(callAddLandmark(float,float,float,float)), mCurrentSlicerManager, SLOT(AddLandmark(float,float,float,float)));
+ delete [] mPoint1;
+ delete [] mPoint2;
}
//------------------------------------------------------------------------------
if (mCurrentSlicerManager)
mCurrentSlicerManager->Render();
-
- delete [] mPoint1;
- delete [] mPoint2;
}
//------------------------------------------------------------------------------
bool vvToolProfile::close()
{
//RemoveVTKObjects();
+
+ connect(mCurrentSlicerManager, SIGNAL(callAddLandmark(float,float,float,float)), mCurrentSlicerManager, SLOT(AddLandmark(float,float,float,float)));
return vvToolWidgetBase::close();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolProfile::apply()
{
- reject();
+ close();
}
//------------------------------------------------------------------------------
for (int j=0; j<6; ++j) {
extent[j] = mCurrentSlicerManager->GetSlicer(slicer)->GetExtent()[j];
}
- extent[2*mCurrentSlicerManager->GetSlicer(slicer)->GetOrientation()] = mCurrentSlicerManager->GetSlicer(slicer)->GetSlice();
- extent[2*mCurrentSlicerManager->GetSlicer(slicer)->GetOrientation()+1] = mCurrentSlicerManager->GetSlicer(slicer)->GetSlice();
+ extent[2*mCurrentSlicerManager->GetSlicer(slicer)->GetOrientation()] = mCurrentSlicerManager->GetSlicer(slicer)->GetImageActor()->GetBounds()[ mCurrentSlicerManager->GetSlicer(slicer)->GetOrientation()*2 ]-fabs(mCurrentSlicerManager->GetSlicer(slicer)->GetInput()->GetSpacing()[mCurrentSlicerManager->GetSlicer(slicer)->GetOrientation()]);
+ extent[2*mCurrentSlicerManager->GetSlicer(slicer)->GetOrientation()+1] = mCurrentSlicerManager->GetSlicer(slicer)->GetImageActor()->GetBounds()[ mCurrentSlicerManager->GetSlicer(slicer)->GetOrientation()*2+1 ]+fabs(mCurrentSlicerManager->GetSlicer(slicer)->GetInput()->GetSpacing()[mCurrentSlicerManager->GetSlicer(slicer)->GetOrientation()]);
clippingBox->SetBounds(extent);
+
vtkSmartPointer<vtkClipPolyData> clipper = vtkSmartPointer<vtkClipPolyData>::New();
clipper->SetClipFunction(clippingBox);
#if VTK_MAJOR_VERSION <= 5