feat: Add measure resume logic
This commit is contained in:
@@ -107,11 +107,6 @@ void ActorDraggableInteractorStyle::OnLeftButtonDown() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (measure) {
|
|
||||||
measure->SetPlacing(measure->onMeasureLeftButtonDown(this->Interactor));
|
|
||||||
if (this->State != VTKIS_MEASURE) this->StartMeasure();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scalarProp) {
|
if (scalarProp) {
|
||||||
ScalarStartPosition[0] = x;
|
ScalarStartPosition[0] = x;
|
||||||
@@ -119,6 +114,13 @@ void ActorDraggableInteractorStyle::OnLeftButtonDown() {
|
|||||||
this->StartColorMapping();
|
this->StartColorMapping();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this->InteractionMode == VTKIS_MEASURE){
|
||||||
|
if (measure) {
|
||||||
|
measure->SetPlacing(measure->onMeasureLeftButtonDown(this->Interactor));
|
||||||
|
if (this->State != VTKIS_MEASURE) this->StartMeasure();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this->InteractionMode == VTKIS_IMAGE_WINDOWLEVEL) {
|
if (this->InteractionMode == VTKIS_IMAGE_WINDOWLEVEL) {
|
||||||
this->WindowLevelStartPosition[0] = x;
|
this->WindowLevelStartPosition[0] = x;
|
||||||
this->WindowLevelStartPosition[1] = y;
|
this->WindowLevelStartPosition[1] = y;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#define VTKIS_MEASURE 36
|
#define VTKIS_MEASURE 36
|
||||||
#define VTKIS_COLORMAP 37
|
#define VTKIS_COLORMAP 37
|
||||||
#define VTKIS_SYNCPOINT 38
|
#define VTKIS_SYNCPOINT 38
|
||||||
|
#define VTKIS_VOLUMEMEASURE 39
|
||||||
#define VTKIS_IMAGE_PAN 5
|
#define VTKIS_IMAGE_PAN 5
|
||||||
#define VTKIS_IMAGE_ZOOM 6
|
#define VTKIS_IMAGE_ZOOM 6
|
||||||
#define VTKIS_IMAGE_WINDOWLEVEL 7
|
#define VTKIS_IMAGE_WINDOWLEVEL 7
|
||||||
|
|||||||
@@ -546,6 +546,18 @@ void ImageViewManager::clearCurrentView() {
|
|||||||
|
|
||||||
void ImageViewManager::reloadCurrentView(DicomImageView * view){
|
void ImageViewManager::reloadCurrentView(DicomImageView * view){
|
||||||
renderReferenceLine();
|
renderReferenceLine();
|
||||||
|
if (view && getFirstView())
|
||||||
|
{
|
||||||
|
if (view->getImageViewer()){
|
||||||
|
view->getImageViewer()->GetInteractorStyle()->SetInteractionModeFromEnum(
|
||||||
|
getFirstView()->getImageViewer()->GetInteractorStyle()->GetInteractionMode()
|
||||||
|
);
|
||||||
|
if(getFirstView()->getImageViewer()->GetInteractorStyle()->GetInteractionMode() == VTKIS_MEASURE)
|
||||||
|
{
|
||||||
|
MeasureHelper::setMeasureType(MeasureHelper::getMeasureType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
emit currentViewReloaded(view);
|
emit currentViewReloaded(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -463,15 +463,6 @@ void DefaultToolBar::initMeasureButton() {
|
|||||||
tr("Round"),
|
tr("Round"),
|
||||||
tr("Text")};
|
tr("Text")};
|
||||||
|
|
||||||
#define ADD_MEASURE_ACTION(index)\
|
|
||||||
m->addAction(measures[index], this, [=] {\
|
|
||||||
mBtnMeasure->setChecked(true);\
|
|
||||||
QPixmap map(std::get<0>(MEASURE_ACTIIONS[index]));\
|
|
||||||
mBtnMeasure->setIcon(QIcon(map));\
|
|
||||||
MeasureHelper::setMeasureType(std::get<1>(MEASURE_ACTIIONS[index]));\
|
|
||||||
mBtnMeasure->setProperty("mode",0);\
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
#define ADD_DEL_ACTION(text, type)\
|
#define ADD_DEL_ACTION(text, type)\
|
||||||
m->addAction(text,this,[]{\
|
m->addAction(text,this,[]{\
|
||||||
@@ -487,6 +478,7 @@ void DefaultToolBar::initMeasureButton() {
|
|||||||
emit modeChanged(38);
|
emit modeChanged(38);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
emit modeChanged(36);
|
||||||
MeasureHelper::setMeasureType(MeasureHelper::getMeasureType());
|
MeasureHelper::setMeasureType(MeasureHelper::getMeasureType());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -495,7 +487,14 @@ void DefaultToolBar::initMeasureButton() {
|
|||||||
m = new QMenu(this);
|
m = new QMenu(this);
|
||||||
|
|
||||||
for (int j = 0; j < ACTION_COUNT-1; ++j) {
|
for (int j = 0; j < ACTION_COUNT-1; ++j) {
|
||||||
ADD_MEASURE_ACTION(j);
|
m->addAction(measures[j], this, [=] {
|
||||||
|
mBtnMeasure->setChecked(true);
|
||||||
|
QPixmap map(std::get<0>(MEASURE_ACTIIONS[j]));
|
||||||
|
mBtnMeasure->setIcon(QIcon(map));
|
||||||
|
emit modeChanged(36);
|
||||||
|
MeasureHelper::setMeasureType(std::get<1>(MEASURE_ACTIIONS[j]));
|
||||||
|
mBtnMeasure->setProperty("mode",0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
m->addAction(tr("Location Point"), this,[=](){
|
m->addAction(tr("Location Point"), this,[=](){
|
||||||
|
|||||||
Reference in New Issue
Block a user