]> SALOME platform Git repositories - modules/visu.git/blob - src/PIPELINE/VISU_StreamLinesPL.cxx
Salome HOME
Fix for the "0051899: curves are not shown in opened study" issue.
[modules/visu.git] / src / PIPELINE / VISU_StreamLinesPL.cxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  VISU OBJECT : interactive object for VISU entities implementation
24 // File:    VISU_StreamLinesPL.cxx
25 // Author:  Alexey PETROV
26 // Module : VISU
27 //
28 #include "VISU_StreamLinesPL.hxx"
29
30 #include "VISU_Extractor.hxx"
31 //#include "VISU_FieldTransform.hxx"
32 //#include "VISU_UsedPointsFilter.hxx"
33 #include "VISU_MaskPointsFilter.hxx"
34 #include "VISU_PipeLineUtils.hxx"
35
36 #include "VTKViewer_CellCenters.h"
37 #include "VTKViewer_GeometryFilter.h"
38
39 #include <SUIT_Session.h>
40 #include <SUIT_ResourceMgr.h>
41
42 #include <algorithm>
43
44 #include <vtkCell.h>
45 #include <vtkDataSet.h>
46 #include <vtkStreamLine.h>
47
48 #ifdef _DEBUG_
49 static int MYDEBUG = 0;
50 #else
51 static int MYDEBUG = 0;
52 #endif
53
54 static double EPS = 1.0e-7;
55 static double aMinNbOfSteps = 1.0E+2;
56 //static double aMaxNbOfSteps = 1.0E+3;
57 static double aCoeffOfIntStep = 1.0E+1;
58
59
60 //----------------------------------------------------------------------------
61 vtkStandardNewMacro(VISU_StreamLinesPL);
62
63
64 //----------------------------------------------------------------------------
65 VISU_StreamLinesPL
66 ::VISU_StreamLinesPL()
67 {
68   SetIsShrinkable(false);
69   SetIsFeatureEdgesAllowed(false);
70
71   myStream = vtkStreamLine::New();
72   myCenters = VTKViewer_CellCenters::New();
73   myGeomFilter = VTKViewer_GeometryFilter::New();
74   myPointsFilter = VISU_MaskPointsFilter::New();
75   mySource = NULL;
76
77   myPercents = GetUsedPointsDefault();
78 }
79
80
81 //----------------------------------------------------------------------------
82 VISU_StreamLinesPL
83 ::~VISU_StreamLinesPL()
84 {
85   myPointsFilter->Delete();
86   myPointsFilter = NULL;
87
88   myCenters->Delete();
89   myCenters = NULL;
90
91   myGeomFilter->Delete();
92   myGeomFilter = NULL;
93
94   myStream->Delete();
95   myStream = NULL;
96 }
97
98
99 //----------------------------------------------------------------------------
100 unsigned long int 
101 VISU_StreamLinesPL
102 ::GetMTime()
103 {
104   unsigned long int aTime = Superclass::GetMTime();
105
106   aTime = std::max(aTime, myStream->GetMTime());
107   aTime = std::max(aTime, myCenters->GetMTime());
108   aTime = std::max(aTime, myGeomFilter->GetMTime());
109   aTime = std::max(aTime, myPointsFilter->GetMTime());
110
111   if ( mySource )
112     aTime = std::max(aTime, mySource->GetMTime());
113
114   return aTime;
115 }
116
117
118 //----------------------------------------------------------------------------
119 void
120 VISU_StreamLinesPL
121 ::DoShallowCopy(VISU_PipeLine *thePipeLine,
122                 bool theIsCopyInput)
123 {
124   Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
125
126   if(VISU_StreamLinesPL *aPipeLine = dynamic_cast<VISU_StreamLinesPL*>(thePipeLine)){
127     SetParams(aPipeLine->GetIntegrationStep(),
128               aPipeLine->GetPropagationTime(),
129               aPipeLine->GetStepLength(),
130               aPipeLine->GetSource(),
131               aPipeLine->GetUsedPoints(),
132               aPipeLine->GetDirection());
133   }
134 }
135
136
137 //----------------------------------------------------------------------------
138 double
139 VISU_StreamLinesPL
140 ::GetNecasseryMemorySize(vtkIdType theNbOfPoints, 
141                          double theStepLength,
142                          double thePropogationTime, 
143                          double thePercents)
144 {
145   static double aStreamPointSize = sizeof(double)*15 + sizeof(vtkIdType)*2;
146   static double aStreamArraySize = aStreamPointSize*1024; // == 69632
147
148   double aNbCells = thePercents*theNbOfPoints*2.0;
149   double aNbPointsPerCell = thePropogationTime/theStepLength;
150   double aCellsSize = aNbCells*(1+aNbPointsPerCell);
151   double aPointsSize = aCellsSize*3.0*sizeof(double);
152
153   double aConnectivitySize = aCellsSize*sizeof(vtkIdType);
154   double aTypesSize = aNbCells*sizeof(char);
155   double aLocationsSize = aNbCells*sizeof(int);
156   //double aNbCellsPerPoint = aCellsSize / aNbCells - 1;
157   double aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
158
159   double anAssignedDataSize = aCellsSize*4.0*sizeof(double);
160   double anOutputDataSetSize = aMeshSize + anAssignedDataSize;
161
162   double aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
163   return aResult;
164 }
165
166
167 //----------------------------------------------------------------------------
168 size_t
169 VISU_StreamLinesPL
170 ::FindPossibleParams(vtkDataSet* theDataSet, 
171                      double& theStepLength,
172                      double& thePropogationTime, 
173                      double& thePercents)
174 {
175   static double aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
176   vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
177   double aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
178   size_t anIsPossible = CheckAvailableMemory(aSize);
179   if(!anIsPossible){
180     double aMaxStepLength = std::max(GetMaxStepLength(theDataSet),thePropogationTime);
181     double aMinStepLength = GetMinStepLength(theDataSet,thePercents);
182     double aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
183     for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){
184       double aStepLength = theStepLength + aDeltaStepLength;
185       if(aStepLength < aMaxStepLength) theStepLength = aStepLength;
186       else if(aStepChanged){
187         aStepLength = aMaxStepLength;
188         aStepChanged = 0;
189       }
190       double aPercents = thePercents /= aPercentsDecrease;
191       if(aPercents*aNbOfPoints > 1) thePercents = aPercents;
192       else if(aPerecentsChanged) {
193         thePercents = 1.1 / aNbOfPoints;
194         aPerecentsChanged = 0;
195       }
196       aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
197       if(CheckAvailableMemory(aSize)){
198         anIsPossible = i;
199         break;
200       }
201     }
202   }
203   if(MYDEBUG) MESSAGE("FindPossibleParams - aSize = "<<aSize<<"; anIsPossible = "<<anIsPossible);
204   return anIsPossible;
205 }
206
207
208 //----------------------------------------------------------------------------
209 size_t
210 VISU_StreamLinesPL
211 ::SetParams(double theIntStep,
212             double thePropogationTime,
213             double theStepLength,
214             vtkPointSet* theSource,
215             double thePercents,
216             int theDirection)
217 {
218   vtkPointSet* aDataSet = theSource? theSource: GetMergedInput();
219
220   vtkIdType aNbOfPoints = aDataSet->GetNumberOfPoints();
221   vtkDataSet* aPointSet = GetExtractorFilter()->GetOutput();
222   if (thePercents * aNbOfPoints < 1)
223     thePercents = 2.0 / aNbOfPoints;
224
225   theIntStep = CorrectIntegrationStep(theIntStep,
226                                       aPointSet,
227                                       thePercents);
228
229   thePropogationTime = CorrectPropagationTime(thePropogationTime,
230                                               aPointSet,
231                                               thePercents);
232
233   theStepLength = CorrectStepLength(theStepLength,
234                                     aPointSet,
235                                     thePercents);
236
237   size_t anIsAccepted = FindPossibleParams(aPointSet,
238                                            theStepLength,
239                                            thePropogationTime,
240                                            thePercents);
241
242   if (anIsAccepted) {
243     mySource = theSource;
244     myPercents = thePercents;
245     if(VISU::IsDataOnCells(GetMergedInput())){
246       myCenters->SetInputData(aDataSet);
247       myCenters->VertexCellsOn();
248       aDataSet = myCenters->GetOutput();
249       myCenters->Update();
250     }
251     myPointsFilter->SetInputData(aDataSet);
252     myPointsFilter->SetPercentsOfUsedPoints(thePercents);
253     aDataSet = myPointsFilter->GetOutput();
254     myPointsFilter->Update();
255     myStream->SetSourceData(aDataSet);
256     myStream->SetIntegrationStepLength(theIntStep);
257     myStream->SetMaximumPropagationTime(thePropogationTime);
258     myStream->SetStepLength(theStepLength);
259     myStream->SetSavePointInterval(theIntStep*aMinNbOfSteps);
260     myStream->SetIntegrationDirection(theDirection);
261     myStream->Modified();
262     Modified();
263   }
264   return anIsAccepted;
265 }
266
267
268 //----------------------------------------------------------------------------
269 vtkPointSet* 
270 VISU_StreamLinesPL
271 ::GetSource() 
272 {
273   return mySource;
274 }
275
276
277 //----------------------------------------------------------------------------
278 double
279 VISU_StreamLinesPL
280 ::GetUsedPoints() 
281 {
282   return myPercents;
283 }
284
285
286 //----------------------------------------------------------------------------
287 vtkDataSet* 
288 VISU_StreamLinesPL
289 ::GetStreamerSource()
290 {
291   return myStream->GetSource();
292 }
293
294
295 //----------------------------------------------------------------------------
296 double 
297 VISU_StreamLinesPL
298 ::GetVelocityCoeff()
299 {
300   return GetVelocityCoeff(GetExtractorFilter()->GetOutput());
301 }
302
303
304 //----------------------------------------------------------------------------
305 double 
306 VISU_StreamLinesPL
307 ::GetVelocityCoeff(vtkDataSet* theDataSet)
308 {
309   double* aScalarRange = theDataSet->GetScalarRange();
310   double aVelocity = (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0;
311   if (aVelocity < EPS)
312     return EPS;
313
314   return aVelocity;
315 }
316
317
318 //----------------------------------------------------------------------------
319 size_t
320 VISU_StreamLinesPL
321 ::IsPossible(vtkPointSet* theDataSet)
322 {
323   double aPercents = GetUsedPointsDefault();
324   double aStepLength = GetBaseStepLength(theDataSet,
325                                                        aPercents);
326   double aBasePropTime = GetBasePropagationTime(theDataSet);
327   VISU_MaskPointsFilter *aPointsFilter = VISU_MaskPointsFilter::New();
328   aPointsFilter->SetInputData(theDataSet);
329   vtkDataSet* aDataSet = aPointsFilter->GetOutput();
330   aPointsFilter->Update();
331   size_t aRes = FindPossibleParams(aDataSet,
332                                    aStepLength,
333                                    aBasePropTime,
334                                    aPercents);
335   aPointsFilter->Delete();
336   return aRes;
337 }
338
339
340 //----------------------------------------------------------------------------
341 double
342 VISU_StreamLinesPL
343 ::GetIntegrationStep()
344 {
345   return myStream->GetIntegrationStepLength();
346 }
347
348
349 //----------------------------------------------------------------------------
350 double
351 VISU_StreamLinesPL
352 ::GetStepLength() 
353 {
354   return myStream->GetStepLength();
355 }
356
357
358 //----------------------------------------------------------------------------
359 double
360 VISU_StreamLinesPL
361 ::GetPropagationTime() 
362 {
363   return myStream->GetMaximumPropagationTime();
364 }
365
366
367 //----------------------------------------------------------------------------
368 int
369 VISU_StreamLinesPL
370 ::GetDirection()
371 {
372   return myStream->GetIntegrationDirection();
373 }
374
375
376 //----------------------------------------------------------------------------
377 double
378 VISU_StreamLinesPL
379 ::GetMinIntegrationStep(vtkDataSet* theDataSet, 
380                         double thePercents) 
381 {
382   if(!theDataSet) 
383     return -1.0;
384
385   int degree = 0;
386   double aVolume = 1.0;
387   double* aBounds = theDataSet->GetBounds();
388   for(int i = 0, j = 0; i < 3; ++i, j = 2*i){
389     double tmp = aBounds[j+1] - aBounds[j];
390     if (tmp > EPS ) {
391       aVolume *= tmp;
392       degree += 1;
393     }
394   }
395
396   if (degree < 1) 
397     return 0.0; // absolutely empty object
398
399   double anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
400   // 0020724: last division has been commented, seems to be a logical mistake (to discuss with APO)
401   double aBasePropTime = GetBasePropagationTime(theDataSet); // /GetVelocityCoeff(theDataSet)
402   thePercents = 1.0;
403   vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
404   double aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
405   size_t aRealSize = GetAvailableMemory(aSize);
406   double anAverageVolume = aVolume / aRealSize;
407   double aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
408   return aStep;
409 }
410
411
412 //----------------------------------------------------------------------------
413 double
414 VISU_StreamLinesPL
415 ::GetMinIntegrationStep()
416 {
417   return GetMinIntegrationStep(GetExtractorFilter()->GetOutput(), GetUsedPoints());
418 }
419
420
421 //----------------------------------------------------------------------------
422 double
423 VISU_StreamLinesPL
424 ::GetMaxIntegrationStep(vtkDataSet* theDataSet) 
425 {
426   if(!theDataSet) 
427     return -1.0;
428
429   double aLength = theDataSet->GetLength();
430   double* aBounds = theDataSet->GetBounds();
431   double aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
432   double aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
433   double aMinMax = (aBounds[1] - aBounds[0])/aLength;
434   if (aMinMax < EPS || (aMaxSizeY < aMinMax && aMaxSizeY > EPS)) 
435     aMinMax = aMaxSizeY;
436   if (aMinMax < EPS || (aMaxSizeZ < aMinMax && aMaxSizeZ > EPS)) 
437     aMinMax = aMaxSizeZ;
438   return aMinMax*aLength/2.0;
439 }
440
441
442 //----------------------------------------------------------------------------
443 double
444 VISU_StreamLinesPL
445 ::GetMaxIntegrationStep()
446 {
447   return GetMaxIntegrationStep(GetExtractorFilter()->GetOutput());
448 }
449
450
451 //----------------------------------------------------------------------------
452 double
453 VISU_StreamLinesPL
454 ::GetBaseIntegrationStep(vtkDataSet* theDataSet, 
455                          double thePercents)
456 {
457   double aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
458   double anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
459   double aMinMax = theDataSet->GetLength() / theDataSet->GetNumberOfPoints();
460   if(aMinMax > anIntegrationStep)
461     anIntegrationStep = (anIntegrationStep*aCoeffOfIntStep*0.9+aMinMax)/aCoeffOfIntStep;
462
463   double aMinIntegrationStep = GetMinIntegrationStep(theDataSet, thePercents);
464   if(aMinIntegrationStep > anIntegrationStep)
465     anIntegrationStep = aMinIntegrationStep;
466
467   return anIntegrationStep;
468 }
469
470
471 //----------------------------------------------------------------------------
472 double
473 VISU_StreamLinesPL
474 ::CorrectIntegrationStep(double theStep, 
475                          vtkDataSet* theDataSet, 
476                          double thePercents)
477 {
478   double aMinIntegrationStep = GetMinIntegrationStep(theDataSet, thePercents);
479   if(aMinIntegrationStep > theStep)
480     theStep = aMinIntegrationStep;
481
482   double aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
483   if(aMaxIntegrationStep < theStep)
484     theStep = aMaxIntegrationStep;
485
486   return theStep;
487 }
488
489
490 //----------------------------------------------------------------------------
491 double
492 VISU_StreamLinesPL
493 ::GetMinPropagationTime(vtkDataSet* theDataSet, 
494                         double thePercents)
495 {
496   if(!theDataSet) 
497     return -1.0;
498
499   return GetMinStepLength(theDataSet, thePercents);
500 }
501
502
503 //----------------------------------------------------------------------------
504 double
505 VISU_StreamLinesPL
506 ::GetMinPropagationTime()
507 {
508   return GetMinPropagationTime(GetExtractorFilter()->GetOutput(), GetUsedPoints());
509 }
510
511
512 //----------------------------------------------------------------------------
513 double
514 VISU_StreamLinesPL
515 ::GetMaxPropagationTime(vtkDataSet* theDataSet)
516 {
517   if(!theDataSet) 
518     return -1.0;
519
520   return GetBasePropagationTime(theDataSet)*aMinNbOfSteps;
521 }
522
523
524 //----------------------------------------------------------------------------
525 double
526 VISU_StreamLinesPL
527 ::GetMaxPropagationTime()
528 {
529   return GetMaxPropagationTime(GetExtractorFilter()->GetOutput());
530 }
531
532
533 //----------------------------------------------------------------------------
534 double
535 VISU_StreamLinesPL
536 ::CorrectPropagationTime(double thePropagationTime, 
537                          vtkDataSet* theDataSet, 
538                          double thePercents)
539 {
540   double aMinPropagationTime = GetMinPropagationTime(theDataSet, thePercents);
541   if(aMinPropagationTime > thePropagationTime)
542     thePropagationTime = aMinPropagationTime;
543
544   double aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
545   if(aMaxPropagationTime < thePropagationTime)
546     thePropagationTime = aMaxPropagationTime;
547
548   return thePropagationTime;
549 }
550
551
552 //----------------------------------------------------------------------------
553 double 
554 VISU_StreamLinesPL
555 ::GetBasePropagationTime(vtkDataSet* theDataSet)
556 {
557   if(!theDataSet) 
558     return -1.0;
559
560   double aPropagationTime = theDataSet->GetLength() / GetVelocityCoeff(theDataSet);
561
562   return aPropagationTime;
563 }
564
565
566 //----------------------------------------------------------------------------
567 double 
568 VISU_StreamLinesPL
569 ::GetBasePropagationTime()
570 {
571   return GetBasePropagationTime(GetExtractorFilter()->GetOutput());
572 }
573
574
575 //----------------------------------------------------------------------------
576 double 
577 VISU_StreamLinesPL
578 ::GetMinStepLength(vtkDataSet* theDataSet, 
579                    double thePercents)
580 {
581   static double aNbOfStepsOfIntStep = 1.0E+1;
582   double anIntStep = GetMinIntegrationStep(theDataSet, thePercents);
583   double aStepLength = anIntStep * aNbOfStepsOfIntStep / GetVelocityCoeff(theDataSet);
584   return aStepLength;
585 }
586
587
588 //----------------------------------------------------------------------------
589 double
590 VISU_StreamLinesPL
591 ::GetMinStepLength()
592 {
593   return GetMinStepLength(GetExtractorFilter()->GetOutput(), GetUsedPoints());
594 }
595
596
597 //----------------------------------------------------------------------------
598 double
599 VISU_StreamLinesPL
600 ::GetMaxStepLength(vtkDataSet* theDataSet)
601 {
602   double aStepLength = GetBasePropagationTime(theDataSet);
603   return aStepLength;
604 }
605
606
607 //----------------------------------------------------------------------------
608 double
609 VISU_StreamLinesPL
610 ::GetMaxStepLength()
611 {
612   return GetMaxStepLength(GetExtractorFilter()->GetOutput());
613 }
614
615
616 //----------------------------------------------------------------------------
617 double
618 VISU_StreamLinesPL
619 ::CorrectStepLength(double theStep, 
620                     vtkDataSet* theDataSet, 
621                     double thePercents)
622 {
623   double aMinStep = GetMinStepLength(theDataSet, thePercents);
624   if(theStep < aMinStep) 
625     theStep = aMinStep;
626
627   double aMaxStep = GetMaxStepLength(theDataSet);
628   if(theStep > aMaxStep) 
629     theStep = aMaxStep;
630
631   return theStep;
632 }
633
634
635 //----------------------------------------------------------------------------
636 double
637 VISU_StreamLinesPL
638 ::GetBaseStepLength(vtkDataSet* theDataSet, 
639                     double thePercents)
640 {
641   static double anAvgNbOfSteps = 1.0E+2;
642   double aPropagationTime = GetBasePropagationTime(theDataSet);
643   double aStepLength = aPropagationTime/anAvgNbOfSteps;
644   aStepLength = CorrectStepLength(aStepLength,theDataSet,thePercents);
645
646   return aStepLength;
647 }
648
649
650 //----------------------------------------------------------------------------
651 double
652 VISU_StreamLinesPL
653 ::GetUsedPointsDefault()
654 {
655   SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
656   return aResourceMgr->doubleValue("VISU", "stream_lines_used_points", 0.01);
657 }
658
659
660 //----------------------------------------------------------------------------
661 void
662 VISU_StreamLinesPL
663 ::Init()
664 {
665   Superclass::Init();
666
667   vtkDataSet* aDataSet = GetExtractorFilter()->GetOutput();
668   double anIntStep = GetBaseIntegrationStep(aDataSet, GetUsedPoints());
669   double aPropagationTime = GetBasePropagationTime(aDataSet);
670   double aStepLength = GetBaseStepLength(aDataSet, GetUsedPoints());
671   SetParams(anIntStep,
672             aPropagationTime,
673             aStepLength,
674             NULL,
675             GetUsedPoints());
676 }
677
678
679 //----------------------------------------------------------------------------
680 void
681 VISU_StreamLinesPL
682 ::Build()
683 {
684   Superclass::Build();
685
686   VISU::CellDataToPoint(myStream,
687                         myCellDataToPointData,
688                         GetMergedInput(),
689                         GetMergedInputPort());
690
691   myGeomFilter->SetInputConnection(myStream->GetOutputPort());
692   myGeomFilter->ExtentClippingOn();
693 }
694
695
696 //----------------------------------------------------------------------------
697 vtkAlgorithmOutput* 
698 VISU_StreamLinesPL
699 ::InsertCustomPL()
700 {
701   return myGeomFilter->GetOutputPort();
702 }
703
704
705 //----------------------------------------------------------------------------
706 void
707 VISU_StreamLinesPL
708 ::Update()
709 {
710   try{
711     Superclass::Update();
712
713     double aBounds[6];
714     GetMergedInput()->GetBounds(aBounds);
715     myGeomFilter->SetExtent(aBounds);
716     //{
717     //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myStream.vtk";
718     //  VISU::WriteToFile(myStream->GetOutput(), aFileName);
719     //}
720   }catch(std::exception& exc){
721     MSG(true, "Follow exception was occured :\n"<<exc.what());
722   }catch(...){
723     MSG(MYDEBUG,"Unknown exception was occured\n");
724   }
725 }
726
727
728 //----------------------------------------------------------------------------
729 unsigned long int
730 VISU_StreamLinesPL
731 ::GetMemorySize()
732 {
733   unsigned long int aSize = Superclass::GetMemorySize();
734
735   if(vtkDataSet* aDataSet = myStream->GetOutput())
736     aSize += aDataSet->GetActualMemorySize() * 1024;
737   
738   if(vtkDataSet* aDataSet = myGeomFilter->GetOutput())
739     aSize += aDataSet->GetActualMemorySize() * 1024;
740
741   if(myCellDataToPointData->GetInput())
742     if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
743       aSize += aDataSet->GetActualMemorySize() * 1024;
744
745   return aSize;
746 }
747
748
749 //----------------------------------------------------------------------------
750 void
751 VISU_StreamLinesPL
752 ::SetMapScale(double theMapScale)
753 {
754   Superclass::SetMapScale(theMapScale);
755 }
756
757
758 //----------------------------------------------------------------------------