#include "utilities.h"
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
+static int MYDEBUG1 = 0;
+static int MYDEBUG2 = 0;
#else
static int MYDEBUG = 0;
+static int MYDEBUG1 = 0;
+static int MYDEBUG2 = 0;
#endif
//----------------------------------------------------------------
VISU_GaussPtsAct
::VISU_GaussPtsAct():
myEventCallbackCommand(vtkCallbackCommand::New()),
+ myPriority(0.0),
myDeviceActor(VISU_GaussPtsDeviceActor::New()),
myWidget(NULL),
myGaussPointsPL(NULL),
VISU_GaussPtsAct
::SetPipeLine(VISU_PipeLine* thePipeLine)
{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::SetPipeLine - this = "<<this);
+
myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
Superclass::SetPipeLine(thePipeLine);
VISU_GaussPtsAct
::ShallowCopyPL(VISU_PipeLine* thePipeLine)
{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::ShallowCopyPL - this = "<<this);
+
Superclass::ShallowCopyPL(thePipeLine);
VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
VISU_GaussPtsAct
::AddToRender(vtkRenderer* theRenderer)
{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::AddToRender - this = "<<this);
+
Superclass::AddToRender(theRenderer);
myDeviceActor->AddToRender(theRenderer);
VISU_GaussPtsAct
::RemoveFromRender(vtkRenderer* theRenderer)
{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::RemoveFromRender - this = "<<this);
+
Superclass::RemoveFromRender(theRenderer);
myDeviceActor->RemoveFromRender(theRenderer);
VISU_GaussPtsAct
::SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget)
{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::SetImplicitFunctionWidget - this = "<<this);
+
myWidget = theWidget;
theWidget->AddObserver(vtkCommand::EnableEvent,
myEventCallbackCommand.GetPointer(),
- 0.0);
+ myPriority);
theWidget->AddObserver(vtkCommand::DisableEvent,
myEventCallbackCommand.GetPointer(),
- 0.0);
+ myPriority);
}
bool
VISU_GaussPtsAct
::SetMapperInput(vtkDataSet* theDataSet)
{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::SetMapperInput - this = "<<this);
+
myDeviceActor->SetPipeLine(GetGaussPointsPL());
vtkLODActor::SetMapper(GetMapper());
}
if(theInteractor)
theInteractor->AddObserver(vtkCommand::CharEvent,
myEventCallbackCommand.GetPointer(),
- 0.0);
+ myPriority);
Superclass::SetInteractor(theInteractor);
VISU_GaussPtsAct
::OnInteractorEvent(unsigned long theEvent)
{
+ if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::OnInteractorEvent - this = "<<this);
+
switch(theEvent){
case vtkCommand::CharEvent: {
switch(myInteractor->GetKeyCode()) {
myInsideDeviceActor(VISU_GaussPtsDeviceActor::New()),
myOutsideDeviceActor(VISU_GaussPtsDeviceActor::New())
{
- if(MYDEBUG) MESSAGE("VISU_GaussPtsAct1::VISU_GaussPtsAct1 - this = "<<this);
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::VISU_GaussPtsAct1 - this = "<<this);
myInsideDeviceActor->SetProperty(GetProperty());
myInsideDeviceActor->SetVisibility(false);
myInsideDeviceActor->SetPickable(false);
VISU_GaussPtsAct1
::~VISU_GaussPtsAct1()
{
- if(MYDEBUG) MESSAGE("VISU_GaussPtsAct1::~VISU_GaussPtsAct1 - this = "<<this);
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::~VISU_GaussPtsAct1 - this = "<<this);
}
VISU_GaussPtsAct1
::ShallowCopyPL(VISU_PipeLine* thePipeLine)
{
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::ShallowCopyPL - this = "<<this);
+
Superclass::ShallowCopyPL(thePipeLine);
VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
+
myInsideDeviceActor->ShallowCopyPL(aPipeLine);
+
myOutsideDeviceActor->ShallowCopyPL(aPipeLine);
+ myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
+ myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
+
// Restore implicit function
if(myWidget){
vtkImplicitFunction* aFunction = myWidget->ImplicitFunction();
myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(aFunction);
myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(aFunction);
- myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
- myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
}
}
VISU_GaussPtsAct1
::SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget)
{
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetImplicitFunctionWidget - this = "<<this);
+
Superclass::SetImplicitFunctionWidget(theWidget);
myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
VISU_GaussPtsAct1
::SetMapperInput(vtkDataSet* theDataSet)
{
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetMapperInput - this = "<<this);
+
Superclass::SetMapperInput(theDataSet);
if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
}
if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
myOutsideDeviceActor->SetPipeLine(aPipeLine);
+
+ aPipeLine->DebugOn();
+ myOutsideDeviceActor->GetMapper()->DebugOn();
+
myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
+
myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
}
}
VISU_GaussPtsAct1
::SetVisibility(int theMode)
{
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetVisibility - this = "<<this);
+
Superclass::SetVisibility(theMode);
myDeviceActor->SetVisibility(GetVisibility() && !myWidget->IsEnabled());
VISU_GaussPtsAct1
::OnInteractorEvent(unsigned long theEvent)
{
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::OnInteractorEvent - this = "<<this);
+
switch(theEvent){
case vtkCommand::EnableEvent:
case vtkCommand::DisableEvent:
VISU_GaussPtsAct2
::VISU_GaussPtsAct2()
{
- if(MYDEBUG) MESSAGE("VISU_GaussPtsAct2::VISU_GaussPtsAct2 - this = "<<this);
+ if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::VISU_GaussPtsAct2 - this = "<<this);
}
VISU_GaussPtsAct2
::~VISU_GaussPtsAct2()
{
- if(MYDEBUG) MESSAGE("VISU_GaussPtsAct2::~VISU_GaussPtsAct2 - this = "<<this);
+ if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::~VISU_GaussPtsAct2 - this = "<<this);
}
VISU_GaussPtsAct2
::ShallowCopyPL(VISU_PipeLine* thePipeLine)
{
+ if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::ShallowCopyPL - this = "<<this);
+
Superclass::ShallowCopyPL(thePipeLine);
// Restore implicit function
if(myWidget){
VISU_GaussPtsAct2
::SetMapperInput(vtkDataSet* theDataSet)
{
+ if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::SetMapperInput - this = "<<this);
+
Superclass::SetMapperInput(theDataSet);
if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
VISU_GaussPtsAct2
::SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget)
{
+ if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::SetImplicitFunctionWidget - this = "<<this);
+
Superclass::SetImplicitFunctionWidget(theWidget);
+ theWidget->AddObserver(vtkCommand::EndInteractionEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+
myDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
myDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
}
VISU_GaussPtsAct2
::SetVisibility(int theMode)
{
+ if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::SetVisibility - this = "<<this);
+
Superclass::SetVisibility(theMode);
myDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
VISU_GaussPtsAct2
::OnInteractorEvent(unsigned long theEvent)
{
+ if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::OnInteractorEvent - this = "<<this);
+
switch(theEvent){
case vtkCommand::EnableEvent:
case vtkCommand::DisableEvent:
myDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled());
break;
+ case vtkCommand::EndInteractionEvent:
+ vtkLODActor::SetMapper(GetMapper());
+ break;
default:
break;
}