X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPIPELINE%2FVISU_PipeLine.cxx;h=a99eba600854ef89c7862149f1f4326069aadd86;hb=de799091f3bde871c887d0bf34f9f5f1c9146de8;hp=d4354e35bed350edc3bc6a5d6071abc8c3b456b7;hpb=17b175ff4b710fc93421509ffa7583edd1678a5d;p=modules%2Fvisu.git diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index d4354e35..a99eba60 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -27,11 +27,16 @@ #include "VISU_PipeLine.hxx" +#include "VISU_PipeLineUtils.hxx" + +#include #include #include #include +static int MYVTKDEBUG = 0; + #ifdef _DEBUG_ static int MYDEBUG = 0; static int MYDEBUGWITHFILES = 0; @@ -43,11 +48,14 @@ static int MYDEBUGWITHFILES = 0; VISU_PipeLine::VISU_PipeLine(){ myMapper = TMapper::New(); myInput = NULL; + SetDebug(MYVTKDEBUG); } VISU_PipeLine::~VISU_PipeLine(){ - myMapper->Delete(); + if(MYDEBUG) MESSAGE("~VISU_PipeLine - myInput = "<GetReferenceCount()); SetInput(NULL); + myMapper->RemoveAllInputs(); + myMapper->Delete(); } void VISU_PipeLine::ShallowCopy(VISU_PipeLine *thePipeLine){ @@ -57,13 +65,14 @@ void VISU_PipeLine::ShallowCopy(VISU_PipeLine *thePipeLine){ } void VISU_PipeLine::SetInput(TInput* theInput){ - if (myInput != theInput){ + if(myInput != theInput){ if (myInput != NULL) myInput->UnRegister(this); myInput = theInput; - if (myInput != NULL) { + if(myInput != NULL){ myInput->Register(this); myInput->Update(); - } + }else + myMapper->SetInput(NULL); Modified(); } } @@ -83,24 +92,28 @@ void VISU_PipeLine::Update(){ myMapper->Update(); } - -size_t VISU_PipeLine::CheckAvailableMemory(const size_t& theSize){ +int VISU_PipeLine::CheckAvailableMemory(const float& theSize){ try{ - char *aCheck = new char[theSize]; + if(theSize > ULONG_MAX) return 0; + size_t aSize = size_t(theSize); + char *aCheck = new char[aSize]; if(aCheck) delete [] aCheck; if(MYDEBUG && aCheck == NULL) - cout<<"VISU_PipeLine::CheckAvailableMemory("< theMinSize) theSize /= 2;