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 "SUIT_ResourceMgr.h"
33 #include <vtkDataSetMapper.h>
34 #include <vtkTextProperty.h>
40 static int MYDEBUG = 0;
42 static int MYDEBUG = 0;
45 static int INCMEMORY = 4;
47 int VISU::ScalarMap_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
48 const char* theFieldName, int theIteration, int isMemoryCheck)
51 float aSize = INCMEMORY*
52 theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
55 aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
56 MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
59 }catch(std::exception& exc){
60 INFOS("Follow exception was occured :\n"<<exc.what());
62 INFOS("Unknown exception was occured!");
67 int VISU::ScalarMap_i::myNbPresent = 0;
68 QString VISU::ScalarMap_i::GenerateName() { return VISU::GenerateName("ScalarMap",myNbPresent++);}
70 const string VISU::ScalarMap_i::myComment = "SCALARMAP";
71 const char* VISU::ScalarMap_i::GetComment() const { return myComment.c_str();}
73 ScalarMap_i(Result_i* theResult,
75 PrsObject_i(theResult->GetStudyDocument()),
76 Prs3d_i(theResult,theAddToStudy),
83 ScalarMap_i(Result_i* theResult,
84 SALOMEDS::SObject_ptr theSObject) :
85 PrsObject_i(theResult->GetStudyDocument()),
86 Prs3d_i(theResult,theSObject),
92 void VISU::ScalarMap_i::RemoveFromStudy(){
93 VISU::RemoveFromStudy(mySObject,false);
97 void VISU::ScalarMap_i::SameAs(const ScalarMap_i* theOrigin)
99 ScalarMap_i* aScalarMap = const_cast<ScalarMap_i*>(theOrigin);
101 VISU::Prs3d_i::SameAs(aScalarMap);
102 myField = aScalarMap->GetField();
103 myMeshName = myField->myMeshName;
104 myEntity = myField->myEntity;
105 myIteration = aScalarMap->GetIteration();
106 myFieldName = aScalarMap->GetFieldName();
108 SetScalarMode(aScalarMap->GetScalarMode());
110 SetRange(aScalarMap->GetMin(), aScalarMap->GetMax());
111 myIsFixedRange = aScalarMap->IsRangeFixed();
113 SetScaling(aScalarMap->GetScaling());
115 SetBarOrientation(aScalarMap->GetBarOrientation());
116 SetPosition(aScalarMap->GetPosX(), aScalarMap->GetPosY());
117 SetSize(aScalarMap->GetWidth(), aScalarMap->GetHeight());
118 SetNbColors(aScalarMap->GetNbColors());
119 SetLabels(aScalarMap->GetLabels());
120 SetTitle(aScalarMap->GetTitle());
122 SetBoldTitle(aScalarMap->IsBoldTitle());
123 SetItalicTitle(aScalarMap->IsItalicTitle());
124 SetShadowTitle(aScalarMap->IsShadowTitle());
125 SetTitFontType(aScalarMap->GetTitFontType());
127 aScalarMap->GetTitleColor(&r,&g,&b);
128 SetTitleColor(r,g,b);
130 SetBoldLabel(aScalarMap->IsBoldLabel());
131 SetItalicLabel(aScalarMap->IsItalicLabel());
132 SetShadowLabel(aScalarMap->IsShadowLabel());
133 SetLblFontType(aScalarMap->GetLblFontType());
134 aScalarMap->GetLabelColor(&r,&g,&b);
135 SetLabelColor(r,g,b);
143 * Creates Scalar Map and initialises it from resources
145 VISU::Storable* VISU::ScalarMap_i::Create(const char* theMeshName, VISU::Entity theEntity,
146 const char* theFieldName, int theIteration)
151 QString aOrient = VISU::GetResourceMgr()->stringValue("Visu:SBOrientation");
152 if ( !aOrient.isEmpty() )
153 myOrientation = (VISU::ScalarMap::Orientation) aOrient.toInt();
155 myOrientation = VISU::ScalarMap::VERTICAL;
158 QString aXorigin = VISU::GetResourceMgr()->stringValue("Visu:SBXorigin");
159 if ( !aXorigin.isEmpty() )
160 myPosition[0] = aXorigin.toFloat();
162 if(myOrientation == VISU::ScalarMap::VERTICAL) {
163 myPosition[0] = 0.03;
169 QString aYorigin = VISU::GetResourceMgr()->stringValue("Visu:SBYorigin");
170 if ( !aYorigin.isEmpty() )
171 myPosition[1] = aYorigin.toFloat();
173 if(myOrientation == VISU::ScalarMap::VERTICAL) {
176 myPosition[1] = 0.012;
181 QString aWidth = VISU::GetResourceMgr()->stringValue("Visu:SBWidth");
182 if ( !aWidth.isEmpty() )
183 myWidth = aWidth.toFloat();
185 myWidth =(myOrientation == VISU::ScalarMap::VERTICAL)? 0.17:0.6;
187 QString aHeight = VISU::GetResourceMgr()->stringValue("Visu:SBHeight");
188 if ( !aHeight.isEmpty() )
189 myHeight = aHeight.toFloat();
191 myHeight =(myOrientation == VISU::ScalarMap::VERTICAL)? 0.8:0.12;
195 QString aColors = VISU::GetResourceMgr()->stringValue("Visu:SBNumberOfColors");
196 int aNumberOfColors = (aColors.isEmpty())? 64 : aColors.toInt();
197 if (aNumberOfColors > 64)
198 aNumberOfColors = 64;
199 SetNbColors(aNumberOfColors);
202 QString aLabels = VISU::GetResourceMgr()->stringValue("Visu:SBNumberOfLabels");
203 myNumberOfLabels = (aLabels.isEmpty())? 5 : aLabels.toInt();
204 if (myNumberOfLabels > 65)
205 myNumberOfLabels = 65;
208 QString aFixRange = VISU::GetResourceMgr()->stringValue("Visu:SBImposeRange");
209 myIsFixedRange = (aFixRange.compare("true") == 0);
212 QString aRangeMin = VISU::GetResourceMgr()->stringValue("Visu:SBMinimumValue");
213 float aMin = (aRangeMin.isEmpty())? 0 : aRangeMin.toFloat();
214 QString aRangeMax = VISU::GetResourceMgr()->stringValue("Visu:SBMaximumValue");
215 float aMax = (aRangeMax.isEmpty())? 0 : aRangeMax.toFloat();
219 QString aScaling = VISU::GetResourceMgr()->stringValue("Visu:SBScaling");
220 if(aScaling.compare("LOGARITHMIC") == 0)
221 SetScaling(VISU::LOGARITHMIC);
223 SetScaling(VISU::LINEAR);
225 // Fonts properties definition
226 QString aIsBoldTitle = VISU::GetResourceMgr()->stringValue("Visu:IsBoldTitle");
227 myIsBoldTitle = (aIsBoldTitle.isEmpty())? true : (aIsBoldTitle.compare("true") == 0);
229 QString aIsItalicTitle = VISU::GetResourceMgr()->stringValue("Visu:IsItalicTitle");
230 myIsItalicTitle = (aIsItalicTitle.isEmpty())? true : (aIsItalicTitle.compare("true") == 0);
232 QString aIsShadowTitle = VISU::GetResourceMgr()->stringValue("Visu:IsShadowTitle");
233 myIsShadowTitle = (aIsShadowTitle.isEmpty())? true : (aIsShadowTitle.compare("true") == 0);
235 QString aTitFontType = VISU::GetResourceMgr()->stringValue("Visu:TitFontType");
236 if (!aTitFontType.isEmpty()) {
237 switch (aTitFontType.toInt()) {
238 case 0: myTitFontType = VTK_ARIAL; break;
239 case 1: myTitFontType = VTK_COURIER; break;
240 case 2: myTitFontType = VTK_TIMES; break;
243 myTitFontType = VTK_ARIAL;
245 QString aRTitColor = VISU::GetResourceMgr()->stringValue("Visu:TitleColorR");
246 myTitleColor[0] = (aRTitColor.isEmpty())? 1 : aRTitColor.toFloat();
247 if (myTitleColor[0] > 1) myTitleColor[0] = 1;
248 if (myTitleColor[0] < 0) myTitleColor[0] = 0;
250 QString aGTitColor = VISU::GetResourceMgr()->stringValue("Visu:TitleColorG");
251 myTitleColor[1] = (aGTitColor.isEmpty())? 1 : aGTitColor.toFloat();
252 if (myTitleColor[1] > 1) myTitleColor[1] = 1;
253 if (myTitleColor[1] < 0) myTitleColor[1] = 0;
255 QString aBTitColor = VISU::GetResourceMgr()->stringValue("Visu:TitleColorB");
256 myTitleColor[2] = (aBTitColor.isEmpty())? 1 : aBTitColor.toFloat();
257 if (myTitleColor[2] > 1) myTitleColor[2] = 1;
258 if (myTitleColor[2] < 0) myTitleColor[2] = 0;
262 QString aIsBoldLabel = VISU::GetResourceMgr()->stringValue("Visu:IsBoldLabel");
263 myIsBoldLabel = (aIsBoldLabel.isEmpty())? true : (aIsBoldLabel.compare("true") == 0);
265 QString aIsItalicLabel = VISU::GetResourceMgr()->stringValue("Visu:IsItalicLabel");
266 myIsItalicLabel = (aIsItalicLabel.isEmpty())? true : (aIsItalicLabel.compare("true") == 0);
268 QString aIsShadowLabel = VISU::GetResourceMgr()->stringValue("Visu:IsShadowLabel");
269 myIsShadowLabel = (aIsShadowLabel.isEmpty())? true : (aIsShadowLabel.compare("true") == 0);
271 QString aLblFontType = VISU::GetResourceMgr()->stringValue("Visu:LblFontType");
272 if (!aLblFontType.isEmpty()) {
273 switch (aLblFontType.toInt()) {
274 case 0: myLblFontType = VTK_ARIAL; break;
275 case 1: myLblFontType = VTK_COURIER; break;
276 case 2: myLblFontType = VTK_TIMES; break;
279 myLblFontType = VTK_ARIAL;
281 QString aRLblColor = VISU::GetResourceMgr()->stringValue("Visu:LabelColorR");
282 myLabelColor[0] = (aRLblColor.isEmpty())? 1 : aRLblColor.toFloat();
283 if (myLabelColor[0] > 1) myLabelColor[0] = 1;
284 if (myLabelColor[0] < 0) myLabelColor[0] = 0;
286 QString aGLblColor = VISU::GetResourceMgr()->stringValue("Visu:LabelColorG");
287 myLabelColor[1] = (aGLblColor.isEmpty())? 1 : aGLblColor.toFloat();
288 if (myLabelColor[1] > 1) myLabelColor[1] = 1;
289 if (myLabelColor[1] < 0) myLabelColor[1] = 0;
291 QString aBLblColor = VISU::GetResourceMgr()->stringValue("Visu:LabelColorB");
292 myLabelColor[2] = (aBLblColor.isEmpty())? 1 : aBLblColor.toFloat();
293 if (myLabelColor[2] > 1) myLabelColor[2] = 1;
294 if (myLabelColor[2] < 0) myLabelColor[2] = 0;
297 myMeshName = theMeshName;
298 myEntity = (VISU::TEntity)theEntity;
299 myFieldName =theFieldName;
300 myIteration = theIteration;
306 VISU::Storable* VISU::ScalarMap_i::Restore(const Storable::TRestoringMap& theMap)
309 myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
310 myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
311 myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
312 myIteration = VISU::Storable::FindValue(theMap,"myIteration").toInt();
314 SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
315 SetScaling(VISU::Scaling(VISU::Storable::FindValue(theMap,"myScaling").toInt()));
316 float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
317 float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
319 myIsFixedRange = VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt();
321 myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
322 myOrientation = (VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt();
323 SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
324 myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
325 myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
326 myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
327 myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
328 myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
330 myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
331 myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
332 myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
333 myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
334 myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
335 myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
336 myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
338 myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
339 myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
340 myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
341 myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
342 myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
343 myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
344 myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
346 Prs3d_i::Restore(theMap);
347 myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
352 void VISU::ScalarMap_i::ToStream(std::ostringstream& theStr){
353 Prs3d_i::ToStream(theStr);
355 Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
356 Storable::DataToStream( theStr, "myEntity", myEntity );
357 Storable::DataToStream( theStr, "myFieldName", myFieldName.c_str() );
358 Storable::DataToStream( theStr, "myIteration", myIteration );
360 Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) );
361 Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
362 Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
363 Storable::DataToStream( theStr, "myIsFixedRange", myIsFixedRange );
364 Storable::DataToStream( theStr, "myScaling", GetScaling() );
366 Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
367 Storable::DataToStream( theStr, "myOrientation", myOrientation );
368 Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
369 Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
370 Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] );
371 Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] );
372 Storable::DataToStream( theStr, "myWidth", myWidth );
373 Storable::DataToStream( theStr, "myHeight", myHeight );
375 Storable::DataToStream( theStr, "myTitFontType", myTitFontType );
376 Storable::DataToStream( theStr, "myIsBoldTitle", myIsBoldTitle );
377 Storable::DataToStream( theStr, "myIsItalicTitle", myIsItalicTitle );
378 Storable::DataToStream( theStr, "myIsShadowTitle", myIsShadowTitle );
379 Storable::DataToStream( theStr, "myTitleColor[0]", myTitleColor[0] );
380 Storable::DataToStream( theStr, "myTitleColor[1]", myTitleColor[1] );
381 Storable::DataToStream( theStr, "myTitleColor[2]", myTitleColor[2] );
383 Storable::DataToStream( theStr, "myLblFontType", myLblFontType );
384 Storable::DataToStream( theStr, "myIsBoldLabel", myIsBoldLabel );
385 Storable::DataToStream( theStr, "myIsItalicLabel", myIsItalicLabel );
386 Storable::DataToStream( theStr, "myIsShadowLabel", myIsShadowLabel );
387 Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
388 Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
389 Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
393 CORBA::Long VISU::ScalarMap_i::GetScalarMode(){
394 return myScalarMapPL->GetScalarMode();
396 void VISU::ScalarMap_i::SetScalarMode(CORBA::Long theScalarMode) {
397 myScalarMapPL->SetScalarMode(theScalarMode);
401 VISU::Scaling VISU::ScalarMap_i::GetScaling(){
402 return VISU::Scaling(myScalarMapPL->GetScaling());
404 void VISU::ScalarMap_i::SetScaling(VISU::Scaling theScaling){
405 myScalarMapPL->SetScaling(theScaling);
409 void VISU::ScalarMap_i::SetRange(CORBA::Double theMin, CORBA::Double theMax){
410 if(theMin > theMax) return;
411 float aScalarRange[2] = {theMin, theMax};
412 myScalarMapPL->SetScalarRange(aScalarRange);
413 myIsFixedRange = true;
416 CORBA::Double VISU::ScalarMap_i::GetMin(){
417 return myScalarMapPL->GetScalarRange()[0];
420 CORBA::Double VISU::ScalarMap_i::GetMax(){
421 return myScalarMapPL->GetScalarRange()[1];
425 void VISU::ScalarMap_i::SetNbColors(CORBA::Long theNbColors){
426 myScalarMapPL->SetNbColors(theNbColors);
429 CORBA::Long VISU::ScalarMap_i::GetNbColors(){
430 return myScalarMapPL->GetNbColors();
434 VISU::ScalarMap_i::~ScalarMap_i(){}
437 VISU::Storable* VISU::ScalarMap_i::Build(int theRestoring){
439 MESSAGE("ScalarMap_i::Build - "<<myFieldName<<"; theRestoring = "<<theRestoring);
440 SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
441 if(myAddToStudy) aStudyBuilder->NewCommand(); // There is a transaction
443 if(myResult->GetInput() == NULL)
444 throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
445 myField = myResult->GetInput()->GetField(myMeshName,myEntity,myFieldName);
446 if(myField == NULL) throw std::runtime_error("There is no Field with the parameters !!!");
447 VISU_Convertor::TOutput *anOutput =
448 myResult->GetInput()->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
449 if(anOutput == NULL) throw std::runtime_error("There is no TimeStamp with the parameters !!!");
450 myScalarMapPL->SetInput(anOutput);
451 myScalarMapPL->Build();
454 if(theRestoring <= 0){
455 if(theRestoring == 0) myScalarMapPL->Init();
456 if(!myIsFixedRange) myScalarMapPL->SetSourceRange();
457 const VISU::TValField& aValField = myField->myValField;
458 const VISU::PValForTime aValForTime = aValField.find(myIteration)->second;
459 aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
460 if (theRestoring == 0) myTitle = aComment.simplifyWhiteSpace().latin1();
463 myName = GenerateName().latin1();
464 aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
465 VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
466 string aResultEntry = myResult->GetEntry();
467 string aRefFatherEntry = myResult->GetRefFatherEntry();
468 string anEntry = myResult->GetEntry(aComment.latin1());
469 if(anEntry == "") throw std::runtime_error("There is no Entry for binding the presentation !!!");
470 aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
471 GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
472 CORBA::String_var anIOR = GetID();
473 CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
474 mySObject = myStudy->FindObjectIOR(anIOR);
476 }catch(std::exception& exc){
477 INFOS("Follow exception was occured :\n"<<exc.what());
480 INFOS("Unknown exception was occured!");
483 if(myAddToStudy) aStudyBuilder->CommitCommand();
488 void VISU::ScalarMap_i::DoHook(){
489 if(MYDEBUG) MESSAGE("ScalarMap_i::DoHook() - "<<myPipeLine);
491 myPipeLine = VISU_ScalarMapPL::New();
492 myPipeLine->GetMapper()->SetScalarVisibility(1);
494 myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
497 void VISU::ScalarMap_i::Update() {
498 VISU::Prs3d_i::Update();
501 void VISU::ScalarMap_i::SetMapScale(double theMapScale){
502 myScalarMapPL->SetMapScale(theMapScale);
505 VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
507 VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
509 VISU::Prs3d_i::CreateActor(anActor,theIO);
510 anActor->SetBarVisibility(true);
511 anActor->SetRepresentation(2);
512 UpdateActor(anActor);
515 throw std::runtime_error("CreateActor error");
520 void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) {
521 if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
522 VISU::Prs3d_i::UpdateActor(theActor);
523 VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
524 aScalarBar->SetLookupTable(myScalarMapPL->GetBarTable());
525 aScalarBar->SetTitle(myTitle.c_str());
526 aScalarBar->SetOrientation(myOrientation);
527 aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
528 aScalarBar->GetPositionCoordinate()->SetValue(myPosition[0],myPosition[1]);
529 aScalarBar->SetWidth(myWidth);
530 aScalarBar->SetHeight(myHeight);
531 aScalarBar->SetNumberOfLabels(myNumberOfLabels);
533 vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
534 aTitleProp->SetFontFamily(myTitFontType);
535 aTitleProp->SetColor(myTitleColor);
536 (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
537 (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
538 (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
540 vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
541 aLabelProp->SetFontFamily(myLblFontType);
542 aLabelProp->SetColor(myLabelColor);
543 (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
544 (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
545 (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
547 aScalarBar->Modified();
552 void VISU::ScalarMap_i::SetSourceRange(){
553 myScalarMapPL->SetSourceRange();
554 myIsFixedRange = false;