1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23 // File : VISU_PrsObject_i.cxx
24 // Author : Alexey PETROV
27 #include "VISU_ScalarMapPL.hxx"
28 #include "VISU_Result_i.hh"
29 #include "VISU_ScalarMap_i.hh"
30 #include "VISU_ScalarMapAct.h"
31 #include "QAD_Config.h"
37 static int MYDEBUG = 0;
38 static int MYDEBUGWITHFILES = 0;
40 static int MYDEBUG = 0;
41 static int MYDEBUGWITHFILES = 0;
44 static int INCMEMORY = 4;
46 int VISU::ScalarMap_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
47 const char* theFieldName, int theIteration, int isMemoryCheck)
50 float aSize = INCMEMORY*
51 theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
54 aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
55 INFOS("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
58 }catch(std::runtime_error& exc){
59 INFOS("Follow exception was accured :\n"<<exc.what());
61 INFOS("Unknown exception was accured!");
66 int VISU::ScalarMap_i::myNbPresent = 0;
67 QString VISU::ScalarMap_i::GenerateName() { return VISU::GenerateName("ScalarMap",myNbPresent++);}
69 const string VISU::ScalarMap_i::myComment = "SCALARMAP";
70 const char* VISU::ScalarMap_i::GetComment() const { return myComment.c_str();}
72 VISU::ScalarMap_i::ScalarMap_i(Result_i* theResult, bool theAddToStudy, SALOMEDS::SObject_ptr theSObject) :
73 PrsObject_i(theResult->GetStudyDocument()),
74 Prs3d_i(theResult,theSObject)
76 myAddToStudy = theAddToStudy;
81 void VISU::ScalarMap_i::RemoveFromStudy(){
82 VISU::RemoveFromStudy(mySObject,false);
86 void VISU::ScalarMap_i::SameAs(const ScalarMap_i* theOrigin)
88 ScalarMap_i* aScalarMap = const_cast<ScalarMap_i*>(theOrigin);
90 VISU::Prs3d_i::SameAs(aScalarMap);
91 myField = aScalarMap->GetField();
92 myMeshName = myField->myMeshName;
93 myEntity = myField->myEntity;
94 myIteration = aScalarMap->GetIteration();
95 myFieldName = aScalarMap->GetFieldName();
97 SetScalarMode(aScalarMap->GetScalarMode());
99 SetRange(aScalarMap->GetMin(), aScalarMap->GetMax());
100 myIsFixedRange = aScalarMap->IsRangeFixed();
102 SetScaling(aScalarMap->GetScaling());
104 SetBarOrientation(aScalarMap->GetBarOrientation());
105 SetPosition(aScalarMap->GetPosX(), aScalarMap->GetPosY());
106 SetSize(aScalarMap->GetWidth(), aScalarMap->GetHeight());
107 SetNbColors(aScalarMap->GetNbColors());
108 SetLabels(aScalarMap->GetLabels());
109 SetTitle(aScalarMap->GetTitle());
111 SetBoldTitle(aScalarMap->IsBoldTitle());
112 SetItalicTitle(aScalarMap->IsItalicTitle());
113 SetShadowTitle(aScalarMap->IsShadowTitle());
114 SetTitFontType(aScalarMap->GetTitFontType());
116 aScalarMap->GetTitleColor(&r,&g,&b);
117 SetTitleColor(r,g,b);
119 SetBoldLabel(aScalarMap->IsBoldLabel());
120 SetItalicLabel(aScalarMap->IsItalicLabel());
121 SetShadowLabel(aScalarMap->IsShadowLabel());
122 SetLblFontType(aScalarMap->GetLblFontType());
123 aScalarMap->GetLabelColor(&r,&g,&b);
124 SetLabelColor(r,g,b);
132 * Creates Scalar Map and initialises it from resources
134 VISU::Storable* VISU::ScalarMap_i::Create(const char* theMeshName, VISU::Entity theEntity,
135 const char* theFieldName, int theIteration)
140 QString aOrient = QAD_CONFIG->getSetting("Visu:SBOrientation");
141 if ( !aOrient.isEmpty() )
142 myOrientation = (VISU::ScalarMap::Orientation) aOrient.toInt();
144 myOrientation = VISU::ScalarMap::VERTICAL;
147 QString aXorigin = QAD_CONFIG->getSetting("Visu:SBXorigin");
148 if ( !aXorigin.isEmpty() )
149 myPosition[0] = aXorigin.toFloat();
151 if(myOrientation == VISU::ScalarMap::VERTICAL) {
152 myPosition[0] = 0.03;
158 QString aYorigin = QAD_CONFIG->getSetting("Visu:SBYorigin");
159 if ( !aYorigin.isEmpty() )
160 myPosition[1] = aYorigin.toFloat();
162 if(myOrientation == VISU::ScalarMap::VERTICAL) {
165 myPosition[1] = 0.012;
170 QString aWidth = QAD_CONFIG->getSetting("Visu:SBWidth");
171 if ( !aWidth.isEmpty() )
172 myWidth = aWidth.toFloat();
174 myWidth =(myOrientation == VISU::ScalarMap::VERTICAL)? 0.17:0.6;
176 QString aHeight = QAD_CONFIG->getSetting("Visu:SBHeight");
177 if ( !aHeight.isEmpty() )
178 myHeight = aHeight.toFloat();
180 myHeight =(myOrientation == VISU::ScalarMap::VERTICAL)? 0.8:0.12;
184 QString aColors = QAD_CONFIG->getSetting("Visu:SBNumberOfColors");
185 int aNumberOfColors = (aColors.isEmpty())? 64 : aColors.toInt();
186 if (aNumberOfColors > 64)
187 aNumberOfColors = 64;
188 SetNbColors(aNumberOfColors);
191 QString aLabels = QAD_CONFIG->getSetting("Visu:SBNumberOfLabels");
192 myNumberOfLabels = (aLabels.isEmpty())? 5 : aLabels.toInt();
193 if (myNumberOfLabels > 65)
194 myNumberOfLabels = 65;
197 QString aFixRange = QAD_CONFIG->getSetting("Visu:SBImposeRange");
198 myIsFixedRange = (aFixRange.compare("true") == 0);
201 float aScalarRange[2];
202 QString aRangeMin = QAD_CONFIG->getSetting("Visu:SBMinimumValue");
203 float aMin = (aRangeMin.isEmpty())? 0 : aRangeMin.toFloat();
204 QString aRangeMax = QAD_CONFIG->getSetting("Visu:SBMaximumValue");
205 float aMax = (aRangeMax.isEmpty())? 0 : aRangeMax.toFloat();
209 QString aScaling = QAD_CONFIG->getSetting("Visu:SBScaling");
210 if(aScaling.compare("LOGARITHMIC") == 0)
211 SetScaling(VISU::LOGARITHMIC);
213 SetScaling(VISU::LINEAR);
215 // Fonts properties definition
216 QString aIsBoldTitle = QAD_CONFIG->getSetting("Visu:IsBoldTitle");
217 myIsBoldTitle = (aIsBoldTitle.isEmpty())? true : (aIsBoldTitle.compare("true") == 0);
219 QString aIsItalicTitle = QAD_CONFIG->getSetting("Visu:IsItalicTitle");
220 myIsItalicTitle = (aIsItalicTitle.isEmpty())? true : (aIsItalicTitle.compare("true") == 0);
222 QString aIsShadowTitle = QAD_CONFIG->getSetting("Visu:IsShadowTitle");
223 myIsShadowTitle = (aIsShadowTitle.isEmpty())? true : (aIsShadowTitle.compare("true") == 0);
225 QString aTitFontType = QAD_CONFIG->getSetting("Visu:TitFontType");
226 if (!aTitFontType.isEmpty()) {
227 switch (aTitFontType.toInt()) {
228 case 0: myTitFontType = VTK_ARIAL; break;
229 case 1: myTitFontType = VTK_COURIER; break;
230 case 2: myTitFontType = VTK_TIMES; break;
233 myTitFontType = VTK_ARIAL;
235 QString aRTitColor = QAD_CONFIG->getSetting("Visu:TitleColorR");
236 myTitleColor[0] = (aRTitColor.isEmpty())? 1 : aRTitColor.toFloat();
237 if (myTitleColor[0] > 1) myTitleColor[0] = 1;
238 if (myTitleColor[0] < 0) myTitleColor[0] = 0;
240 QString aGTitColor = QAD_CONFIG->getSetting("Visu:TitleColorG");
241 myTitleColor[1] = (aGTitColor.isEmpty())? 1 : aGTitColor.toFloat();
242 if (myTitleColor[1] > 1) myTitleColor[1] = 1;
243 if (myTitleColor[1] < 0) myTitleColor[1] = 0;
245 QString aBTitColor = QAD_CONFIG->getSetting("Visu:TitleColorB");
246 myTitleColor[2] = (aBTitColor.isEmpty())? 1 : aBTitColor.toFloat();
247 if (myTitleColor[2] > 1) myTitleColor[2] = 1;
248 if (myTitleColor[2] < 0) myTitleColor[2] = 0;
252 QString aIsBoldLabel = QAD_CONFIG->getSetting("Visu:IsBoldLabel");
253 myIsBoldLabel = (aIsBoldLabel.isEmpty())? true : (aIsBoldLabel.compare("true") == 0);
255 QString aIsItalicLabel = QAD_CONFIG->getSetting("Visu:IsItalicLabel");
256 myIsItalicLabel = (aIsItalicLabel.isEmpty())? true : (aIsItalicLabel.compare("true") == 0);
258 QString aIsShadowLabel = QAD_CONFIG->getSetting("Visu:IsShadowLabel");
259 myIsShadowLabel = (aIsShadowLabel.isEmpty())? true : (aIsShadowLabel.compare("true") == 0);
261 QString aLblFontType = QAD_CONFIG->getSetting("Visu:LblFontType");
262 if (!aLblFontType.isEmpty()) {
263 switch (aLblFontType.toInt()) {
264 case 0: myLblFontType = VTK_ARIAL; break;
265 case 1: myLblFontType = VTK_COURIER; break;
266 case 2: myLblFontType = VTK_TIMES; break;
269 myLblFontType = VTK_ARIAL;
271 QString aRLblColor = QAD_CONFIG->getSetting("Visu:LabelColorR");
272 myLabelColor[0] = (aRLblColor.isEmpty())? 1 : aRLblColor.toFloat();
273 if (myLabelColor[0] > 1) myLabelColor[0] = 1;
274 if (myLabelColor[0] < 0) myLabelColor[0] = 0;
276 QString aGLblColor = QAD_CONFIG->getSetting("Visu:LabelColorG");
277 myLabelColor[1] = (aGLblColor.isEmpty())? 1 : aGLblColor.toFloat();
278 if (myLabelColor[1] > 1) myLabelColor[1] = 1;
279 if (myLabelColor[1] < 0) myLabelColor[1] = 0;
281 QString aBLblColor = QAD_CONFIG->getSetting("Visu:LabelColorB");
282 myLabelColor[2] = (aBLblColor.isEmpty())? 1 : aBLblColor.toFloat();
283 if (myLabelColor[2] > 1) myLabelColor[2] = 1;
284 if (myLabelColor[2] < 0) myLabelColor[2] = 0;
287 myMeshName = theMeshName;
288 myEntity = (VISU::TEntity)theEntity;
289 myFieldName =theFieldName;
290 myIteration = theIteration;
296 VISU::Storable* VISU::ScalarMap_i::Restore(const Storable::TRestoringMap& theMap)
297 throw(std::logic_error&)
300 myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
301 myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
302 myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
303 myIteration = VISU::Storable::FindValue(theMap,"myIteration").toInt();
305 SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
306 SetScaling(VISU::Scaling(VISU::Storable::FindValue(theMap,"myScaling").toInt()));
307 float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
308 float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
310 myIsFixedRange = VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt();
312 myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
313 myOrientation = (VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt();
314 SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
315 myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
316 myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
317 myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
318 myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
319 myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
321 myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
322 myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
323 myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
324 myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
325 myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
326 myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
327 myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
329 myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
330 myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
331 myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
332 myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
333 myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
334 myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
335 myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
337 Prs3d_i::Restore(theMap);
338 myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
343 void VISU::ScalarMap_i::ToStream(std::ostringstream& theStr){
344 Prs3d_i::ToStream(theStr);
346 Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
347 Storable::DataToStream( theStr, "myEntity", myEntity );
348 Storable::DataToStream( theStr, "myFieldName", myFieldName.c_str() );
349 Storable::DataToStream( theStr, "myIteration", myIteration );
351 Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) );
352 Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
353 Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
354 Storable::DataToStream( theStr, "myIsFixedRange", myIsFixedRange );
355 Storable::DataToStream( theStr, "myScaling", GetScaling() );
357 Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
358 Storable::DataToStream( theStr, "myOrientation", myOrientation );
359 Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
360 Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
361 Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] );
362 Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] );
363 Storable::DataToStream( theStr, "myWidth", myWidth );
364 Storable::DataToStream( theStr, "myHeight", myHeight );
366 Storable::DataToStream( theStr, "myTitFontType", myTitFontType );
367 Storable::DataToStream( theStr, "myIsBoldTitle", myIsBoldTitle );
368 Storable::DataToStream( theStr, "myIsItalicTitle", myIsItalicTitle );
369 Storable::DataToStream( theStr, "myIsShadowTitle", myIsShadowTitle );
370 Storable::DataToStream( theStr, "myTitleColor[0]", myTitleColor[0] );
371 Storable::DataToStream( theStr, "myTitleColor[1]", myTitleColor[1] );
372 Storable::DataToStream( theStr, "myTitleColor[2]", myTitleColor[2] );
374 Storable::DataToStream( theStr, "myLblFontType", myLblFontType );
375 Storable::DataToStream( theStr, "myIsBoldLabel", myIsBoldLabel );
376 Storable::DataToStream( theStr, "myIsItalicLabel", myIsItalicLabel );
377 Storable::DataToStream( theStr, "myIsShadowLabel", myIsShadowLabel );
378 Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
379 Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
380 Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
384 CORBA::Long VISU::ScalarMap_i::GetScalarMode(){
385 return myScalarMapPL->GetScalarMode();
387 void VISU::ScalarMap_i::SetScalarMode(CORBA::Long theScalarMode) {
388 myScalarMapPL->SetScalarMode(theScalarMode);
392 VISU::Scaling VISU::ScalarMap_i::GetScaling(){
393 return VISU::Scaling(myScalarMapPL->GetScaling());
395 void VISU::ScalarMap_i::SetScaling(VISU::Scaling theScaling){
396 myScalarMapPL->SetScaling(theScaling);
400 void VISU::ScalarMap_i::SetRange(CORBA::Double theMin, CORBA::Double theMax){
401 if(theMin > theMax) return;
402 float aScalarRange[2] = {theMin, theMax};
403 myScalarMapPL->SetScalarRange(aScalarRange);
404 myIsFixedRange = true;
407 CORBA::Double VISU::ScalarMap_i::GetMin(){
408 return myScalarMapPL->GetScalarRange()[0];
411 CORBA::Double VISU::ScalarMap_i::GetMax(){
412 return myScalarMapPL->GetScalarRange()[1];
416 void VISU::ScalarMap_i::SetNbColors(CORBA::Long theNbColors){
417 myScalarMapPL->SetNbColors(theNbColors);
420 CORBA::Long VISU::ScalarMap_i::GetNbColors(){
421 return myScalarMapPL->GetNbColors();
425 VISU::ScalarMap_i::~ScalarMap_i(){}
428 VISU::Storable* VISU::ScalarMap_i::Build(int theRestoring){
430 MESSAGE("ScalarMap_i::Build - "<<myFieldName<<"; theRestoring = "<<theRestoring);
431 SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
432 if(myAddToStudy) aStudyBuilder->NewCommand(); // There is a transaction
434 if(myResult->GetInput() == NULL)
435 throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
436 myField = &(myResult->GetInput()->GetField(myMeshName,myEntity,myFieldName));
437 if(myField == NULL) throw std::runtime_error("There is no Field with the parameters !!!");
438 VISU_Convertor::TOutput *anOutput =
439 myResult->GetInput()->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
440 if(anOutput == NULL) throw std::runtime_error("There is no TimeStamp with the parameters !!!");
441 myScalarMapPL->SetInput(anOutput);
442 myScalarMapPL->Build();
445 if(theRestoring <= 0){
446 if(theRestoring == 0) myScalarMapPL->Init();
447 if(!myIsFixedRange) myScalarMapPL->SetSourceRange();
448 const VISU::TField::TValField& aValField = myField->myValField;
449 const VISU::TField::TValForTime& aValForTime = aValField.find(myIteration)->second;
450 aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime.myTime).c_str());
451 if (theRestoring == 0) myTitle = aComment.simplifyWhiteSpace().latin1();
454 myName = GenerateName().latin1();
455 aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
456 VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
457 string aResultEntry = myResult->GetEntry();
458 string aRefFatherEntry = myResult->GetRefFatherEntry();
459 string anEntry = FindEntryWithComment(myStudy,aResultEntry.c_str(),aComment.latin1());
460 if(anEntry == "") throw std::runtime_error("There is no Entry for binding the presentation !!!");
461 aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
462 GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
463 CORBA::String_var anIOR = GetID();
464 CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
465 mySObject = myStudy->FindObjectIOR(anIOR);
467 }catch(std::runtime_error& exc){
468 INFOS("Follow exception was accured :\n"<<exc.what());
471 INFOS("Unknown exception was accured!");
474 if(myAddToStudy) aStudyBuilder->CommitCommand();
479 void VISU::ScalarMap_i::DoHook(){
480 if(MYDEBUG) MESSAGE("ScalarMap_i::DoHook() - "<<myPipeLine);
482 myPipeLine = VISU_ScalarMapPL::New();
483 myPipeLine->GetMapper()->SetScalarVisibility(1);
485 myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
488 void VISU::ScalarMap_i::Update() throw(std::runtime_error&){
489 VISU::Prs3d_i::Update();
492 void VISU::ScalarMap_i::SetMapScale(double theMapScale){
493 myScalarMapPL->SetMapScale(theMapScale);
496 VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
497 throw (std::runtime_error&)
499 VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
501 VISU::Prs3d_i::CreateActor(anActor,theIO);
502 anActor->SetBarVisibility(true);
503 anActor->SetRepresentation(2);
504 anActor->myFieldName = myFieldName;
505 UpdateActor(anActor);
506 }catch(std::runtime_error& exc){
513 void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
514 if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
515 VISU::Prs3d_i::UpdateActor(theActor);
516 VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
517 aScalarBar->SetLookupTable(myScalarMapPL->GetBarTable());
518 aScalarBar->SetTitle(myTitle.c_str());
519 aScalarBar->SetOrientation(myOrientation);
520 aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
521 aScalarBar->GetPositionCoordinate()->SetValue(myPosition[0],myPosition[1]);
522 aScalarBar->SetWidth(myWidth);
523 aScalarBar->SetHeight(myHeight);
524 aScalarBar->SetNumberOfLabels(myNumberOfLabels);
526 vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
527 aTitleProp->SetFontFamily(myTitFontType);
528 aTitleProp->SetColor(myTitleColor);
529 (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
530 (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
531 (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
533 vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
534 aLabelProp->SetFontFamily(myLblFontType);
535 aLabelProp->SetColor(myLabelColor);
536 (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
537 (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
538 (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
540 aScalarBar->Modified();
545 void VISU::ScalarMap_i::SetSourceRange(){
546 myScalarMapPL->SetSourceRange();
547 myIsFixedRange = false;