]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_PointMap3d_i.cc
Salome HOME
f0533c30c9452035f86ff053b9c759b764c5b3dd
[modules/visu.git] / src / VISU_I / VISU_PointMap3d_i.cc
1 //  Copyright (C) 2007-2008  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 //  VISU OBJECT : interactive object for VISU entities implementation
23 //  File   : VISU_PointMap3d_i.cc
24 //  Author : Dmitry Matveitchev
25 //  Module : VISU
26 //
27 #include "VISU_PointMap3d_i.hh"
28
29 #include "VISU_CutLinesBase_i.hh"
30 #include "VISU_CutSegment_i.hh"
31 #include "VISU_Result_i.hh"
32 #include "VISU_ViewManager_i.hh"
33 #include "VISU_ScalarBarActor.hxx"
34 #include "SUIT_ResourceMgr.h"
35
36 #include "SALOME_Event.h"
37 #include "VISU_Prs3dUtils.hh"
38 #include "SPlot2d_Curve.h"
39 #include "VISU_PipeLineUtils.hxx"
40
41 #include "VISU_TableReader.hxx"
42 #include "VISU_ConvertorUtils.hxx"
43 #include "VISU_DeformedGridPL.hxx"
44
45 #include "SALOME_InteractiveObject.hxx"
46 #include "VISU_Gen_i.hh"
47
48 #include <vtkTextProperty.h>
49 #include <vtkActorCollection.h>
50
51 #include <boost/bind.hpp>
52
53 #ifdef _DEBUG_
54 static int MYDEBUG = 0;
55 #else
56 static int MYDEBUG = 0;
57 #endif
58
59 using namespace std;
60
61 //----------------------------------------------------------------
62 //                      PointMap3d Object
63 //----------------------------------------------------------------
64 int VISU::PointMap3d_i::myNbPresent = 0;
65 const string VISU::PointMap3d_i::myComment  = "POINTMAP3D";
66 /*!
67   Generate unique name
68 */
69 QString VISU::PointMap3d_i::GenerateName()
70 {
71   return VISU::GenerateName( "Table3D - ", ++myNbPresent );
72 }
73 /*!
74   Gets comment string
75 */
76 const char* VISU::PointMap3d_i::GetComment() const
77 {
78   return myComment.c_str();
79 }
80 /*!
81   Constructor
82 */
83 VISU::PointMap3d_i::PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry )
84   : Table_i(theStudy, theObjectEntry),
85   myActorCollection(vtkActorCollection::New()),
86   myIsActiveState(true)
87 {
88   if(MYDEBUG) MESSAGE("PointMap3d_i::PointMap3d_i - this = "<<this);
89   SetStudyDocument(theStudy);
90   mySObj = theStudy->FindObjectID(theObjectEntry);
91   myOffset[0] = myOffset[1] = myOffset[2] = 0;
92   myActorCollection->Delete();
93 }
94 /*!
95   Destructor
96 */
97 VISU::PointMap3d_i::~PointMap3d_i()
98 {
99   if(MYDEBUG) MESSAGE("PointMap3d_i::~PointMap3d_i - this = "<<this);
100 }
101
102 //----------------------------------------------------------------------------
103 namespace VISU
104 {
105   struct TInvokeSignalEvent: public SALOME_Event
106   {
107     typedef boost::signal0<void> TSignal;
108     const TSignal& mySignal;
109     
110     TInvokeSignalEvent(const TSignal& theSignal):
111       mySignal(theSignal)
112     {}
113     
114     virtual
115     void
116     Execute()
117     {
118       mySignal();
119     }
120   };
121 }
122
123 //----------------------------------------------------------------------------
124 void
125 VISU::PointMap3d_i
126 ::SetTitle( const char* theTitle )
127 {
128   SetName( theTitle, true );
129 }
130
131 //----------------------------------------------------------------------------
132 char*
133 VISU::PointMap3d_i
134 ::GetTitle()
135 {
136   return CORBA::string_dup( GetName().c_str() );
137 }
138
139 //----------------------------------------------------------------------------
140 SALOMEDS::SObject_var
141 VISU::PointMap3d_i
142 ::GetSObject() const
143 {
144   return mySObj;
145 }
146
147 //----------------------------------------------------------------------------
148 std::string
149 VISU::PointMap3d_i
150 ::GetObjectEntry() 
151 {
152   CORBA::String_var anEntry = mySObj->GetID();
153   return anEntry.in(); 
154 }
155
156 //----------------------------------------------------------------------------
157 Handle(SALOME_InteractiveObject)
158 VISU::PointMap3d_i
159 ::GetIO()
160 {
161   if( myIO.IsNull() )
162     myIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
163
164   return myIO;
165 }
166
167 //----------------------------------------------------------------------------
168 /*!
169   Creates table3d object
170 */
171 VISU::Storable* VISU::PointMap3d_i::Create()
172 {
173   // generate name ...
174   SetName(GetTableTitle().toLatin1().constData(), false);
175
176   if ( GetName() == "" ) {
177     if ( !mySObj->_is_nil() ) {
178       CutLinesBase_i* pCutLines = NULL;
179       CORBA::Object_var anObj = SObjectToObject(mySObj);
180       if(!CORBA::is_nil(anObj)){
181         VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj);
182         if(!aCutLines->_is_nil())
183           pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
184       }
185       if (!pCutLines)
186         if (mySObj->GetName()) SetName(mySObj->GetName(), false);
187     }
188   }
189
190   if ( GetName() == "" )
191     SetName(GenerateName().toLatin1().constData(), false);
192
193   // Create Pipeline
194   myTablePL = VISU_DeformedGridPL::New();
195   myTablePL->SetPolyDataIDMapper(GetTableIDMapper());
196   myTablePL->Update();
197
198   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
199
200   bool isUnits = aResourceMgr->booleanValue( "VISU", "scalar_bar_display_units", true );
201   SetUnitsVisible(isUnits);
202
203   SetSourceRange();
204
205   if( aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false) )
206     SetScaling(VISU::LOGARITHMIC);
207   else
208     SetScaling(VISU::LINEAR);
209
210   int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 );
211   SetNbColors(aNumberOfColors);
212
213   int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
214   UseFixedRange(aRangeType == 1);
215   if(aRangeType == 1){
216     float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
217     float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
218     SetRange(aMin, aMax);
219   }
220
221   int lp = aResourceMgr->integerValue( "VISU", "scalar_bar_label_precision", 3 );
222   SetLabelsFormat( VISU::ToFormat( lp ).c_str() );
223
224   // Orientation
225   int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0);
226   if(anOrientation == 1)
227     SetBarOrientation(VISU::ColoredPrs3dBase::HORIZONTAL);
228   else
229     SetBarOrientation(VISU::ColoredPrs3dBase::VERTICAL);
230
231   // Scalar Bar origin
232   QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
233
234   vtkFloatingPointType aXorigin = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.01 : 0.2;
235   aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
236   myPosition[0] = aXorigin;
237
238   vtkFloatingPointType aYorigin = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.1 : 0.012;
239   aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
240   myPosition[1] = aYorigin;
241
242   // Scalar Bar size
243   myWidth = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.1 : 0.6;
244   myWidth = aResourceMgr->doubleValue("VISU", propertyName + "width", myWidth);
245
246   myHeight = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.8:0.12;
247   myHeight = aResourceMgr->doubleValue("VISU", propertyName + "height", myHeight);
248
249   myTitleSize = aResourceMgr->doubleValue("VISU", propertyName + "title_size", 0);
250   myLabelSize = aResourceMgr->doubleValue("VISU", propertyName + "label_size", 0);
251   myBarWidth = aResourceMgr->doubleValue("VISU", propertyName + "bar_width", 0);
252   myBarHeight = aResourceMgr->doubleValue("VISU", propertyName + "bar_height", 0);
253
254   // Nb of Labels
255   myNumberOfLabels = aResourceMgr->integerValue( "VISU", "scalar_bar_num_labels", 5 );
256
257   // Fonts properties definition
258   myIsBoldTitle = myIsItalicTitle = myIsShadowTitle = true;
259   myTitFontType = VTK_ARIAL;
260
261   if(aResourceMgr->hasValue( "VISU", "scalar_bar_title_font" )){
262     QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_title_font" );
263     if ( f.family() == "Arial" )
264       myTitFontType = VTK_ARIAL;
265     else if ( f.family() == "Courier" )
266       myTitFontType = VTK_COURIER;
267     else if ( f.family() == "Times" )
268       myTitFontType = VTK_TIMES;
269     
270     myIsBoldTitle   = f.bold();
271     myIsItalicTitle = f.italic();
272     myIsShadowTitle =  f.overline();
273   }
274
275   QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
276
277   myTitleColor[0] = aTextColor.red()   / 255;
278   myTitleColor[1] = aTextColor.green() / 255;
279   myTitleColor[2] = aTextColor.blue()  / 255;
280
281   myIsBoldLabel = myIsItalicLabel = myIsShadowLabel = true;
282   myLblFontType = VTK_ARIAL;
283
284   if( aResourceMgr->hasValue( "VISU", "scalar_bar_label_font" )){
285     QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_label_font" );
286     if ( f.family() == "Arial" )
287       myLblFontType = VTK_ARIAL;
288     else if ( f.family() == "Courier" )
289       myLblFontType = VTK_COURIER;
290     else if ( f.family() == "Times" )
291       myLblFontType = VTK_TIMES;
292     
293     myIsBoldLabel   = f.bold();
294     myIsItalicLabel = f.italic();
295     myIsShadowLabel =  f.overline();
296   }
297
298   QColor aLabelColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
299
300   myLabelColor[0] = aLabelColor.red()   / 255;
301   myLabelColor[1] = aLabelColor.green() / 255;
302   myLabelColor[2] = aLabelColor.blue()  / 255;
303
304   // scalar bar default position
305   bool anIsArrangeBar = aResourceMgr->booleanValue("VISU", "scalar_bars_default_position", 0);
306   int aPlace = 1;
307   if (anIsArrangeBar){
308     aPlace = aResourceMgr->integerValue("VISU", "scalar_bar_position_num",0);
309   }
310   if(myBarOrientation == VISU::ColoredPrs3dBase::HORIZONTAL){
311     myPosition[1] += myHeight*(aPlace-1);
312   } else {
313     myPosition[0] += myWidth*(aPlace-1);
314   }
315
316   return Build( false );
317 }
318
319 /*
320   GetIDMapper
321 */
322
323 VISU::PTableIDMapper
324 VISU::PointMap3d_i
325 ::GetTableIDMapper()
326 {
327   //Initialisate table mapper
328   SALOMEDS::GenericAttribute_var anAttr;
329   mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
330   SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
331
332   PTableIDMapper aTableIDMapper( new TTableIDMapper() );
333   TTable2D& aTable2D = *aTableIDMapper;
334
335   aTable2D.myTitle = aTableOfReal->GetTitle();
336
337   SALOMEDS::StringSeq_var aColStrList = aTableOfReal->GetColumnTitles();
338   SALOMEDS::StringSeq_var aRowStrList = aTableOfReal->GetRowTitles();
339
340   for ( int i = 0; i < aRowStrList->length(); i++ ) {
341     aTable2D.myColumnTitles.push_back( aRowStrList[ i ].in() );
342   }
343
344   int aCols = aTableOfReal->GetNbColumns();
345   int aRows = aTableOfReal->GetNbRows();
346
347   for (int i=1; i<=aCols; i++) {
348     TTable2D::TRow aRow;
349     aRow.myTitle = aColStrList[ i-1 ].in();
350     for (int j=1; j<=aRows; j++) {
351       double aVal = aTableOfReal->GetValue(j, i);
352       QString aValStr = QString::number(aVal);
353       aRow.myValues.push_back( aValStr.toLatin1().constData() );
354     }
355     if( aRow.myValues.size() > 0 )
356       aTable2D.myRows.push_back( aRow );
357   }
358
359   return aTableIDMapper;
360 }
361
362 /*
363   Create Actor
364 */
365 VISU_PointMap3dActor* VISU::PointMap3d_i::CreateActor()
366 {
367   VISU_PointMap3dActor* anActor = VISU_PointMap3dActor::New();
368   anActor->SetPipeLine(myTablePL);
369   anActor->SetFactory(this);
370
371   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
372   int  aDispMode = aResourceMgr->integerValue("VISU", "point_map_represent", 2);
373   bool toShrink  = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false);
374   anActor->SetRepresentation(aDispMode);
375   if (toShrink) anActor->SetShrink();
376
377   Handle (SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
378   anActor->setIO(anIO);
379
380   myUpdateActorsSignal.connect(boost::bind(&VISU_Actor::UpdateFromFactory,anActor));
381   //  myRemoveActorsFromRendererSignal.connect(boost::bind(&VISU_Actor::RemoveFromRender,anActor));
382
383   myActorCollection->AddItem(anActor);
384
385   UpdateActor( anActor );
386
387   return anActor;
388 }
389
390 /*
391   Update Actor
392 */
393 void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor)
394 {
395   if(VISU_PointMap3dActor* anActor = dynamic_cast<VISU_PointMap3dActor*>(theActor)){
396     Update();
397     VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
398     aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable());
399     aScalarBar->SetTitle(GetTitle());
400     aScalarBar->SetOrientation(GetBarOrientation());
401     aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
402     aScalarBar->GetPositionCoordinate()->SetValue(GetPosX(),GetPosY());
403     aScalarBar->SetWidth(GetWidth());
404     aScalarBar->SetHeight(GetHeight());
405     aScalarBar->SetNumberOfLabels(GetLabels());
406     aScalarBar->SetRatios(myTitleSize, myLabelSize, 
407                           myBarWidth, myBarHeight);
408     aScalarBar->SetNumberOfLabels(GetLabels());
409     aScalarBar->SetLabelFormat(GetLabelsFormat());
410
411     vtkFloatingPointType anRGB[3];
412
413     vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
414     aTitleProp->SetFontFamily(GetTitFontType());
415
416     GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
417     aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
418
419     IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
420     IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
421     IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
422
423     vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
424     aLabelProp->SetFontFamily(GetLblFontType());
425
426     GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
427     aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
428
429     IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
430     IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
431     IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
432
433     aScalarBar->Modified();
434   }
435   theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
436 }
437
438 void
439 VISU::PointMap3d_i
440 ::UpdateActors()
441 {
442   if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "<<this);
443   ProcessVoidEvent(new TVoidMemFunEvent<VISU_PipeLine>
444                    (GetSpecificPL(), &VISU_PipeLine::Update));
445
446   ProcessVoidEvent(new VISU::TInvokeSignalEvent(myUpdateActorsSignal));
447 }
448
449 //----------------------------------------------------------------------------
450 void
451 VISU::PointMap3d_i
452 ::Update()
453 {
454   if(GetMTime() < myUpdateTime.GetMTime())
455     return;
456
457   if(MYDEBUG) MESSAGE("PointMap3d_i::Update - this = "<<this);
458
459   try{
460     ProcessVoidEvent(new TVoidMemFunEvent<VISU_PipeLine>
461                      (GetSpecificPL(), &VISU_PipeLine::Update));
462     myUpdateTime.Modified();
463   }catch(std::exception&){
464     throw;
465   }catch(...){
466     throw std::runtime_error("PointMap3d_i::Update >> unexpected exception was caught!!!");
467   }
468 }
469
470 //----------------------------------------------------------------------------
471 unsigned long int 
472 VISU::PointMap3d_i
473 ::GetMTime()
474 {
475   unsigned long int aTime = myParamsTime.GetMTime();
476   if( GetSpecificPL() )
477     aTime = std::max(aTime, GetSpecificPL()->GetMTime());
478   return aTime;
479 }
480
481 /*!
482   Builds presentation of table
483 */
484 VISU::Storable* VISU::PointMap3d_i::Build( int theRestoring )
485 {
486
487   // look for reference SObject with table attribute
488   SALOMEDS::SObject_var SO = mySObj;
489
490   if ( !SO->_is_nil() ) {
491     CutLinesBase_i* pCutLines = NULL;
492     CORBA::Object_var anObj = SObjectToObject(SO);
493     if(!CORBA::is_nil(anObj)){
494       VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj);
495       if(!aCutLines->_is_nil())
496         pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
497     }
498     SALOMEDS::Study_var aStudy = GetStudyDocument();
499     SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
500     SALOMEDS::GenericAttribute_var anAttr;
501     // look for component
502     if ( !theRestoring ) {
503       SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
504       // create SObject and set attributes
505       QString aComment;
506       if(pCutLines)
507         aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
508       else{
509         aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
510         SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
511         if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
512           SALOMEDS::AttributeString_var aCommentAttr =
513             SALOMEDS::AttributeString::_narrow(anAttr);
514           CORBA::String_var aValue = aCommentAttr->Value();
515           Storable::TRestoringMap aMap;
516           Storable::StringToMap(aValue.in(),aMap);
517           bool anIsExist;
518           QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
519           if(anIsExist){
520             if(aMethodName == "ImportTables"){
521               aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
522             }
523           }
524         }
525       }
526
527       string anEntry = CreateAttributes( GetStudyDocument(),
528                                          SO->GetID(),//SComponent->GetID(),
529                                          "ICON_TREE_TABLE",
530                                          GetID(),
531                                          GetName(),
532                                          "",
533                                          aComment.toLatin1().constData(),
534                                          pCutLines );
535       // create SObject referenced to real table object
536       mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
537       if(pCutLines) {
538         bool isCutSegment = dynamic_cast<CutSegment_i*>(pCutLines);
539         pCutLines->BuildTableOfReal(mySObj, isCutSegment);
540       }
541       // mpv (PAL5357): reference attributes are unnecessary now
542       //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
543       //Builder->Addreference( refSO, SO );
544     }
545
546     return this;
547   }
548   return NULL;
549 }
550 /*!
551   Restores table object from stream
552 */
553 VISU::Storable* VISU::PointMap3d_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
554 {
555   VISU::Table_i::Restore( theMap, SO);
556   if(MYDEBUG) MESSAGE(GetComment());
557   SetName(VISU::Storable::FindValue(theMap,"myName").toLatin1().constData(), false);
558   myTitle = VISU::Storable::FindValue(theMap,"myTitle").toLatin1().constData();
559   myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() );
560   mySObj = SALOMEDS::SObject::_duplicate(SO);
561
562   //Create PipeLine
563   myTablePL = VISU_DeformedGridPL::New();
564   myTablePL->SetPolyDataIDMapper(GetTableIDMapper());
565   myTablePL->Update();
566
567   //Restore Other Values
568   
569   float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
570   float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
571   SetRange(aMin, aMax);
572
573   UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange", "0").toInt());
574
575   SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
576   SetUnitsVisible(VISU::Storable::FindValue(theMap,"myUnitsVisible", "1").toInt());
577   SetLabelsFormat(VISU::Storable::FindValue(theMap,"myLabelsFormat", "%-#6.3g").toLatin1().constData());
578   SetBarOrientation((VISU::ColoredPrs3dBase::Orientation)VISU::Storable::FindValue(theMap,"myBarOrientation").toInt());
579
580   SetTitle(VISU::Storable::FindValue(theMap,"myTitle").toLatin1().constData());
581   myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
582   myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
583   myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
584   myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
585   myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
586   myTitleSize = VISU::Storable::FindValue(theMap,"myTitleSize").toInt();
587   myLabelSize = VISU::Storable::FindValue(theMap,"myLabelSize").toInt();
588   myBarWidth = VISU::Storable::FindValue(theMap,"myBarWidth").toInt();
589   myBarHeight = VISU::Storable::FindValue(theMap,"myBarHeight").toInt();
590
591   myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
592   myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
593   myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
594   myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
595   myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
596   myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
597   myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
598
599   myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
600   myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
601   myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
602   myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
603   myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
604   myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
605   myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
606
607   myParamsTime.Modified();
608   return Build( true );
609 }
610 /*!
611   Flushes table data into stream
612 */
613 void VISU::PointMap3d_i::ToStream( std::ostringstream& theStr )
614 {
615   Storable::DataToStream( theStr, "myName",        GetName().c_str() );
616   Storable::DataToStream( theStr, "myTitle",       myTitle.c_str() );
617   Storable::DataToStream( theStr, "myOrientation", myOrientation );
618
619   Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
620   Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
621   Storable::DataToStream( theStr, "myIsFixedRange",   IsRangeFixed() );
622
623   Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
624   Storable::DataToStream( theStr, "myBarOrientation", myBarOrientation );
625
626   Storable::DataToStream( theStr, "myTitle",          myTitle.c_str() );
627   Storable::DataToStream( theStr, "myUnitsVisible",   myIsUnits );
628   Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
629   Storable::DataToStream( theStr, "myLabelsFormat",   myLabelsFormat.c_str() );
630   Storable::DataToStream( theStr, "myPosition[0]",    myPosition[0] );
631   Storable::DataToStream( theStr, "myPosition[1]",    myPosition[1] );
632   Storable::DataToStream( theStr, "myWidth",          myWidth );
633   Storable::DataToStream( theStr, "myHeight",         myHeight );
634   Storable::DataToStream( theStr, "myTitleSize",      myTitleSize );
635   Storable::DataToStream( theStr, "myLabelSize",     myLabelSize );
636   Storable::DataToStream( theStr, "myBarWidth",       myBarWidth );
637   Storable::DataToStream( theStr, "myBarHeight",      myBarHeight );
638
639   Storable::DataToStream( theStr, "myTitFontType",    myTitFontType );
640   Storable::DataToStream( theStr, "myIsBoldTitle",    myIsBoldTitle );
641   Storable::DataToStream( theStr, "myIsItalicTitle",  myIsItalicTitle );
642   Storable::DataToStream( theStr, "myIsShadowTitle",  myIsShadowTitle );
643   Storable::DataToStream( theStr, "myTitleColor[0]",  myTitleColor[0] );
644   Storable::DataToStream( theStr, "myTitleColor[1]",  myTitleColor[1] );
645   Storable::DataToStream( theStr, "myTitleColor[2]",  myTitleColor[2] );
646
647   Storable::DataToStream( theStr, "myLblFontType",    myLblFontType );
648   Storable::DataToStream( theStr, "myIsBoldLabel",    myIsBoldLabel );
649   Storable::DataToStream( theStr, "myIsItalicLabel",  myIsItalicLabel );
650   Storable::DataToStream( theStr, "myIsShadowLabel",  myIsShadowLabel );
651   Storable::DataToStream( theStr, "myLabelColor[0]",  myLabelColor[0] );
652   Storable::DataToStream( theStr, "myLabelColor[1]",  myLabelColor[1] );
653   Storable::DataToStream( theStr, "myLabelColor[2]",  myLabelColor[2] );
654 }
655 /*!
656   Called from engine to restore table from the file
657 */
658 VISU::Storable* VISU::PointMap3d_i::StorableEngine(SALOMEDS::SObject_ptr theSObject,
659                                                    const Storable::TRestoringMap& theMap,
660                                                    const std::string& thePrefix,
661                                                    CORBA::Boolean theIsMultiFile)
662 {
663   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
664   VISU::PointMap3d_i* pResent = new VISU::PointMap3d_i( aStudy, "" );
665   return pResent->Restore( theMap, theSObject);
666 }
667 /*!
668   Gets title for the original table object
669 */
670 QString VISU::PointMap3d_i::GetTableTitle()
671 {
672   SALOMEDS::SObject_var SO = mySObj;
673   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
674   SALOMEDS::GenericAttribute_var        anAttr;
675   SALOMEDS::AttributeTableOfInteger_var anInt;
676   SALOMEDS::AttributeTableOfReal_var    aReal;
677   if ( !SO->_is_nil() ) {
678     if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
679       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
680       CORBA::String_var aString = anInt->GetTitle();
681       return aString.in();
682     }
683     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
684       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
685       CORBA::String_var aString = aReal->GetTitle();
686       return aString.in();
687     }
688   }
689   return "";
690 }
691
692 //---------------------------------------------------------------
693 void VISU::PointMap3d_i::RemoveFromStudy()
694 {
695   struct TRemoveFromStudy: public SALOME_Event
696   {
697     VISU::PointMap3d_i* myRemovable;
698     TRemoveFromStudy(VISU::PointMap3d_i* theRemovable):
699       myRemovable(theRemovable)
700     {}
701     
702     virtual
703     void
704     Execute()
705     {
706       VISU::RemoveFromStudy(myRemovable->GetSObject(),false);
707     }
708   };
709
710   // Remove the table with all curves
711   ProcessVoidEvent(new TRemoveFromStudy(this));
712 }
713
714 //----------------------------------------------------------------
715 void VISU::PointMap3d_i::SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz)
716 {
717   myOffset[0] = theDx;
718   myOffset[1] = theDy;
719   myOffset[2] = theDz;
720   myParamsTime.Modified();
721 }
722
723 void VISU::PointMap3d_i::GetOffset(CORBA::Float& theDx, CORBA::Float& theDy, CORBA::Float& theDz)
724 {
725   theDx = myOffset[0];
726   theDy = myOffset[1];
727   theDz = myOffset[2];
728 }
729
730 CORBA::Float VISU::PointMap3d_i::GetMemorySize()
731 {
732   CORBA::Float aSize = GetSpecificPL()->GetMemorySize();
733
734   int anEnd = myActorCollection->GetNumberOfItems();
735   for(int anId = 0; anId < anEnd; anId++)
736     if(vtkObject* anObject = myActorCollection->GetItemAsObject(anId))
737       if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anObject)){
738         aSize += anActor->GetMemorySize();
739         //cout<<"Prs3d_i::GetMemorySize - "<<this<<"; anActor = "<<aSize / (1024.0 * 1024.0)<<endl;
740       }
741
742   // Convert to mega bytes
743   return aSize / (1024.0 * 1024.0);
744 }
745
746 //------------------ ColoredPrs3dBase Methods --------------------
747 CORBA::Double VISU::PointMap3d_i::GetMin()
748 {
749   return myTablePL->GetScalarRange()[0];
750 }
751
752 CORBA::Double VISU::PointMap3d_i::GetMinTableValue()
753 {
754   SALOMEDS::GenericAttribute_var anAttr;
755   mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
756   SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
757   double aMin = aTableOfReal->GetValue(1, 1);
758   
759   for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
760     for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
761       double aVal = aTableOfReal->GetValue(j, i);
762       if (aVal < aMin)
763         aMin = aVal;
764     }
765   
766   return aMin;
767 }
768
769 CORBA::Double VISU::PointMap3d_i::GetMaxTableValue()
770 {
771   SALOMEDS::GenericAttribute_var anAttr;
772   mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
773   SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
774   double aMax = aTableOfReal->GetValue(1, 1);
775
776   for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
777     for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
778       double aVal = aTableOfReal->GetValue(j, i);
779       if (aVal > aMax)
780         aMax = aVal;
781     }
782
783   return aMax;
784 }
785
786 CORBA::Double VISU::PointMap3d_i::GetMax()
787 {
788   return myTablePL->GetScalarRange()[1];
789 }
790
791 void VISU::PointMap3d_i::SetRange(CORBA::Double theMin, CORBA::Double theMax)
792 {
793   vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
794   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, vtkFloatingPointType*>
795                    (GetSpecificPL(), &VISU_DeformedGridPL::SetScalarRange, aScalarRange));
796
797   UseFixedRange(true);
798 }
799
800 CORBA::Double VISU::PointMap3d_i::GetSourceMin()
801 {
802   vtkFloatingPointType aRange[2];
803   GetSpecificPL()->GetSourceRange(aRange);
804   return aRange[0];
805 }
806
807 CORBA::Double VISU::PointMap3d_i::GetSourceMax()
808 {
809   vtkFloatingPointType aRange[2];
810   GetSpecificPL()->GetSourceRange(aRange);
811   return aRange[1];
812 }
813
814 void VISU::PointMap3d_i::SetSourceRange()
815 {
816   GetSpecificPL()->SetSourceRange();
817   ProcessVoidEvent(new TVoidMemFunEvent<VISU_DeformedGridPL>
818                    (GetSpecificPL(), &VISU_DeformedGridPL::SetSourceRange));
819
820   UseFixedRange(false);
821 }
822
823 CORBA::Boolean VISU::PointMap3d_i::IsRangeFixed()
824 {
825   return myIsFixedRange; 
826 }
827
828 void VISU::PointMap3d_i::UseFixedRange(bool theRange)
829 {
830   if(myIsFixedRange == theRange)
831     return;
832
833   myIsFixedRange = theRange;
834 }
835
836 void VISU::PointMap3d_i::SetPosition(CORBA::Double theX, CORBA::Double theY)
837 {
838   bool anIsSameValue = VISU::CheckIsSameValue(myPosition[0], theX);
839   anIsSameValue &= VISU::CheckIsSameValue(myPosition[1], theY);
840   if(anIsSameValue)
841     return;
842
843   myPosition[0] = theX; 
844   myPosition[1] = theY;
845   myParamsTime.Modified();
846 }
847
848 CORBA::Double VISU::PointMap3d_i::GetPosX()
849 {
850   return myPosition[0];
851 }
852
853 CORBA::Double VISU::PointMap3d_i::GetPosY()
854 {
855   return myPosition[1];
856 }
857
858 void VISU::PointMap3d_i::SetSize(CORBA::Double theWidth, CORBA::Double theHeight)
859 {
860   bool anIsSameValue = VISU::CheckIsSameValue(myWidth, theWidth);
861   anIsSameValue &= VISU::CheckIsSameValue(myHeight, theHeight);
862   if(anIsSameValue)
863     return;
864
865   myWidth = theWidth; 
866   myHeight = theHeight;
867   myParamsTime.Modified();
868 }
869
870 CORBA::Double VISU::PointMap3d_i::GetHeight()
871 {
872   return myHeight;
873 }
874
875 CORBA::Double VISU::PointMap3d_i::GetWidth()
876 {
877   return myWidth;
878 }
879
880 void VISU::PointMap3d_i::SetNbColors(CORBA::Long theNbColors)
881 {
882   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
883                    (GetSpecificPL(), &VISU_DeformedGridPL::SetNbColors, theNbColors));
884 }
885
886 CORBA::Long VISU::PointMap3d_i::GetNbColors()
887 {
888   return GetSpecificPL()->GetNbColors();
889 }
890
891 void VISU::PointMap3d_i::SetLabels(CORBA::Long theNbLabels)
892 {
893   if(myNumberOfLabels == theNbLabels)
894     return;
895
896   myNumberOfLabels = theNbLabels;
897 }
898
899 CORBA::Long VISU::PointMap3d_i::GetLabels()
900 {
901   return myNumberOfLabels;
902 }
903
904 void VISU::PointMap3d_i::SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theBarOrientation)
905 {
906   if(myBarOrientation == theBarOrientation)
907     return;
908
909   if ( ( theBarOrientation == VISU::ColoredPrs3dBase::VERTICAL && myHeight < myWidth ) ||
910        ( theBarOrientation == VISU::ColoredPrs3dBase::HORIZONTAL && myHeight > myWidth ) ) {
911     vtkFloatingPointType tmp = myHeight;
912     myHeight = myWidth;
913     myWidth = tmp;
914   }
915
916   myBarOrientation = theBarOrientation;
917   myParamsTime.Modified();
918 }
919
920 VISU::ColoredPrs3dBase::Orientation VISU::PointMap3d_i::GetBarOrientation()
921 {
922   return myBarOrientation;
923 }
924
925 //------------------- ScaledPrs3d Methods -----------------------
926
927 void VISU::PointMap3d_i::SetScaling(VISU::Scaling theScaling)
928 {
929   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
930                    (GetSpecificPL(), &VISU_DeformedGridPL::SetScaling, theScaling));
931 }
932
933 VISU::Scaling VISU::PointMap3d_i::GetScaling()
934 {
935   return VISU::Scaling(GetSpecificPL()->GetScaling());
936 }
937
938 //------------------- Check Table on Positive Values ------------
939 bool VISU::PointMap3d_i::IsPositiveTable()
940 {
941   SALOMEDS::GenericAttribute_var anAttr;
942   mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
943   SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
944
945   for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
946     for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
947       double aVal = aTableOfReal->GetValue(j, i);
948       if (aVal < 0)
949         return false;
950     }
951
952   return true;
953 }
954
955 //------------------- Plot3dBase Methods ------------------------
956
957 void VISU::PointMap3d_i::SetScaleFactor (CORBA::Double theScaleFactor)
958 {
959   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, vtkFloatingPointType>
960                    (GetSpecificPL(), &VISU_DeformedGridPL::SetScaleFactor, theScaleFactor));
961 }
962
963 CORBA::Double VISU::PointMap3d_i::GetScaleFactor ()
964 {
965   return myTablePL->GetScaleFactor();
966 }
967
968 void VISU::PointMap3d_i::SetContourPrs (CORBA::Boolean theIsContourPrs )
969 {
970   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, bool>
971                    (GetSpecificPL(), &VISU_DeformedGridPL::SetContourPrs, theIsContourPrs));
972 }
973
974 CORBA::Boolean VISU::PointMap3d_i::GetIsContourPrs()
975 {
976   return myTablePL->GetIsContourPrs();
977 }
978
979 void VISU::PointMap3d_i::SetNbOfContours (CORBA::Long theNb)
980 {
981   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
982                    (GetSpecificPL(), &VISU_DeformedGridPL::SetNumberOfContours, theNb));
983 }
984
985 CORBA::Long VISU::PointMap3d_i::GetNbOfContours ()
986 {
987   return myTablePL->GetNumberOfContours();
988 }
989
990 //-------------------- Actor Factory Methods --------------------
991
992 bool VISU::PointMap3d_i::GetActiveState ()
993 {
994   return myIsActiveState;
995 }
996
997 void VISU::PointMap3d_i::SetActiveState ( bool theState )
998 {
999   myIsActiveState = theState;
1000 }
1001
1002 void VISU::PointMap3d_i::RemoveActor (VISU_ActorBase* theActor)
1003 {
1004   myActorCollection->RemoveItem(theActor);
1005 }
1006
1007 void VISU::PointMap3d_i::RemoveActors ()
1008 {
1009   ProcessVoidEvent(new TInvokeSignalEvent(myRemoveActorsFromRendererSignal));
1010   myActorCollection->RemoveAllItems();
1011 }
1012
1013
1014 //-----------------------Text Properties & Label Properties------------------
1015 bool VISU::PointMap3d_i::IsBoldTitle() 
1016
1017   return myIsBoldTitle;
1018 }
1019
1020 //----------------------------------------------------------------------------
1021 void VISU::PointMap3d_i::SetBoldTitle(bool theIsBoldTitle)
1022 {
1023   if(myIsBoldTitle == theIsBoldTitle)
1024     return;
1025
1026   myIsBoldTitle = theIsBoldTitle;
1027   myParamsTime.Modified();
1028 }
1029
1030 //----------------------------------------------------------------------------
1031 bool VISU::PointMap3d_i::IsItalicTitle() 
1032
1033   return myIsItalicTitle;
1034 }
1035
1036 //----------------------------------------------------------------------------
1037 void VISU::PointMap3d_i::SetItalicTitle(bool theIsItalicTitle)
1038
1039   if(myIsItalicTitle == theIsItalicTitle)
1040     return;
1041
1042   myIsItalicTitle = theIsItalicTitle;
1043   myParamsTime.Modified();
1044 }
1045
1046 //----------------------------------------------------------------------------
1047 bool VISU::PointMap3d_i::IsShadowTitle() 
1048
1049   return myIsShadowTitle;
1050 }
1051
1052 //----------------------------------------------------------------------------
1053 void VISU::PointMap3d_i::SetShadowTitle(bool theIsShadowTitle)
1054
1055   if(myIsShadowTitle == theIsShadowTitle)
1056     return;
1057
1058   myIsShadowTitle = theIsShadowTitle;
1059   myParamsTime.Modified();
1060 }
1061
1062 //----------------------------------------------------------------------------
1063 int VISU::PointMap3d_i::GetTitFontType()
1064 {
1065   return myTitFontType;
1066 }
1067
1068 //----------------------------------------------------------------------------
1069 void VISU::PointMap3d_i::SetTitFontType(int theTitFontType)
1070 {
1071   if(myTitFontType == theTitFontType)
1072     return;
1073
1074   myTitFontType = theTitFontType;
1075   myParamsTime.Modified();
1076 }
1077
1078 //----------------------------------------------------------------------------
1079 void VISU::PointMap3d_i::GetTitleColor(vtkFloatingPointType& theR, 
1080                                          vtkFloatingPointType& theG, 
1081                                          vtkFloatingPointType& theB)
1082 {
1083   theR = myTitleColor[0]; 
1084   theG = myTitleColor[1]; 
1085   theB = myTitleColor[2];
1086 }
1087
1088 //----------------------------------------------------------------------------
1089 void VISU::PointMap3d_i::SetTitleColor(vtkFloatingPointType theR, 
1090                                          vtkFloatingPointType theG, 
1091                                          vtkFloatingPointType theB)
1092 {
1093   bool anIsSameValue = VISU::CheckIsSameValue(myTitleColor[0], theR);
1094   anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[1], theG);
1095   anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[2], theB);
1096   if(anIsSameValue)
1097     return;
1098
1099   myTitleColor[0] = theR; 
1100   myTitleColor[1] = theG; 
1101   myTitleColor[2] = theB; 
1102   myParamsTime.Modified();
1103 }
1104
1105 //----------------------------------------------------------------------------
1106 bool VISU::PointMap3d_i::IsBoldLabel()
1107 {
1108   return myIsBoldLabel;
1109 }
1110
1111 //----------------------------------------------------------------------------
1112 void VISU::PointMap3d_i::SetBoldLabel(bool theIsBoldLabel) 
1113 {
1114   if(myIsBoldLabel == theIsBoldLabel)
1115     return;
1116
1117   myIsBoldLabel = theIsBoldLabel;
1118   myParamsTime.Modified();
1119 }
1120
1121 //----------------------------------------------------------------------------
1122 bool VISU::PointMap3d_i::IsItalicLabel() 
1123 {
1124   return myIsItalicLabel;
1125 }
1126
1127 //----------------------------------------------------------------------------
1128 void VISU::PointMap3d_i::SetItalicLabel(bool theIsItalicLabel)
1129 {
1130   if(myIsItalicLabel == theIsItalicLabel)
1131     return;
1132
1133   myIsItalicLabel = theIsItalicLabel;
1134   myParamsTime.Modified();
1135 }
1136
1137 //----------------------------------------------------------------------------
1138 bool VISU::PointMap3d_i::IsShadowLabel() 
1139 {
1140   return myIsShadowLabel;
1141 }
1142
1143 //----------------------------------------------------------------------------
1144 void VISU::PointMap3d_i::SetShadowLabel(bool theIsShadowLabel)
1145 {
1146   if(myIsShadowLabel == theIsShadowLabel)
1147     return;
1148
1149   myIsShadowLabel = theIsShadowLabel;
1150   myParamsTime.Modified();
1151 }
1152
1153 //----------------------------------------------------------------------------
1154 int VISU::PointMap3d_i::GetLblFontType()
1155 {
1156   return myLblFontType;
1157 }
1158
1159 //----------------------------------------------------------------------------
1160 void VISU::PointMap3d_i::SetLblFontType(int theLblFontType)
1161 {
1162   if(myLblFontType == theLblFontType)
1163     return;
1164
1165   myLblFontType = theLblFontType;
1166   myParamsTime.Modified();
1167 }
1168
1169 //----------------------------------------------------------------------------
1170 void VISU::PointMap3d_i::GetLabelColor(vtkFloatingPointType& theR, 
1171                                   vtkFloatingPointType& theG, 
1172                                   vtkFloatingPointType& theB)
1173 {
1174   theR = myLabelColor[0]; 
1175   theG = myLabelColor[1]; 
1176   theB = myLabelColor[2];
1177 }
1178
1179 //----------------------------------------------------------------------------
1180 void VISU::PointMap3d_i::SetLabelColor(vtkFloatingPointType theR, 
1181                                   vtkFloatingPointType theG, 
1182                                   vtkFloatingPointType theB)
1183 {
1184   bool anIsSameValue = VISU::CheckIsSameValue(myLabelColor[0], theR);
1185   anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[1], theG);
1186   anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[2], theB);
1187   if(anIsSameValue)
1188     return;
1189
1190   myLabelColor[0] = theR; 
1191   myLabelColor[1] = theG; 
1192   myLabelColor[2] = theB; 
1193   myParamsTime.Modified();
1194 }
1195
1196 //----------------------------------------------------------------------------
1197 CORBA::Long VISU::PointMap3d_i::GetTitleSize() 
1198 {
1199   return myTitleSize;
1200 }
1201
1202 //----------------------------------------------------------------------------
1203 CORBA::Long VISU::PointMap3d_i::GetLabelSize() 
1204 {
1205   return myLabelSize;
1206 }
1207
1208 //----------------------------------------------------------------------------
1209 CORBA::Long VISU::PointMap3d_i::GetBarWidth() 
1210 {
1211   return myBarWidth;
1212 }
1213
1214 //----------------------------------------------------------------------------
1215 CORBA::Long VISU::PointMap3d_i::GetBarHeight() 
1216
1217   return myBarHeight;
1218 }
1219
1220 //----------------------------------------------------------------------------
1221 void
1222 VISU::PointMap3d_i::SetLabelsFormat(const char* theFormat)
1223 {
1224   if( myLabelsFormat != theFormat ){
1225     myLabelsFormat = theFormat;
1226     myParamsTime.Modified();
1227   }
1228 }
1229
1230 //----------------------------------------------------------------------------
1231 char* VISU::PointMap3d_i::GetLabelsFormat() 
1232
1233   return CORBA::string_dup(myLabelsFormat.c_str());
1234 }
1235
1236 //----------------------------------------------------------------------------
1237 void VISU::PointMap3d_i::SetUnitsVisible(CORBA::Boolean isVisible)
1238 {
1239   if( myIsUnits != isVisible ){
1240     myIsUnits = isVisible;
1241     myParamsTime.Modified();
1242   }
1243 }
1244
1245 //----------------------------------------------------------------------------
1246 CORBA::Boolean VISU::PointMap3d_i::IsUnitsVisible()
1247 {
1248   return myIsUnits;
1249 }
1250
1251 //----------------------------------------------------------------------------
1252 void VISU::PointMap3d_i::SetRatios(CORBA::Long theTitleSize, 
1253                               CORBA::Long theLabelSize, 
1254                               CORBA::Long theBarWidth, CORBA::Long theBarHeight) 
1255 {
1256   bool anIsSameValue = VISU::CheckIsSameValue(myTitleSize, theTitleSize);
1257   anIsSameValue &= VISU::CheckIsSameValue(myLabelSize, theLabelSize);
1258   anIsSameValue &= VISU::CheckIsSameValue(myBarWidth, theBarWidth);
1259   anIsSameValue &= VISU::CheckIsSameValue(myBarHeight, theBarHeight);
1260   if(anIsSameValue)
1261     return;
1262
1263   myTitleSize = theTitleSize; 
1264   myLabelSize = theLabelSize; 
1265   myBarWidth = theBarWidth; 
1266   myBarHeight = theBarHeight;
1267   myParamsTime.Modified();
1268 }