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