1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File: VISU_PipeLine.cxx
25 // Author: Alexey PETROV
29 #include "VISU_PipeLine.hxx"
31 #include <vtkObjectFactory.h>
32 #include <vtkDataSetMapper.h>
33 #include <vtkUnstructuredGrid.h>
36 static int MYDEBUG = 0;
37 static int MYDEBUGWITHFILES = 0;
39 static int MYDEBUG = 0;
40 static int MYDEBUGWITHFILES = 0;
43 VISU_PipeLine::VISU_PipeLine(){
44 myMapper = TMapper::New();
48 VISU_PipeLine::~VISU_PipeLine(){
53 void VISU_PipeLine::ShallowCopy(VISU_PipeLine *thePipeLine){
54 SetInput(thePipeLine->GetInput());
55 myMapper->ShallowCopy(thePipeLine->GetMapper());
59 void VISU_PipeLine::SetInput(TInput* theInput){
60 if (myInput != theInput){
61 if (myInput != NULL) myInput->UnRegister(this);
63 if (myInput != NULL) {
64 myInput->Register(this);
71 VISU_PipeLine::TMapper* VISU_PipeLine::GetMapper() {
73 if(!myMapper->GetInput()){
82 void VISU_PipeLine::Update(){
87 size_t VISU_PipeLine::CheckAvailableMemory(const size_t& theSize){
89 char *aCheck = new char[theSize];
90 if(aCheck) delete [] aCheck;
91 if(MYDEBUG && aCheck == NULL)
92 cout<<"VISU_PipeLine::CheckAvailableMemory("<<theSize<<") - cannot alloacate such amount of memory!!!\n";
93 return aCheck != NULL;
94 //return theSize < 1000*1024*1024;
97 cout<<"VISU_PipeLine::CheckAvailableMemory("<<theSize<<") - unexpected exception was caught!!!\n";
103 size_t VISU_PipeLine::GetAvailableMemory(size_t theSize, size_t theMinSize){
104 while(!CheckAvailableMemory(theSize))
105 if(theSize > theMinSize)