#include "QtxAction.h"
#include "QtxDblSpinBox.h"
+#include "QtxIntSpinBox.h"
using namespace std;
myEventCallbackCommand->SetClientData(this);
myEventCallbackCommand->SetCallback(VVTK_SegmentationCursorDlg::ProcessEvents);
+ myInsideCursorSettings->AddObserver(VISU::UpdateFromSettingsEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
setCaption( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) );
// Size
myInsideSizeBox = new VVTK_SizeBox( anInsideGroup );
- myInsideSizeBox->setType( VVTK_SizeBox::Results );
+ myInsideSizeBox->setType( VVTK_SizeBox::Inside );
anInsideGroupLayout->addWidget( myInsidePrimitiveBox, 0, 0 );
anInsideGroupLayout->addWidget( myInsideSizeBox, 1, 0 );
anOutsideGroupLayout->addWidget( myOutsidePrimitiveBox, 0, 0 );
anOutsideGroupLayout->addWidget( myOutsideSizeBox, 1, 0 );
- //
+
+
+ // Magnification
+ QGroupBox* MagnificationGroup = new QGroupBox ( tr( "MAGNIFICATION_TITLE" ), myGaussPointsBox, "MagnificationGroup" );
+ MagnificationGroup->setColumnLayout(0, Qt::Vertical );
+ MagnificationGroup->layout()->setSpacing( 0 );
+ MagnificationGroup->layout()->setMargin( 0 );
+
+ QGridLayout* MagnificationGroupLayout = new QGridLayout (MagnificationGroup->layout());
+ MagnificationGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ MagnificationGroupLayout->setSpacing(6);
+ MagnificationGroupLayout->setMargin(11);
+
+ myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), MagnificationGroup );
+ myMagnificationSpinBox = new QtxIntSpinBox( 1, 10000, 10, MagnificationGroup );
+ myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ MagnificationGroupLayout->addWidget( myMagnificationLabel, 0, 0 );
+ MagnificationGroupLayout->addWidget( myMagnificationSpinBox, 0, 1 );
+
+ // Increment
+ myIncrementLabel = new QLabel( tr( "INCREMENT" ), MagnificationGroup );
+ myIncrementSpinBox = new QtxDblSpinBox( 0.01, 10, 0.1, MagnificationGroup );
+ myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ MagnificationGroupLayout->addWidget( myIncrementLabel, 0, 2 );
+ MagnificationGroupLayout->addWidget( myIncrementSpinBox, 0, 3 );
+
+
myTabBox->addTab( myGaussPointsBox, tr( "GAUSS_POINTS_TAB" ) );
myTabBox->showPage( myGaussPointsBox );
SetWidgetCtrl(NULL);
}
+float VVTK_SegmentationCursorDlg::getMagnification() const
+{
+ return myMagnificationSpinBox->value() / 100.0;
+}
+
+void VVTK_SegmentationCursorDlg::setMagnification( float theMagnification )
+{
+ myMagnificationSpinBox->setValue( ( int )( theMagnification * 100 ) );
+}
+
+float VVTK_SegmentationCursorDlg::getIncrement() const
+{
+ return myIncrementSpinBox->value();
+}
+
+void VVTK_SegmentationCursorDlg::setIncrement( float theIncrement )
+{
+ myIncrementSpinBox->setValue( theIncrement );
+}
+
+
void VVTK_SegmentationCursorDlg::SetWidgetCtrl( VISU_WidgetCtrl* theWidgetCtrl )
{
if(myWidgetCtrl == theWidgetCtrl)
case vtkCommand::EndInteractionEvent:
self->UpdateSegmentation();
break;
+ case VISU::UpdateFromSettingsEvent:
+ self->GetOutsideCursorSettings()->SetMagnification( self->GetInsideCursorSettings()->GetMagnification() );
+ self->GetOutsideCursorSettings()->SetIncrement( self->GetInsideCursorSettings()->GetIncrement() );
+
+ self->UpdateInsideGaussPoints();
+ self->UpdateOutsideGaussPoints();
+
+ self->GetInsideCursorSettings()->InvokeEvent(VISU::UpdateInsideSettingsEvent,NULL);
+ self->GetOutsideCursorSettings()->InvokeEvent(VISU::UpdateOutsideSettingsEvent,NULL);
+ break;
}
}
myZOriginSpinBox->setValue( origin[2] );
aRadius=pSphereWidget->GetRadius();
myRadiusSpinBox->setValue(aRadius);
+ myRatioSpinBox->setValue(pSphereWidget->GetRatio());
}
}
myInsideSizeBox->setMinSize( myInsideCursorSettings->GetMinSize() );
myInsideSizeBox->setMaxSize( myInsideCursorSettings->GetMaxSize() );
- myInsideSizeBox->setMagnification( myInsideCursorSettings->GetMagnification() );
- myInsideSizeBox->setIncrement( myInsideCursorSettings->GetIncrement() );
+
+ this->setMagnification( myInsideCursorSettings->GetMagnification() );
+ this->setIncrement( myInsideCursorSettings->GetIncrement() );
return;
}
myInsideSizeBox->setMaxSize( aMaxSize / 100.0 );
aMagnification = aResourceMgr->integerValue( "VISU", "inside_point_sprite_magnification", aMagnification );
- myInsideSizeBox->setMagnification( aMagnification / 100.0 );
+ this->setMagnification( aMagnification / 100.0 );
anIncrement = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_increment", anIncrement );
- myInsideSizeBox->setIncrement( anIncrement );
+ this->setIncrement( anIncrement );
ApplyInsideGaussPoints();
}
aRadius=myRadiusSpinBox->value();
pSphereWidget->SetRadius(aRadius);
+ pSphereWidget->SetRatio(myRatioSpinBox->value());
+
myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
myWidgetCtrl->GetInteractor()->Render();
}
myInsideCursorSettings->SetMinSize( myInsideSizeBox->getMinSize() );
myInsideCursorSettings->SetMaxSize( myInsideSizeBox->getMaxSize() );
- myInsideCursorSettings->SetMagnification( myInsideSizeBox->getMagnification() );
- myInsideCursorSettings->SetIncrement( myInsideSizeBox->getIncrement() );
+
+ myInsideCursorSettings->SetMagnification( this->getMagnification() );
+ myInsideCursorSettings->SetIncrement( this->getIncrement() );
myInsideCursorSettings->InvokeEvent(VISU::UpdateInsideSettingsEvent,NULL);
}
aColor[2] = aButtonColor.blue() / 255.0;
myOutsideCursorSettings->SetColor( aColor );
+ myOutsideCursorSettings->SetMagnification( this->getMagnification() );
+ myOutsideCursorSettings->SetIncrement( this->getIncrement() );
+
myOutsideCursorSettings->InvokeEvent(VISU::UpdateOutsideSettingsEvent,NULL);
}
// Magnification
myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup );
- myMagnificationSpinBox = new QtxIntSpinBox( 10, 1000, 10, SizeGroup );
+ myMagnificationSpinBox = new QtxIntSpinBox( 1, 10000, 10, SizeGroup );
myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
SizeGroupLayout->addWidget( myMagnificationLabel, 2, 0 );
myMaxSizeLabel->show();
myMaxSizeSpinBox->show();
+ myMagnificationLabel->show();
+ myMagnificationSpinBox->show();
+
+ myIncrementLabel->show();
+ myIncrementSpinBox->show();
+
myColorGroup->hide();
+
+ myUniformCheckBox->hide();
}
void VVTK_SizeBox::onToggleGeometry()
myMaxSizeLabel->hide();
myMaxSizeSpinBox->hide();
+ myMagnificationLabel->show();
+ myMagnificationSpinBox->show();
+
+ myIncrementLabel->show();
+ myIncrementSpinBox->show();
+
myColorGroup->show();
myUniformCheckBox->hide();
}
+void VVTK_SizeBox::onToggleInside()
+{
+ myType = VVTK_SizeBox::Inside;
+
+ myOutsideSizeLabel->hide();
+ myOutsideSizeSpinBox->hide();
+
+ myGeomSizeLabel->hide();
+ myGeomSizeSpinBox->hide();
+
+ myMinSizeLabel->show();
+ myMinSizeSpinBox->show();
+
+ myMaxSizeLabel->show();
+ myMaxSizeSpinBox->show();
+
+ myMagnificationLabel->hide();
+ myMagnificationSpinBox->hide();
+
+ myIncrementLabel->hide();
+ myIncrementSpinBox->hide();
+
+ myColorGroup->hide();
+
+ myUniformCheckBox->hide();
+}
+
void VVTK_SizeBox::onToggleOutside()
{
myType = VVTK_SizeBox::Outside;
{
case VVTK_SizeBox::Results : onToggleResults(); break;
case VVTK_SizeBox::Geometry : onToggleGeometry(); break;
+ case VVTK_SizeBox::Inside : onToggleInside(); break;
case VVTK_SizeBox::Outside : onToggleOutside(); break;
default : break;
}
void VVTK_SizeBox::setOutsideSize( float theOutsideSize )
{
- myOutsideSizeSpinBox->setValue( theOutsideSize * 100.0 );
+ myOutsideSizeSpinBox->setValue( ( int )( theOutsideSize * 100 ) );
}
float VVTK_SizeBox::getGeomSize() const
void VVTK_SizeBox::setGeomSize( float theGeomSize )
{
- myGeomSizeSpinBox->setValue( theGeomSize * 100.0 );
+ myGeomSizeSpinBox->setValue( ( int )( theGeomSize * 100 ) );
}
float VVTK_SizeBox::getMinSize() const
void VVTK_SizeBox::setMinSize( float theMinSize )
{
- myMinSizeSpinBox->setValue( theMinSize * 100.0 );
+ myMinSizeSpinBox->setValue( ( int )( theMinSize * 100 ) );
}
float VVTK_SizeBox::getMaxSize() const
void VVTK_SizeBox::setMaxSize( float theMaxSize )
{
- myMaxSizeSpinBox->setValue( theMaxSize * 100.0 );
+ myMaxSizeSpinBox->setValue( ( int )( theMaxSize * 100 ) );
}
float VVTK_SizeBox::getMagnification() const
void VVTK_SizeBox::setMagnification( float theMagnification )
{
- myMagnificationSpinBox->setValue( theMagnification * 100.0 );
+ myMagnificationSpinBox->setValue( ( int )( theMagnification * 100 ) );
}
float VVTK_SizeBox::getIncrement() const