static int MYDEBUG = 0;
#endif
+//#define ENABLE_ANNOTATION
//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_Actor);
SetShrinkFactor();
myAnnotationMapper->Delete();
- myAnnotationActor->Delete();
myAnnotationActor->SetMapper(myAnnotationMapper.GetPointer());
- myAnnotationActor.GetPointer()->SetVisibility(0);
+
+ myAnnotationActor->Delete();
+ myAnnotationActor->SetVisibility(0);
}
//----------------------------------------------------------------------------
VISU_Actor
::SetFactory(VISU::TActorFactory* theActorFactory)
{
+ using namespace VISU;
+
+ if(myActorFactory == theActorFactory)
+ return;
+
+ if(theActorFactory)
+ myDestroySignal.connect(boost::bind(&TActorFactory::RemoveActor,
+ theActorFactory,
+ _1));
+
myActorFactory = theActorFactory;
}
{
theRenderer->RemoveActor(myAnnotationActor.GetPointer());
Superclass::RemoveFromRender(theRenderer);
- myActorFactory->RemoveActor(this);
+ myDestroySignal(this);
}
//----------------------------------------------------------------------------
theInteractorStyle,
theSelectionEvent,
theIsHighlight);
+#ifndef ENABLE_ANNOTATION
+ return aRet;
+#endif
//
myAnnotationActor->SetVisibility(0);
if(theIsHighlight){
myAnnotationMapper->SetInput(aString.c_str());
myAnnotationActor->SetVisibility(1);
-
return true;
}
}
if(aVtkId >= 0 && theSelector->IsValid(this,aVtkId,true) && hasIO()){
vtkIdType anObjId = GetNodeObjId( aVtkId );
if(float* aCoord = GetNodeCoord(anObjId)){
- // Display coordinates
- float aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
- aRenderer->SetWorldPoint(aWorldCoord);
- aRenderer->WorldToDisplay();
- float aSelectionPoint[3];
- aRenderer->GetDisplayPoint(aSelectionPoint);
- myAnnotationActor->SetPosition(aSelectionPoint);
- //
- // To prepare the annotation text
- std::ostringstream aStr;
- aStr<<"Node ID: "<< anObjId;
- std::string aString = aStr.str();
- myAnnotationMapper->SetInput(aString.c_str());
-
- myAnnotationActor->SetVisibility(1);
+ // Display coordinates
+ float aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ float aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myAnnotationActor->SetPosition(aSelectionPoint);
+ //
+ // To prepare the annotation text
+ std::ostringstream aStr;
+ aStr<<"Node ID: "<< anObjId;
+ std::string aString = aStr.str();
+ myAnnotationMapper->SetInput(aString.c_str());
- return true;
- }
+ myAnnotationActor->SetVisibility(1);
+ return true;
}
+ }
break;
}
case EdgeOfCellSelection: