#include <vtkPointPicker.h>
#include <vtkScalarBarWidget.h>
-#include <vtkTextActor.h>
#include <vtkTextMapper.h>
#include <vtkTextProperty.h>
#include <vtkCell.h>
#include <vtkMath.h>
-#include <vtkActor.h>
-#include <vtkConeSource.h>
-#include <vtkPolyDataMapper.h>
-
#include <vtkViewport.h>
#include "utilities.h"
#endif
-//----------------------------------------------------------------
-class VISU_CursorPyramid : public vtkObject
-{
-public:
- vtkTypeMacro(VISU_CursorPyramid, vtkObject);
-
- static
- VISU_CursorPyramid*
- New();
-
- void
- AddToRender(vtkRenderer* theRenderer)
- {
- for(int i = 0; i < myNbCones; ++i)
- theRenderer->AddActor(myActors[i].GetPointer());
- }
-
- void
- RemoveFromRender(vtkRenderer* theRenderer)
- {
- for(int i = 0; i < myNbCones; ++i)
- theRenderer->RemoveActor(myActors[i].GetPointer());
- }
-
- void
- SetVisibility(int theVisibility)
- {
- for(int i = 0; i < myNbCones; ++i)
- myActors[i]->SetVisibility(theVisibility);
- }
+//============================================================================
+vtkStandardNewMacro(VISU_GaussPtsAct);
- void
- Init(float theHeight,
- float theRadius,
- float thePos[3],
- float theColor[3])
- {
- for(int i = 0; i < myNbCones; ++i){
- mySources[i]->SetHeight(theHeight);
- // Set the angle of the cone. As a side effect, the angle plus height sets
- // the base radius of the cone.
- mySources[i]->SetAngle(20.0);
-
- myActors[i]->SetPosition(thePos[0],thePos[1],thePos[2]);
- myActors[i]->GetProperty()->SetColor(theColor);
- }
-
- float aD = -0.5*theHeight - theRadius;
-
- // X
- mySources[0]->SetCenter(aD, 0.,0.);
- mySources[1]->SetCenter(aD, 0.,0.);
-
- // Y
- mySources[2]->SetDirection(0., 1., 0.);
- mySources[2]->SetCenter(0, aD, 0.);
-
- mySources[3]->SetDirection(0., 1., 0.);
- mySources[3]->SetCenter(0., aD, 0.);
-
- // Z
- mySources[4]->SetDirection(0., 0., 1.);
- mySources[4]->SetCenter(0, 0., aD);
-
- mySources[5]->SetDirection(0., 0., 1.);
- mySources[5]->SetCenter(0., 0., aD);
- }
-
-protected:
- VISU_CursorPyramid():
- myNbCones(6)
- {
- for(int i = 0; i < myNbCones; i++){
- vtkConeSource* aConeSource = vtkConeSource::New();
- aConeSource->SetResolution(4);
-
- vtkPolyDataMapper* aPolyDataMapper = vtkPolyDataMapper::New();
- aPolyDataMapper->SetInput(aConeSource->GetOutput());
- aConeSource->Delete();
-
- vtkActor* anActor = vtkActor::New();
- anActor->SetMapper(aPolyDataMapper);
- anActor->SetVisibility(0);
- anActor->SetPickable(0);
- aPolyDataMapper->Delete();
-
- mySources[i] = aConeSource;
- myMappers[i] = aPolyDataMapper;
- myActors[i] = anActor;
- anActor->Delete();
- }
-
- myActors[1]->SetOrientation(0. ,180.,0.);
- myActors[3]->SetOrientation(0. , 0. ,180.);
- myActors[5]->SetOrientation(180., 0. ,0.);
- }
-
- int myNbCones;
- vtkSmartPointer<vtkConeSource> mySources[6];
- vtkSmartPointer<vtkPolyDataMapper> myMappers[6];
- vtkSmartPointer<vtkActor> myActors[6];
-};
-
-vtkStandardNewMacro(VISU_CursorPyramid);
-
-
-//----------------------------------------------------------------
-class VISU_GPTextActor : public vtkTextActor
-{
-public:
- vtkTypeMacro(VISU_GPTextActor, vtkTextActor);
-
- static
- VISU_GPTextActor*
- New();
-
- void
- Init(const float theWorldPoint[4],
- const float theDistance = 10.0)
- {
- for(int i = 0; i < 4; i++)
- myWorldPoint[i] = theWorldPoint[i];
- }
-
- virtual
- int
- RenderOpaqueGeometry(vtkViewport *theViewport)
- {
- float aSelectionPoint[3];
- theViewport->SetWorldPoint(myWorldPoint);
- theViewport->WorldToDisplay();
- theViewport->GetDisplayPoint(aSelectionPoint);
-
- aSelectionPoint[0] += myDistance;
- aSelectionPoint[1] += myDistance;
-
- SetPosition(aSelectionPoint);
- Superclass::RenderOpaqueGeometry(theViewport);
- }
-
-protected:
- float myWorldPoint[4];
- float myDistance;
-};
-
-vtkStandardNewMacro(VISU_GPTextActor);
-
-
-//----------------------------------------------------------------
-VISU_GaussPtsAct*
-VISU_GaussPtsAct
-::New(bool theIsSegmented)
-{
- return new VISU_GaussPtsAct(theIsSegmented);
-}
-
-//----------------------------------------------------------------
+//----------------------------------------------------------------------------
VISU_GaussPtsAct
-::VISU_GaussPtsAct(bool theIsSegmented):
+::VISU_GaussPtsAct():
myEventCallbackCommand(vtkCallbackCommand::New()),
- myIsSegmented(theIsSegmented),
+ myDeviceActor(VISU_GaussPtsDeviceActor::New()),
myWidget(NULL),
myGaussPointsPL(NULL),
+ myLastObjPointID(-1),
myTextMapper(vtkTextMapper::New()),
myTextActor(VISU_GPTextActor::New()),
- myLastObjPointID(-1),
mySphereSource(vtkSphereSource::New()),
mySphereMapper(vtkPolyDataMapper::New()),
mySphereActor(vtkActor::New()),
- myCursorPyramid(VISU_CursorPyramid::New())
+ myCursorPyramid(VISU_CursorPyramid::New()),
+ mySphereSourceSelected(vtkSphereSource::New()),
+ mySphereActorSelected(vtkActor::New()),
+ myCellSource(vtkUnstructuredGrid::New()),
+ myCellActor(vtkActor::New())
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::VISU_GaussPtsAct - this = "<<this);
myEventCallbackCommand->Delete();
+ myDeviceActor->Delete();
+
+ myTextMapper->Delete();
+ myTextActor->Delete();
+
+ mySphereSource->Delete();
+ mySphereMapper->Delete();
+ mySphereActor->Delete();
+
+ myCursorPyramid->Delete();
+
+ mySphereSourceSelected->Delete();
+ mySphereActorSelected->Delete();
+
+ myCellSource->Delete();
+ myCellActor->Delete();
myEventCallbackCommand->SetClientData(this);
myEventCallbackCommand->SetCallback(VISU_GaussPtsAct::ProcessEvents);
- if(!theIsSegmented){
- myDeviceActor = VISU_GaussPtsDeviceActor::New();
- myDeviceActor->SetProperty(GetProperty());
- myDeviceActor->SetVisibility(true);
- myDeviceActor->SetPickable(false);
- myDeviceActor->Delete();
-
- myOutsideDeviceActor = VISU_GaussPtsDeviceActor::New();
- myOutsideDeviceActor->SetProperty(GetProperty());
- myOutsideDeviceActor->SetVisibility(false);
- myOutsideDeviceActor->SetPickable(false);
- myOutsideDeviceActor->Delete();
- }
- myInsideDeviceActor = VISU_GaussPtsDeviceActor::New();
- myInsideDeviceActor->SetProperty(GetProperty());
- myInsideDeviceActor->SetVisibility(theIsSegmented);
- myInsideDeviceActor->SetPickable(false);
- myInsideDeviceActor->Delete();
-
- myTextMapper->Delete();
- myTextActor->Delete();
+ myDeviceActor->SetProperty(GetProperty());
+ myDeviceActor->SetVisibility(true);
+ myDeviceActor->SetPickable(false);
vtkTextProperty* aTextProperty = myTextMapper->GetTextProperty();
aTextProperty->SetVerticalJustification(VTK_TEXT_BOTTOM);
aTextProperty->SetJustification(VTK_TEXT_LEFT);
myTextActor->SetMapper(myTextMapper.GetPointer());
- //myTextActor->SetAlignmentPoint(3);
myTextActor->SetVisibility(false);
myTextActor->SetPickable(false);
- mySphereSource->Delete();
- mySphereMapper->Delete();
- mySphereActor->Delete();
-
mySphereMapper->SetInput(mySphereSource->GetOutput());
mySphereActor->SetMapper(mySphereMapper.GetPointer());
mySphereActor->SetVisibility(false);
mySphereActor->SetPickable(false);
- //
- myCursorPyramid->Delete();
- //
- mySphereSourceSelected = vtkSphereSource::New();
- mySphereSourceSelected->Delete();
- mySphereMapperSelected = vtkPolyDataMapper::New();
- mySphereMapperSelected->Delete();
- mySphereMapperSelected->SetInput(mySphereSourceSelected->GetOutput());
+ vtkPolyDataMapper* aSphereMapperSelected = vtkPolyDataMapper::New();
+ aSphereMapperSelected->SetInput(mySphereSourceSelected->GetOutput());
- mySphereActorSelected = vtkActor::New();
- mySphereActorSelected->Delete();
- mySphereActorSelected->SetMapper(mySphereMapperSelected.GetPointer());
+ mySphereActorSelected->SetMapper(aSphereMapperSelected);
+ mySphereActorSelected->GetProperty()->SetColor(1.0,1.0,1.0);
mySphereActorSelected->SetVisibility(false);
mySphereActorSelected->SetPickable(false);
- float aColorSelected[3] = {1.,1.,1.};
- mySphereActorSelected->GetProperty()->SetColor(aColorSelected);
- //
- // Cell
- myCellSource = vtkUnstructuredGrid::New();
- myCellSource->Delete();
+
myCellSource->Allocate();
- //
- myCellMapper = vtkDataSetMapper::New();
- myCellMapper->Delete();
- myCellMapper->SetInput(myCellSource.GetPointer());
- //
- myCellActor = vtkActor::New();
- myCellActor->Delete();
- myCellActor->SetMapper(myCellMapper.GetPointer());
+ vtkDataSetMapper* aCellMapper = vtkDataSetMapper::New();
+ aCellMapper->SetInput(myCellSource.GetPointer());
+ myCellActor->SetMapper(aCellMapper);
myCellActor->SetVisibility(0);
myCellActor->SetPickable(0);
myCellActor->GetProperty()->SetAmbient(1.0);
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::~VISU_GaussPtsAct - this = "<<this);
}
-//----------------------------------------------------------------
-VISU_OpenGLPointSpriteMapper*
+
+//----------------------------------------------------------------------------
+void
VISU_GaussPtsAct
-::GetPSMapper()
+::SetPipeLine(VISU_PipeLine* thePipeLine)
{
- if(!myIsSegmented)
- return myDeviceActor->GetPSMapper();
- else
- return myInsideDeviceActor->GetPSMapper();
+ myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
+
+ Superclass::SetPipeLine(thePipeLine);
+}
+
+VISU_GaussPointsPL*
+VISU_GaussPtsAct
+::GetGaussPointsPL()
+{
+ return myGaussPointsPL.GetPointer();
}
void
{
Superclass::ShallowCopyPL(thePipeLine);
- vtkPolyData* aDatsSet = GetPSMapper()->GetInput();
- GetPSMapper()->ShallowCopy(thePipeLine->GetMapper());
+ VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
+ myDeviceActor->ShallowCopyPL(aPipeLine);
+}
- // To restore mapper input from pipeline
- GetPSMapper()->SetInput(aDatsSet);
- if(VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine)){
- if(!myIsSegmented){
- myDeviceActor->ShallowCopyPL(aPipeLine);
- myOutsideDeviceActor->ShallowCopyPL(aPipeLine);
- }
- myInsideDeviceActor->ShallowCopyPL(aPipeLine);
-
- // Restore implicit function
- if(myWidget){
- vtkImplicitFunction* aFunction = myWidget->ImplicitFunction();
- if(!myIsSegmented){
- myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(aFunction);
- myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
- myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
- }
- myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(aFunction);
- }
- }
+//----------------------------------------------------------------------------
+VISU_OpenGLPointSpriteMapper*
+VISU_GaussPtsAct
+::GetPSMapper()
+{
+ return myDeviceActor->GetPSMapper();
}
vtkDataSet*
VISU_GaussPtsAct
::GetInput()
{
- vtkDataSet* aDataSet = GetMapper()->GetInput();
- aDataSet->Update();
- return aDataSet;
+ return GetMapper()->GetInput();
}
-//----------------------------------------------------------------
+vtkMapper*
+VISU_GaussPtsAct
+::GetMapper()
+{
+ return GetPSMapper();
+}
+
+
+//----------------------------------------------------------------------------
void
VISU_GaussPtsAct
::AddToRender(vtkRenderer* theRenderer)
{
Superclass::AddToRender(theRenderer);
- if(!myIsSegmented){
- myDeviceActor->AddToRender(theRenderer);
- myOutsideDeviceActor->AddToRender(theRenderer);
- }
- myInsideDeviceActor->AddToRender(theRenderer);
+ myDeviceActor->AddToRender(theRenderer);
theRenderer->AddActor(myTextActor.GetPointer());
theRenderer->AddActor(mySphereActor.GetPointer());
{
Superclass::RemoveFromRender(theRenderer);
- if(!myIsSegmented){
- myDeviceActor->RemoveFromRender(theRenderer);
- myOutsideDeviceActor->RemoveFromRender(theRenderer);
- }
- myInsideDeviceActor->RemoveFromRender(theRenderer);
+ myDeviceActor->RemoveFromRender(theRenderer);
theRenderer->RemoveActor(mySphereActor.GetPointer());
theRenderer->RemoveActor(myTextActor.GetPointer());
VISU_GaussPtsAct
::SetTransform(VTKViewer_Transform* theTransform)
{
- if(!myIsSegmented){
- myDeviceActor->SetTransform(theTransform);
- myOutsideDeviceActor->SetTransform(theTransform);
- }
- myInsideDeviceActor->SetTransform(theTransform);
-
Superclass::SetTransform(theTransform);
- Modified();
+
+ myDeviceActor->SetTransform(theTransform);
}
int
}
-//----------------------------------------------------------------
+//----------------------------------------------------------------------------
void
VISU_GaussPtsAct
::SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget)
theWidget->AddObserver(vtkCommand::DisableEvent,
myEventCallbackCommand.GetPointer(),
0.0);
- if(!myIsSegmented)
- myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
- myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
-
- if(myWidget->IsEnabled())
- OnInteractorEvent(vtkCommand::EnableEvent);
- else
- OnInteractorEvent(vtkCommand::DisableEvent);
+}
+
+bool
+VISU_GaussPtsAct
+::ChangeMagnification()
+{
+ return myChangeMagnification;
}
-//----------------------------------------------------------------
+//----------------------------------------------------------------------------
namespace
{
VISU_GaussPointsPL*
VISU_GaussPtsAct
::SetMapperInput(vtkDataSet* theDataSet)
{
- if(vtkPolyData* aPolyData = dynamic_cast<vtkPolyData*>(theDataSet)){
- if(!myIsSegmented){
- myDeviceActor->SetPipeLine(GetGaussPointsPL());
- if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
- myInsideDeviceActor->SetPipeLine(aPipeLine);
- aPipeLine->Delete();
- }
- if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
- myOutsideDeviceActor->SetPipeLine(aPipeLine);
- myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
- myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
- aPipeLine->Delete();
- }
- }else
- myInsideDeviceActor->SetPipeLine(GetGaussPointsPL());
- vtkLODActor::SetMapper(GetMapper());
- }
-}
-
-vtkMapper*
-VISU_GaussPtsAct
-::GetMapper()
-{
- return GetPSMapper();
-}
-
-void
-VISU_GaussPtsAct
-::SetPipeLine(VISU_PipeLine* thePipeLine)
-{
- myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
-
- Superclass::SetPipeLine(thePipeLine);
-}
-
-VISU_GaussPointsPL*
-VISU_GaussPtsAct
-::GetGaussPointsPL()
-{
- return myGaussPointsPL.GetPointer();
+ myDeviceActor->SetPipeLine(GetGaussPointsPL());
+ vtkLODActor::SetMapper(GetMapper());
}
void
::SetFactory(VISU::TActorFactory* theActorFactory)
{
using namespace VISU;
- if(TGaussPtsActorFactory* aFactory = dynamic_cast<TGaussPtsActorFactory*>(theActorFactory)){
- myUpdatePrs3dSignal.connect(boost::bind(&TGaussPtsActorFactory::UpdateFromActor,
- aFactory,
- _1));
- VISU_Actor::SetFactory(theActorFactory);
- myGaussPtsActorFactory = aFactory;
- }
+ myGaussPtsActorFactory = dynamic_cast<TGaussPtsActorFactory*>(theActorFactory);
+ myUpdatePrs3dSignal.connect(boost::bind(&TGaussPtsActorFactory::UpdateFromActor,
+ myGaussPtsActorFactory,
+ _1));
+ Superclass::SetFactory(theActorFactory);
}
VISU::TGaussPtsActorFactory*
return myGaussPtsActorFactory;
}
-void
-VISU_GaussPtsAct
-::Connect(VISU_GaussPtsAct* theActor)
-{
- mySetVisibilitySignal.connect(boost::bind(&VISU_GaussPtsAct::SetVisibility,theActor,_1));
-}
-
void
VISU_GaussPtsAct
::SetVisibility(int theMode)
{
Superclass::SetVisibility(theMode);
-
- if(!myIsSegmented){
- myDeviceActor->SetVisibility(GetVisibility() && !myWidget->IsEnabled());
- myOutsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
- }
- myInsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
-
- mySetVisibilitySignal(GetVisibility());
-}
-
-bool
-VISU_GaussPtsAct
-::ChangeMagnification()
-{
- return myChangeMagnification;
}
-
//----------------------------------------------------------------------------
void
VISU_GaussPtsAct
myUpdatePrs3dSignal(this);
break;
}
- case vtkCommand::EnableEvent:
- case vtkCommand::DisableEvent:
- if(!myIsSegmented){
- myDeviceActor->SetVisibility(GetVisibility() && !myWidget->IsEnabled());
- myOutsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
- myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
- myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
- }
- myInsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
- break;
default:
break;
}
}
-//----------------------------------------------------------------
+//----------------------------------------------------------------------------
bool
VISU_GaussPtsAct
::PreHighlight(SVTK_Selector* theSelector,
// To calculate display (2D) position of the annotation
float aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.0};
- myTextActor->Init(aWorldCoord);
+ myTextActor->Init(aWorldCoord,10.0);
// To prepare the annotation text
std::ostringstream aStr;
aStr<<"Global ID: "<<anObjId;
}
-//==================================================================
-// function : Highlight
-// purpose :
-//==================================================================
+//----------------------------------------------------------------------------
bool
VISU_GaussPtsAct
::Highlight(SVTK_Selector* theSelector,
//
// To calculate display (2D) position of the annotation
float aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.};
- myTextActor->Init(aWorldCoord);
+ myTextActor->Init(aWorldCoord,10);
//
// Selected
mySphereSourceSelected->SetCenter(aNodeCoord);
//mySphereActor->SetVisibility(aSphereVisibility);
return bRet;
}
+
+
+
+//==============================================================================
+vtkStandardNewMacro(VISU_GaussPtsAct1);
+
+
+//----------------------------------------------------------------------------
+VISU_GaussPtsAct1
+::VISU_GaussPtsAct1():
+ myInsideDeviceActor(VISU_GaussPtsDeviceActor::New()),
+ myOutsideDeviceActor(VISU_GaussPtsDeviceActor::New())
+{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct1::VISU_GaussPtsAct1 - this = "<<this);
+ myInsideDeviceActor->SetProperty(GetProperty());
+ myInsideDeviceActor->SetVisibility(false);
+ myInsideDeviceActor->SetPickable(false);
+ myInsideDeviceActor->Delete();
+
+ myOutsideDeviceActor->SetProperty(GetProperty());
+ myOutsideDeviceActor->SetVisibility(false);
+ myOutsideDeviceActor->SetPickable(false);
+ myOutsideDeviceActor->Delete();
+}
+
+VISU_GaussPtsAct1
+::~VISU_GaussPtsAct1()
+{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct1::~VISU_GaussPtsAct1 - this = "<<this);
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct1
+::ShallowCopyPL(VISU_PipeLine* thePipeLine)
+{
+ Superclass::ShallowCopyPL(thePipeLine);
+
+ VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
+ myInsideDeviceActor->ShallowCopyPL(aPipeLine);
+ myOutsideDeviceActor->ShallowCopyPL(aPipeLine);
+ // Restore implicit function
+ if(myWidget){
+ vtkImplicitFunction* aFunction = myWidget->ImplicitFunction();
+
+ myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(aFunction);
+
+ myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(aFunction);
+ myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
+ myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct1
+::AddToRender(vtkRenderer* theRenderer)
+{
+ Superclass::AddToRender(theRenderer);
+
+ myInsideDeviceActor->AddToRender(theRenderer);
+ myOutsideDeviceActor->AddToRender(theRenderer);
+}
+
+void
+VISU_GaussPtsAct1
+::RemoveFromRender(vtkRenderer* theRenderer)
+{
+ Superclass::RemoveFromRender(theRenderer);
+
+ myInsideDeviceActor->RemoveFromRender(theRenderer);
+ myOutsideDeviceActor->RemoveFromRender(theRenderer);
+}
+
+void
+VISU_GaussPtsAct1
+::SetTransform(VTKViewer_Transform* theTransform)
+{
+ Superclass::SetTransform(theTransform);
+
+ myInsideDeviceActor->SetTransform(theTransform);
+ myOutsideDeviceActor->SetTransform(theTransform);
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct1
+::SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget)
+{
+ Superclass::SetImplicitFunctionWidget(theWidget);
+
+ myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
+ myInsideDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+
+ myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
+ myOutsideDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct1
+::SetMapperInput(vtkDataSet* theDataSet)
+{
+ Superclass::SetMapperInput(theDataSet);
+
+ if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
+ myInsideDeviceActor->SetPipeLine(aPipeLine);
+ }
+ if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
+ myOutsideDeviceActor->SetPipeLine(aPipeLine);
+ myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
+ myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
+ }
+}
+
+void
+VISU_GaussPtsAct1
+::Connect(VISU_GaussPtsAct2* theActor)
+{
+ mySetVisibilitySignal.connect(boost::bind(&VISU_GaussPtsAct2::SetVisibility,theActor,_1));
+}
+
+void
+VISU_GaussPtsAct1
+::SetVisibility(int theMode)
+{
+ Superclass::SetVisibility(theMode);
+
+ myDeviceActor->SetVisibility(GetVisibility() && !myWidget->IsEnabled());
+
+ myInsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
+ myOutsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
+
+ mySetVisibilitySignal(GetVisibility());
+}
+
+
+void
+VISU_GaussPtsAct1
+::OnInteractorEvent(unsigned long theEvent)
+{
+ switch(theEvent){
+ case vtkCommand::EnableEvent:
+ case vtkCommand::DisableEvent:
+ myDeviceActor->SetVisibility(GetVisibility() && !myWidget->IsEnabled());
+ myInsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
+ myOutsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
+ break;
+ default:
+ break;
+ }
+ Superclass::OnInteractorEvent(theEvent);
+}
+
+
+//==============================================================================
+vtkStandardNewMacro(VISU_GaussPtsAct2);
+
+
+//----------------------------------------------------------------------------
+VISU_GaussPtsAct2
+::VISU_GaussPtsAct2()
+{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct2::VISU_GaussPtsAct2 - this = "<<this);
+}
+
+VISU_GaussPtsAct2
+::~VISU_GaussPtsAct2()
+{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct2::~VISU_GaussPtsAct2 - this = "<<this);
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct2
+::ShallowCopyPL(VISU_PipeLine* thePipeLine)
+{
+ Superclass::ShallowCopyPL(thePipeLine);
+ // Restore implicit function
+ if(myWidget){
+ vtkImplicitFunction* aFunction = myWidget->ImplicitFunction();
+ myDeviceActor->GetPipeLine()->SetImplicitFunction(aFunction);
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct2
+::SetMapperInput(vtkDataSet* theDataSet)
+{
+ Superclass::SetMapperInput(theDataSet);
+
+ if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
+ myDeviceActor->SetPipeLine(aPipeLine);
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct2
+::SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget)
+{
+ Superclass::SetImplicitFunctionWidget(theWidget);
+
+ myDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
+ myDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct2
+::SetVisibility(int theMode)
+{
+ Superclass::SetVisibility(theMode);
+
+ myDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
+}
+
+void
+VISU_GaussPtsAct2
+::OnInteractorEvent(unsigned long theEvent)
+{
+ switch(theEvent){
+ case vtkCommand::EnableEvent:
+ case vtkCommand::DisableEvent:
+ myDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
+ break;
+ default:
+ break;
+ }
+ Superclass::OnInteractorEvent(theEvent);
+}
+