//----------------------------------------------------------------
vtkStandardNewMacro( VISU_OutsideCursorSettings );
+vtkStandardNewMacro( VISU_PickingSettings );
//----------------------------------------------------------------
VISU_OutsideCursorSettings::VISU_OutsideCursorSettings()
this->SetTexture( NULL );
}
+//----------------------------------------------------------------
+VISU_PickingSettings::VISU_PickingSettings()
+{
+ this->Initial = true;
+}
+
+VISU_PickingSettings::~VISU_PickingSettings()
+{
+}
+
+
+
//============================================================================
vtkStandardNewMacro(VISU_GaussPtsAct);
myCellSource(vtkUnstructuredGrid::New()),
myCellActor(vtkActor::New()),
myScalarBarCtrl(VISU_ScalarBarCtrl::New()),
- myBarVisibility(true)
+ myBarVisibility(true),
+ myPickingSettings(NULL)
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::VISU_GaussPtsAct - this = "<<this);
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::~VISU_GaussPtsAct - this = "<<this);
SetImplicitFunctionWidget(NULL);
SetInteractor(NULL);
+ SetPickingSettings(NULL);
}
return bRet;
}
+//----------------------------------------------------------------
+void
+VISU_GaussPtsAct
+::SetPickingSettings(VISU_PickingSettings* thePickingSettings)
+{
+ if(myPickingSettings == thePickingSettings)
+ return;
+
+ if(myPickingSettings)
+ myPickingSettings->RemoveObserver(myEventCallbackCommand.GetPointer());
+
+ myPickingSettings = thePickingSettings;
+
+ if(thePickingSettings)
+ thePickingSettings->AddObserver(vtkCommand::ModifiedEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+}
+
+void
+VISU_GaussPtsAct
+::UpdatePickingSettings()
+{
+ // Update picking parameters using myPickingSettings object
+
+ Update();
+}
+
//==============================================================================
vtkStandardNewMacro(VISU_GaussPtsAct1);
VISU_GaussPtsAct1
::UpdateOutsideCursorSettings()
{
- // update actor from myOutsideCursorSettings
VISU_OpenGLPointSpriteMapper* aMapper = myOutsideDeviceActor->GetPSMapper();
- aMapper->SetPointSpriteClamp(myOutsideCursorSettings->GetClamp());
+
aMapper->SetImageData(myOutsideCursorSettings->GetTexture());
+
+ aMapper->SetPointSpriteResults(false);
+ aMapper->SetPointSpriteClamp(myOutsideCursorSettings->GetClamp());
aMapper->SetPointSpriteAlphaThreshold(myOutsideCursorSettings->GetAlphaThreshold());
aMapper->SetPointSpriteSize(myOutsideCursorSettings->GetSize());
- aMapper->SetPointSpriteClamp(myOutsideCursorSettings->GetClamp());
+
myOutsideDeviceActor->GetProperty()->SetColor(myOutsideCursorSettings->GetColor());
+
+ //cout << "UpdateOutsideCursorSettings " << aMapper << endl;
+ //cout << myOutsideCursorSettings->GetAlphaThreshold() << endl;
Update();
}
};
+//============================================================================
+class VISU_PickingSettings : public vtkObject
+{
+ public:
+ enum { BelowPoint = 0, TopLeftCorner };
+
+ public:
+ vtkTypeMacro( VISU_PickingSettings, vtkObject );
+
+ VISU_PickingSettings();
+ virtual ~VISU_PickingSettings();
+
+ static
+ VISU_PickingSettings*
+ New();
+
+ vtkSetMacro( Initial, bool );
+ vtkGetMacro( Initial, bool );
+
+ vtkSetMacro( PyramidHeight, float );
+ vtkGetMacro( PyramidHeight, float );
+
+ vtkSetMacro( InfoWindowTransparency, float );
+ vtkGetMacro( InfoWindowTransparency, float );
+
+ vtkSetMacro( InfoWindowPosition, int );
+ vtkGetMacro( InfoWindowPosition, int );
+
+ vtkSetMacro( ZoomFactor, float );
+ vtkGetMacro( ZoomFactor, float );
+
+ vtkSetMacro( StepNumber, int );
+ vtkGetMacro( StepNumber, int );
+
+private:
+ bool Initial;
+
+ float PyramidHeight;
+ float InfoWindowTransparency;
+ int InfoWindowPosition;
+ float ZoomFactor;
+ int StepNumber;
+};
+
+
//============================================================================
class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
{
SVTK_SelectionEvent* theSelectionEvent,
bool theIsHighlight);
+ //----------------------------------------------------------------------------
+ void
+ SetPickingSettings(VISU_PickingSettings* thePickingSettings);
+
+ void
+ UpdatePickingSettings();
+
protected:
//----------------------------------------------------------------------------
VISU_GaussPtsAct();
bool myBarVisibility;
vtkSmartPointer<VISU_ScalarBarCtrl> myScalarBarCtrl;
+
+ VISU_PickingSettings* myPickingSettings;
};