myActorCollection(vtkActorCollection::New()),
mySObject(SALOMEDS::SObject::_nil()),
myIsActiveSatate(true),
- myPipeLine(NULL),
myResult(NULL)
{
if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
mySObject(theSObject),
myActorCollection(vtkActorCollection::New()),
myIsActiveSatate(true),
- myResult(theResult),
- myPipeLine(NULL)
+ myResult(theResult)
{
if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
myOffset[0] = myOffset[1] = myOffset[2] = 0;
VISU::Prs3d_i
::GetPipeLine() const
{
- if(!myPipeLine)
+ if(!myPipeLine.GetPointer())
throw std::runtime_error("VISU::Prs3d_i::myPipeLine == NULL !!!");
- return myPipeLine;
+ return myPipeLine.GetPointer();
}
//----------------------------------------------------------------------------
::SetPipeLine(VISU_PipeLine* thePipeLine)
{
myPipeLine = thePipeLine;
+ if(thePipeLine)
+ thePipeLine->Delete();
}
//----------------------------------------------------------------------------
VISU::Prs3d_i
::IsPipeLineExists()
{
- return myPipeLine != NULL;
+ return myPipeLine.GetPointer() != NULL;
}
//----------------------------------------------------------------------------
VISU_PipeLine*
VISU::Prs3d_i
-::GetPL()
+::GetActorPipeLine()
{
return GetPipeLine();
}
theActor->SetPrs3d(this);
theActor->SetShrinkFactor();
theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
- theActor->SetPipeLine(GetPipeLine());
+ theActor->SetPipeLine(GetActorPipeLine());
+ if(theActor->GetPipeLine() != GetPipeLine()){
+ // To decrease actor'ss pipeline reference counter
+ theActor->GetPipeLine()->Delete();
+ }
theActor->SetFactory(this);
myUpdateActorsSignal.connect(boost::bind(&VISU_Actor::UpdateFromFactory,theActor));
VISU::Prs3d_i
::RemoveActor(VISU_Actor* theActor)
{
- if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActor - this = "<<this<<"; theActor = "<<theActor);
+ if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActor - this = "<<this<<"; theActor = "<<theActor<<"; "<<theActor->GetReferenceCount());
myActorCollection->RemoveItem(theActor);
}
//! Gets or creates VISU_PipeLine instance for actor initilization
virtual
VISU_PipeLine*
- GetPL();
+ GetActorPipeLine();
//! To check dataset validity, throws std::exception if not valid
virtual
boost::signal0<void> myRemoveActorsFromRendererSignal;
vtkSmartPointer<vtkActorCollection> myActorCollection;
- VISU_PipeLine *myPipeLine;
+ vtkSmartPointer<VISU_PipeLine> myPipeLine;
Handle(SALOME_InteractiveObject) myIO;