]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_PointMap3d_i.cc
Salome HOME
Issue 0020336: [CEA 339] specifying a cut line with 2 points
[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   if(MYDEBUG) MESSAGE(GetComment());
556   SetName(VISU::Storable::FindValue(theMap,"myName").toLatin1().constData(), false);
557   myTitle = VISU::Storable::FindValue(theMap,"myTitle").toLatin1().constData();
558   myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() );
559   mySObj = SALOMEDS::SObject::_duplicate(SO);
560
561   //Create PipeLine
562   myTablePL = VISU_DeformedGridPL::New();
563   myTablePL->SetPolyDataIDMapper(GetTableIDMapper());
564   myTablePL->Update();
565
566   //Restore Other Values
567   
568   float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
569   float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
570   SetRange(aMin, aMax);
571
572   UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange", "0").toInt());
573
574   SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
575   SetUnitsVisible(VISU::Storable::FindValue(theMap,"myUnitsVisible", "1").toInt());
576   SetLabelsFormat(VISU::Storable::FindValue(theMap,"myLabelsFormat", "%-#6.3g").toLatin1().constData());
577   SetBarOrientation((VISU::ColoredPrs3dBase::Orientation)VISU::Storable::FindValue(theMap,"myBarOrientation").toInt());
578
579   SetTitle(VISU::Storable::FindValue(theMap,"myTitle").toLatin1().constData());
580   myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
581   myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
582   myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
583   myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
584   myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
585   myTitleSize = VISU::Storable::FindValue(theMap,"myTitleSize").toInt();
586   myLabelSize = VISU::Storable::FindValue(theMap,"myLabelSize").toInt();
587   myBarWidth = VISU::Storable::FindValue(theMap,"myBarWidth").toInt();
588   myBarHeight = VISU::Storable::FindValue(theMap,"myBarHeight").toInt();
589
590   myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
591   myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
592   myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
593   myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
594   myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
595   myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
596   myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
597
598   myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
599   myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
600   myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
601   myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
602   myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
603   myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
604   myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
605
606   myParamsTime.Modified();
607   return Build( true );
608 }
609 /*!
610   Flushes table data into stream
611 */
612 void VISU::PointMap3d_i::ToStream( std::ostringstream& theStr )
613 {
614   Storable::DataToStream( theStr, "myName",        GetName().c_str() );
615   Storable::DataToStream( theStr, "myTitle",       myTitle.c_str() );
616   Storable::DataToStream( theStr, "myOrientation", myOrientation );
617
618   Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
619   Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
620   Storable::DataToStream( theStr, "myIsFixedRange",   IsRangeFixed() );
621
622   Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
623   Storable::DataToStream( theStr, "myBarOrientation", myBarOrientation );
624
625   Storable::DataToStream( theStr, "myTitle",          myTitle.c_str() );
626   Storable::DataToStream( theStr, "myUnitsVisible",   myIsUnits );
627   Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
628   Storable::DataToStream( theStr, "myLabelsFormat",   myLabelsFormat.c_str() );
629   Storable::DataToStream( theStr, "myPosition[0]",    myPosition[0] );
630   Storable::DataToStream( theStr, "myPosition[1]",    myPosition[1] );
631   Storable::DataToStream( theStr, "myWidth",          myWidth );
632   Storable::DataToStream( theStr, "myHeight",         myHeight );
633   Storable::DataToStream( theStr, "myTitleSize",      myTitleSize );
634   Storable::DataToStream( theStr, "myLabelSize",     myLabelSize );
635   Storable::DataToStream( theStr, "myBarWidth",       myBarWidth );
636   Storable::DataToStream( theStr, "myBarHeight",      myBarHeight );
637
638   Storable::DataToStream( theStr, "myTitFontType",    myTitFontType );
639   Storable::DataToStream( theStr, "myIsBoldTitle",    myIsBoldTitle );
640   Storable::DataToStream( theStr, "myIsItalicTitle",  myIsItalicTitle );
641   Storable::DataToStream( theStr, "myIsShadowTitle",  myIsShadowTitle );
642   Storable::DataToStream( theStr, "myTitleColor[0]",  myTitleColor[0] );
643   Storable::DataToStream( theStr, "myTitleColor[1]",  myTitleColor[1] );
644   Storable::DataToStream( theStr, "myTitleColor[2]",  myTitleColor[2] );
645
646   Storable::DataToStream( theStr, "myLblFontType",    myLblFontType );
647   Storable::DataToStream( theStr, "myIsBoldLabel",    myIsBoldLabel );
648   Storable::DataToStream( theStr, "myIsItalicLabel",  myIsItalicLabel );
649   Storable::DataToStream( theStr, "myIsShadowLabel",  myIsShadowLabel );
650   Storable::DataToStream( theStr, "myLabelColor[0]",  myLabelColor[0] );
651   Storable::DataToStream( theStr, "myLabelColor[1]",  myLabelColor[1] );
652   Storable::DataToStream( theStr, "myLabelColor[2]",  myLabelColor[2] );
653 }
654 /*!
655   Called from engine to restore table from the file
656 */
657 VISU::Storable* VISU::PointMap3d_i::StorableEngine(SALOMEDS::SObject_ptr theSObject,
658                                                    const Storable::TRestoringMap& theMap,
659                                                    const std::string& thePrefix,
660                                                    CORBA::Boolean theIsMultiFile)
661 {
662   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
663   VISU::PointMap3d_i* pResent = new VISU::PointMap3d_i( aStudy, "" );
664   return pResent->Restore( theMap, theSObject);
665 }
666 /*!
667   Gets title for the original table object
668 */
669 QString VISU::PointMap3d_i::GetTableTitle()
670 {
671   SALOMEDS::SObject_var SO = mySObj;
672   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
673   SALOMEDS::GenericAttribute_var        anAttr;
674   SALOMEDS::AttributeTableOfInteger_var anInt;
675   SALOMEDS::AttributeTableOfReal_var    aReal;
676   if ( !SO->_is_nil() ) {
677     if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
678       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
679       CORBA::String_var aString = anInt->GetTitle();
680       return aString.in();
681     }
682     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
683       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
684       CORBA::String_var aString = aReal->GetTitle();
685       return aString.in();
686     }
687   }
688   return "";
689 }
690
691 //---------------------------------------------------------------
692 void VISU::PointMap3d_i::RemoveFromStudy()
693 {
694   struct TRemoveFromStudy: public SALOME_Event
695   {
696     VISU::PointMap3d_i* myRemovable;
697     TRemoveFromStudy(VISU::PointMap3d_i* theRemovable):
698       myRemovable(theRemovable)
699     {}
700     
701     virtual
702     void
703     Execute()
704     {
705       VISU::RemoveFromStudy(myRemovable->GetSObject(),false);
706     }
707   };
708
709   // Remove the table with all curves
710   ProcessVoidEvent(new TRemoveFromStudy(this));
711 }
712
713 //----------------------------------------------------------------
714 void VISU::PointMap3d_i::SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz)
715 {
716   myOffset[0] = theDx;
717   myOffset[1] = theDy;
718   myOffset[2] = theDz;
719   myParamsTime.Modified();
720 }
721
722 void VISU::PointMap3d_i::GetOffset(CORBA::Float& theDx, CORBA::Float& theDy, CORBA::Float& theDz)
723 {
724   theDx = myOffset[0];
725   theDy = myOffset[1];
726   theDz = myOffset[2];
727 }
728
729 CORBA::Float VISU::PointMap3d_i::GetMemorySize()
730 {
731   CORBA::Float aSize = GetSpecificPL()->GetMemorySize();
732
733   int anEnd = myActorCollection->GetNumberOfItems();
734   for(int anId = 0; anId < anEnd; anId++)
735     if(vtkObject* anObject = myActorCollection->GetItemAsObject(anId))
736       if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anObject)){
737         aSize += anActor->GetMemorySize();
738         //cout<<"Prs3d_i::GetMemorySize - "<<this<<"; anActor = "<<aSize / (1024.0 * 1024.0)<<endl;
739       }
740
741   // Convert to mega bytes
742   return aSize / (1024.0 * 1024.0);
743 }
744
745 //------------------ ColoredPrs3dBase Methods --------------------
746 CORBA::Double VISU::PointMap3d_i::GetMin()
747 {
748   return myTablePL->GetScalarRange()[0];
749 }
750
751 CORBA::Double VISU::PointMap3d_i::GetMinTableValue()
752 {
753   SALOMEDS::GenericAttribute_var anAttr;
754   mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
755   SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
756   double aMin = aTableOfReal->GetValue(1, 1);
757   
758   for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
759     for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
760       double aVal = aTableOfReal->GetValue(j, i);
761       if (aVal < aMin)
762         aMin = aVal;
763     }
764   
765   return aMin;
766 }
767
768 CORBA::Double VISU::PointMap3d_i::GetMaxTableValue()
769 {
770   SALOMEDS::GenericAttribute_var anAttr;
771   mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
772   SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
773   double aMax = aTableOfReal->GetValue(1, 1);
774
775   for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
776     for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
777       double aVal = aTableOfReal->GetValue(j, i);
778       if (aVal > aMax)
779         aMax = aVal;
780     }
781
782   return aMax;
783 }
784
785 CORBA::Double VISU::PointMap3d_i::GetMax()
786 {
787   return myTablePL->GetScalarRange()[1];
788 }
789
790 void VISU::PointMap3d_i::SetRange(CORBA::Double theMin, CORBA::Double theMax)
791 {
792   vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
793   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, vtkFloatingPointType*>
794                    (GetSpecificPL(), &VISU_DeformedGridPL::SetScalarRange, aScalarRange));
795
796   UseFixedRange(true);
797 }
798
799 CORBA::Double VISU::PointMap3d_i::GetSourceMin()
800 {
801   vtkFloatingPointType aRange[2];
802   GetSpecificPL()->GetSourceRange(aRange);
803   return aRange[0];
804 }
805
806 CORBA::Double VISU::PointMap3d_i::GetSourceMax()
807 {
808   vtkFloatingPointType aRange[2];
809   GetSpecificPL()->GetSourceRange(aRange);
810   return aRange[1];
811 }
812
813 void VISU::PointMap3d_i::SetSourceRange()
814 {
815   GetSpecificPL()->SetSourceRange();
816   ProcessVoidEvent(new TVoidMemFunEvent<VISU_DeformedGridPL>
817                    (GetSpecificPL(), &VISU_DeformedGridPL::SetSourceRange));
818
819   UseFixedRange(false);
820 }
821
822 CORBA::Boolean VISU::PointMap3d_i::IsRangeFixed()
823 {
824   return myIsFixedRange; 
825 }
826
827 void VISU::PointMap3d_i::UseFixedRange(bool theRange)
828 {
829   if(myIsFixedRange == theRange)
830     return;
831
832   myIsFixedRange = theRange;
833 }
834
835 void VISU::PointMap3d_i::SetPosition(CORBA::Double theX, CORBA::Double theY)
836 {
837   bool anIsSameValue = VISU::CheckIsSameValue(myPosition[0], theX);
838   anIsSameValue &= VISU::CheckIsSameValue(myPosition[1], theY);
839   if(anIsSameValue)
840     return;
841
842   myPosition[0] = theX; 
843   myPosition[1] = theY;
844   myParamsTime.Modified();
845 }
846
847 CORBA::Double VISU::PointMap3d_i::GetPosX()
848 {
849   return myPosition[0];
850 }
851
852 CORBA::Double VISU::PointMap3d_i::GetPosY()
853 {
854   return myPosition[1];
855 }
856
857 void VISU::PointMap3d_i::SetSize(CORBA::Double theWidth, CORBA::Double theHeight)
858 {
859   bool anIsSameValue = VISU::CheckIsSameValue(myWidth, theWidth);
860   anIsSameValue &= VISU::CheckIsSameValue(myHeight, theHeight);
861   if(anIsSameValue)
862     return;
863
864   myWidth = theWidth; 
865   myHeight = theHeight;
866   myParamsTime.Modified();
867 }
868
869 CORBA::Double VISU::PointMap3d_i::GetHeight()
870 {
871   return myHeight;
872 }
873
874 CORBA::Double VISU::PointMap3d_i::GetWidth()
875 {
876   return myWidth;
877 }
878
879 void VISU::PointMap3d_i::SetNbColors(CORBA::Long theNbColors)
880 {
881   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
882                    (GetSpecificPL(), &VISU_DeformedGridPL::SetNbColors, theNbColors));
883 }
884
885 CORBA::Long VISU::PointMap3d_i::GetNbColors()
886 {
887   return GetSpecificPL()->GetNbColors();
888 }
889
890 void VISU::PointMap3d_i::SetLabels(CORBA::Long theNbLabels)
891 {
892   if(myNumberOfLabels == theNbLabels)
893     return;
894
895   myNumberOfLabels = theNbLabels;
896 }
897
898 CORBA::Long VISU::PointMap3d_i::GetLabels()
899 {
900   return myNumberOfLabels;
901 }
902
903 void VISU::PointMap3d_i::SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theBarOrientation)
904 {
905   if(myBarOrientation == theBarOrientation)
906     return;
907
908   if ( ( theBarOrientation == VISU::ColoredPrs3dBase::VERTICAL && myHeight < myWidth ) ||
909        ( theBarOrientation == VISU::ColoredPrs3dBase::HORIZONTAL && myHeight > myWidth ) ) {
910     vtkFloatingPointType tmp = myHeight;
911     myHeight = myWidth;
912     myWidth = tmp;
913   }
914
915   myBarOrientation = theBarOrientation;
916   myParamsTime.Modified();
917 }
918
919 VISU::ColoredPrs3dBase::Orientation VISU::PointMap3d_i::GetBarOrientation()
920 {
921   return myBarOrientation;
922 }
923
924 //------------------- ScaledPrs3d Methods -----------------------
925
926 void VISU::PointMap3d_i::SetScaling(VISU::Scaling theScaling)
927 {
928   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
929                    (GetSpecificPL(), &VISU_DeformedGridPL::SetScaling, theScaling));
930 }
931
932 VISU::Scaling VISU::PointMap3d_i::GetScaling()
933 {
934   return VISU::Scaling(GetSpecificPL()->GetScaling());
935 }
936
937 //------------------- Check Table on Positive Values ------------
938 bool VISU::PointMap3d_i::IsPositiveTable()
939 {
940   SALOMEDS::GenericAttribute_var anAttr;
941   mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
942   SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
943
944   for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
945     for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
946       double aVal = aTableOfReal->GetValue(j, i);
947       if (aVal < 0)
948         return false;
949     }
950
951   return true;
952 }
953
954 //------------------- Plot3dBase Methods ------------------------
955
956 void VISU::PointMap3d_i::SetScaleFactor (CORBA::Double theScaleFactor)
957 {
958   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, vtkFloatingPointType>
959                    (GetSpecificPL(), &VISU_DeformedGridPL::SetScaleFactor, theScaleFactor));
960 }
961
962 CORBA::Double VISU::PointMap3d_i::GetScaleFactor ()
963 {
964   return myTablePL->GetScaleFactor();
965 }
966
967 void VISU::PointMap3d_i::SetContourPrs (CORBA::Boolean theIsContourPrs )
968 {
969   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, bool>
970                    (GetSpecificPL(), &VISU_DeformedGridPL::SetContourPrs, theIsContourPrs));
971 }
972
973 CORBA::Boolean VISU::PointMap3d_i::GetIsContourPrs()
974 {
975   return myTablePL->GetIsContourPrs();
976 }
977
978 void VISU::PointMap3d_i::SetNbOfContours (CORBA::Long theNb)
979 {
980   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
981                    (GetSpecificPL(), &VISU_DeformedGridPL::SetNumberOfContours, theNb));
982 }
983
984 CORBA::Long VISU::PointMap3d_i::GetNbOfContours ()
985 {
986   return myTablePL->GetNumberOfContours();
987 }
988
989 //-------------------- Actor Factory Methods --------------------
990
991 bool VISU::PointMap3d_i::GetActiveState ()
992 {
993   return myIsActiveState;
994 }
995
996 void VISU::PointMap3d_i::SetActiveState ( bool theState )
997 {
998   myIsActiveState = theState;
999 }
1000
1001 void VISU::PointMap3d_i::RemoveActor (VISU_ActorBase* theActor)
1002 {
1003   myActorCollection->RemoveItem(theActor);
1004 }
1005
1006 void VISU::PointMap3d_i::RemoveActors ()
1007 {
1008   ProcessVoidEvent(new TInvokeSignalEvent(myRemoveActorsFromRendererSignal));
1009   myActorCollection->RemoveAllItems();
1010 }
1011
1012
1013 //-----------------------Text Properties & Label Properties------------------
1014 bool VISU::PointMap3d_i::IsBoldTitle() 
1015
1016   return myIsBoldTitle;
1017 }
1018
1019 //----------------------------------------------------------------------------
1020 void VISU::PointMap3d_i::SetBoldTitle(bool theIsBoldTitle)
1021 {
1022   if(myIsBoldTitle == theIsBoldTitle)
1023     return;
1024
1025   myIsBoldTitle = theIsBoldTitle;
1026   myParamsTime.Modified();
1027 }
1028
1029 //----------------------------------------------------------------------------
1030 bool VISU::PointMap3d_i::IsItalicTitle() 
1031
1032   return myIsItalicTitle;
1033 }
1034
1035 //----------------------------------------------------------------------------
1036 void VISU::PointMap3d_i::SetItalicTitle(bool theIsItalicTitle)
1037
1038   if(myIsItalicTitle == theIsItalicTitle)
1039     return;
1040
1041   myIsItalicTitle = theIsItalicTitle;
1042   myParamsTime.Modified();
1043 }
1044
1045 //----------------------------------------------------------------------------
1046 bool VISU::PointMap3d_i::IsShadowTitle() 
1047
1048   return myIsShadowTitle;
1049 }
1050
1051 //----------------------------------------------------------------------------
1052 void VISU::PointMap3d_i::SetShadowTitle(bool theIsShadowTitle)
1053
1054   if(myIsShadowTitle == theIsShadowTitle)
1055     return;
1056
1057   myIsShadowTitle = theIsShadowTitle;
1058   myParamsTime.Modified();
1059 }
1060
1061 //----------------------------------------------------------------------------
1062 int VISU::PointMap3d_i::GetTitFontType()
1063 {
1064   return myTitFontType;
1065 }
1066
1067 //----------------------------------------------------------------------------
1068 void VISU::PointMap3d_i::SetTitFontType(int theTitFontType)
1069 {
1070   if(myTitFontType == theTitFontType)
1071     return;
1072
1073   myTitFontType = theTitFontType;
1074   myParamsTime.Modified();
1075 }
1076
1077 //----------------------------------------------------------------------------
1078 void VISU::PointMap3d_i::GetTitleColor(vtkFloatingPointType& theR, 
1079                                          vtkFloatingPointType& theG, 
1080                                          vtkFloatingPointType& theB)
1081 {
1082   theR = myTitleColor[0]; 
1083   theG = myTitleColor[1]; 
1084   theB = myTitleColor[2];
1085 }
1086
1087 //----------------------------------------------------------------------------
1088 void VISU::PointMap3d_i::SetTitleColor(vtkFloatingPointType theR, 
1089                                          vtkFloatingPointType theG, 
1090                                          vtkFloatingPointType theB)
1091 {
1092   bool anIsSameValue = VISU::CheckIsSameValue(myTitleColor[0], theR);
1093   anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[1], theG);
1094   anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[2], theB);
1095   if(anIsSameValue)
1096     return;
1097
1098   myTitleColor[0] = theR; 
1099   myTitleColor[1] = theG; 
1100   myTitleColor[2] = theB; 
1101   myParamsTime.Modified();
1102 }
1103
1104 //----------------------------------------------------------------------------
1105 bool VISU::PointMap3d_i::IsBoldLabel()
1106 {
1107   return myIsBoldLabel;
1108 }
1109
1110 //----------------------------------------------------------------------------
1111 void VISU::PointMap3d_i::SetBoldLabel(bool theIsBoldLabel) 
1112 {
1113   if(myIsBoldLabel == theIsBoldLabel)
1114     return;
1115
1116   myIsBoldLabel = theIsBoldLabel;
1117   myParamsTime.Modified();
1118 }
1119
1120 //----------------------------------------------------------------------------
1121 bool VISU::PointMap3d_i::IsItalicLabel() 
1122 {
1123   return myIsItalicLabel;
1124 }
1125
1126 //----------------------------------------------------------------------------
1127 void VISU::PointMap3d_i::SetItalicLabel(bool theIsItalicLabel)
1128 {
1129   if(myIsItalicLabel == theIsItalicLabel)
1130     return;
1131
1132   myIsItalicLabel = theIsItalicLabel;
1133   myParamsTime.Modified();
1134 }
1135
1136 //----------------------------------------------------------------------------
1137 bool VISU::PointMap3d_i::IsShadowLabel() 
1138 {
1139   return myIsShadowLabel;
1140 }
1141
1142 //----------------------------------------------------------------------------
1143 void VISU::PointMap3d_i::SetShadowLabel(bool theIsShadowLabel)
1144 {
1145   if(myIsShadowLabel == theIsShadowLabel)
1146     return;
1147
1148   myIsShadowLabel = theIsShadowLabel;
1149   myParamsTime.Modified();
1150 }
1151
1152 //----------------------------------------------------------------------------
1153 int VISU::PointMap3d_i::GetLblFontType()
1154 {
1155   return myLblFontType;
1156 }
1157
1158 //----------------------------------------------------------------------------
1159 void VISU::PointMap3d_i::SetLblFontType(int theLblFontType)
1160 {
1161   if(myLblFontType == theLblFontType)
1162     return;
1163
1164   myLblFontType = theLblFontType;
1165   myParamsTime.Modified();
1166 }
1167
1168 //----------------------------------------------------------------------------
1169 void VISU::PointMap3d_i::GetLabelColor(vtkFloatingPointType& theR, 
1170                                   vtkFloatingPointType& theG, 
1171                                   vtkFloatingPointType& theB)
1172 {
1173   theR = myLabelColor[0]; 
1174   theG = myLabelColor[1]; 
1175   theB = myLabelColor[2];
1176 }
1177
1178 //----------------------------------------------------------------------------
1179 void VISU::PointMap3d_i::SetLabelColor(vtkFloatingPointType theR, 
1180                                   vtkFloatingPointType theG, 
1181                                   vtkFloatingPointType theB)
1182 {
1183   bool anIsSameValue = VISU::CheckIsSameValue(myLabelColor[0], theR);
1184   anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[1], theG);
1185   anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[2], theB);
1186   if(anIsSameValue)
1187     return;
1188
1189   myLabelColor[0] = theR; 
1190   myLabelColor[1] = theG; 
1191   myLabelColor[2] = theB; 
1192   myParamsTime.Modified();
1193 }
1194
1195 //----------------------------------------------------------------------------
1196 CORBA::Long VISU::PointMap3d_i::GetTitleSize() 
1197 {
1198   return myTitleSize;
1199 }
1200
1201 //----------------------------------------------------------------------------
1202 CORBA::Long VISU::PointMap3d_i::GetLabelSize() 
1203 {
1204   return myLabelSize;
1205 }
1206
1207 //----------------------------------------------------------------------------
1208 CORBA::Long VISU::PointMap3d_i::GetBarWidth() 
1209 {
1210   return myBarWidth;
1211 }
1212
1213 //----------------------------------------------------------------------------
1214 CORBA::Long VISU::PointMap3d_i::GetBarHeight() 
1215
1216   return myBarHeight;
1217 }
1218
1219 //----------------------------------------------------------------------------
1220 void
1221 VISU::PointMap3d_i::SetLabelsFormat(const char* theFormat)
1222 {
1223   if( myLabelsFormat != theFormat ){
1224     myLabelsFormat = theFormat;
1225     myParamsTime.Modified();
1226   }
1227 }
1228
1229 //----------------------------------------------------------------------------
1230 char* VISU::PointMap3d_i::GetLabelsFormat() 
1231
1232   return CORBA::string_dup(myLabelsFormat.c_str());
1233 }
1234
1235 //----------------------------------------------------------------------------
1236 void VISU::PointMap3d_i::SetUnitsVisible(CORBA::Boolean isVisible)
1237 {
1238   if( myIsUnits != isVisible ){
1239     myIsUnits = isVisible;
1240     myParamsTime.Modified();
1241   }
1242 }
1243
1244 //----------------------------------------------------------------------------
1245 CORBA::Boolean VISU::PointMap3d_i::IsUnitsVisible()
1246 {
1247   return myIsUnits;
1248 }
1249
1250 //----------------------------------------------------------------------------
1251 void VISU::PointMap3d_i::SetRatios(CORBA::Long theTitleSize, 
1252                               CORBA::Long theLabelSize, 
1253                               CORBA::Long theBarWidth, CORBA::Long theBarHeight) 
1254 {
1255   bool anIsSameValue = VISU::CheckIsSameValue(myTitleSize, theTitleSize);
1256   anIsSameValue &= VISU::CheckIsSameValue(myLabelSize, theLabelSize);
1257   anIsSameValue &= VISU::CheckIsSameValue(myBarWidth, theBarWidth);
1258   anIsSameValue &= VISU::CheckIsSameValue(myBarHeight, theBarHeight);
1259   if(anIsSameValue)
1260     return;
1261
1262   myTitleSize = theTitleSize; 
1263   myLabelSize = theLabelSize; 
1264   myBarWidth = theBarWidth; 
1265   myBarHeight = theBarHeight;
1266   myParamsTime.Modified();
1267 }