myOutlineActor->SetVisibility(false);
myCursorPyramid->SetVisibility(false);
-
- myTextActor->SetVisibility(anIsVisible);
- myCellActor->SetVisibility(anIsVisible);
- GetScalarBarCtrl()->SetIsMarked(anIsVisible);
- myCursorPyramidSelected->SetVisibility(anIsVisible);
-//GetScalarBarCtrl()->Update();
-
- myIsHighlighted = aCurrentHasIndex;
-
- // Zoom if necessary
- ChangeZoom(myPickingSettings,
- GetRenderer(),
- anInitialHasIndex,
- aCurrentHasIndex);
+ myTextActor->SetVisibility(false);
+ myCellActor->SetVisibility(false);
+ myCursorPyramidSelected->SetVisibility(false);
if(!theIsHighlight)
return;
Superclass::highlight(theIsHighlight);
return;
}
-
+
if( aSelectionMode != GaussPointSelection )
return;
if ( !aCurrentHasIndex || !myBarVisibility )
return;
+ myTextActor->SetVisibility(anIsVisible);
+ myCellActor->SetVisibility(anIsVisible && myPickingSettings->GetDisplayParentMesh());
+ GetScalarBarCtrl()->SetIsMarked(anIsVisible);
+ myCursorPyramidSelected->SetVisibility(anIsVisible);
+//GetScalarBarCtrl()->Update();
+
+ myIsHighlighted = aCurrentHasIndex;
+
+ // Zoom if necessary
+ ChangeZoom(myPickingSettings,
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
+
// TColStd_IndexedMapOfInteger aMapIndex;
mySelector->GetIndex( getIO(), aMapIndex );
if(aMapIndex.Extent() != 1 || !myBarVisibility) {
myCellActor->SetVisibility(anIsVisible && theIsHighlight);
myCellActor->SetRepresentation(VTK_WIREFRAME);
}
+ else
+ myCellActor->SetVisibility(false);
}
}
VISU_GaussPtsAct
::UpdatePickingSettings()
{
- if(!myPickingSettings || myPickingSettings->GetInitial())
+ if(!myPickingSettings)
return;
myTextActor->SetModePosition(myPickingSettings->GetInfoWindowPosition());
// $Header$
#include "VISU_GaussPtsSettings.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
#include <vtkObjectFactory.h>
#include <vtkImageData.h>
+#include "qcolor.h"
+
//----------------------------------------------------------------
vtkStandardNewMacro( VISU_GaussPtsSettings );
vtkStandardNewMacro( VISU_InsideCursorSettings );
//----------------------------------------------------------------
VISU_PickingSettings::VISU_PickingSettings()
{
- this->Initial = true;
+ float aCursorSize = 0.5;
+ float aPyramidHeight = 10.0;
+ float aPointTolerance = 0.1;
+ QColor aColor = Qt::yellow;
+ int anInfoWindowTransparency = 50;
+ int anInfoWindowPosition = VISU_PickingSettings::BelowPoint;
+ float aZoomFactor = 1.5;
+ int aStepNumber = 10;
+ bool aDisplayParentMesh = false;
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
- this->PyramidHeight = -1;
- this->CursorSize = -1;
- this->PointTolerance = -1;
- this->Color[0] = -1;
- this->Color[1] = -1;
- this->Color[2] = -1;
- this->InfoWindowTransparency = -1;
- this->InfoWindowPosition = -1;
- this->ZoomFactor = -1;
- this->StepNumber = -1;
- this->DisplayParentMesh = false;
+ this->CursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize );
+
+ this->PyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight );
+
+ this->PointTolerance = aResourceMgr->doubleValue( "VISU", "picking_point_tolerance", aPointTolerance );
+
+ aColor = aResourceMgr->colorValue( "VISU", "picking_selection_color", aColor );
+ this->Color[0] = aColor.red() / 255.0;
+ this->Color[1] = aColor.green() / 255.0;
+ this->Color[2] = aColor.blue() / 255.0;
+
+ this->InfoWindowTransparency = aResourceMgr->integerValue( "VISU", "picking_transparency", anInfoWindowTransparency ) / 100.0;
+
+ this->InfoWindowPosition = aResourceMgr->integerValue( "VISU", "picking_position", anInfoWindowPosition );
+
+ this->ZoomFactor = aResourceMgr->doubleValue( "VISU", "picking_zoom_factor", aZoomFactor );
+
+ this->StepNumber = aResourceMgr->integerValue( "VISU", "picking_step_number", aStepNumber );
+
+ this->DisplayParentMesh = aResourceMgr->booleanValue( "VISU", "picking_display_parent_mesh", aDisplayParentMesh );
}
VISU_PickingSettings::~VISU_PickingSettings()
VISU_PickingSettings*
New();
- vtkSetMacro( Initial, bool );
- vtkGetMacro( Initial, bool );
-
vtkSetMacro( PyramidHeight, vtkFloatingPointType );
vtkGetMacro( PyramidHeight, vtkFloatingPointType );
vtkGetMacro( DisplayParentMesh, bool );
private:
- bool Initial;
vtkFloatingPointType PyramidHeight;
vtkFloatingPointType CursorSize;
void VVTK_PickingDlg::Update()
{
- float aCursorSize = 0.5;
- float aPyramidHeight = 10.0;
- float aPointTolerance = 0.1;
- QColor aColor = Qt::yellow;
- int anInfoWindowTransparency = 50;
- int anInfoWindowPosition = VISU_PickingSettings::BelowPoint;
- float aZoomFactor = 1.5;
- int aStepNumber = 10;
- bool aDisplayParentMesh = false;
-
- if( !myPickingSettings->GetInitial() )
- {
- myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() );
- myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() );
- myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() );
- myTransparencySpinBox->setValue( int(myPickingSettings->GetInfoWindowTransparency() * 100.0) );
- myPositionComboBox->setCurrentItem( myPickingSettings->GetInfoWindowPosition() );
- myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() );
- myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
- myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
-
- vtkFloatingPointType* aColor = myPickingSettings->GetColor();
- mySelectionColorButton->setPaletteBackgroundColor( QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
-
- return;
- }
-
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
- aCursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize );
- myCursorSizeSpinBox->setValue( aCursorSize );
-
- aPyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight );
- myPyramidHeightSpinBox->setValue( aPyramidHeight );
-
- aPointTolerance = aResourceMgr->doubleValue( "VISU", "picking_point_tolerance", aPointTolerance );
- myPointToleranceSpinBox->setValue( aPointTolerance );
-
- aColor = aResourceMgr->colorValue( "VISU", "picking_selection_color", aColor );
- mySelectionColorButton->setPaletteBackgroundColor( aColor );
-
- anInfoWindowTransparency = aResourceMgr->integerValue( "VISU", "picking_transparency", anInfoWindowTransparency );
- myTransparencySpinBox->setValue( anInfoWindowTransparency );
-
- anInfoWindowPosition = aResourceMgr->integerValue( "VISU", "picking_position", anInfoWindowPosition );
- myPositionComboBox->setCurrentItem( anInfoWindowPosition );
-
- aZoomFactor = aResourceMgr->doubleValue( "VISU", "picking_zoom_factor", aZoomFactor );
- myZoomFactorSpinBox->setValue( aZoomFactor );
-
- aStepNumber = aResourceMgr->integerValue( "VISU", "picking_step_number", aStepNumber );
- myStepNumberSpinBox->setValue( aStepNumber );
-
- aDisplayParentMesh = aResourceMgr->booleanValue( "VISU", "picking_display_parent_mesh", aDisplayParentMesh );
- myDisplayParentMeshCheckBox->setChecked( aDisplayParentMesh );
-
+ myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() );
+ myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() );
+ myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() );
+ myTransparencySpinBox->setValue( int(myPickingSettings->GetInfoWindowTransparency() * 100.0) );
+ myPositionComboBox->setCurrentItem( myPickingSettings->GetInfoWindowPosition() );
+ myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() );
+ myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
+ myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
+
+ vtkFloatingPointType* aColor = myPickingSettings->GetColor();
+ mySelectionColorButton->setPaletteBackgroundColor( QColor( ( int )( aColor[0] * 255.0 ),
+ ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[2] * 255.0 ) ) );
onClickApply();
}
void VVTK_PickingDlg::onClickApply()
{
- myPickingSettings->SetInitial( false );
-
myPickingSettings->SetCursorSize( myCursorSizeSpinBox->value() );
myPickingSettings->SetPyramidHeight( myPyramidHeightSpinBox->value() );
myPickingSettings->SetPointTolerance( myPointToleranceSpinBox->value() );