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"
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 VISU::ScalarMap_i::ScalarMap_i(Result_i* theResult, bool theAddToStudy, SALOMEDS::SObject_ptr theSObject) :
74 PrsObject_i(theResult->GetStudyDocument()),
75 Prs3d_i(theResult,theSObject)
77 myAddToStudy = theAddToStudy;
82 void VISU::ScalarMap_i::RemoveFromStudy(){
83 VISU::RemoveFromStudy(mySObject,false);
87 void VISU::ScalarMap_i::SameAs(const ScalarMap_i* theOrigin)
89 ScalarMap_i* aScalarMap = const_cast<ScalarMap_i*>(theOrigin);
91 VISU::Prs3d_i::SameAs(aScalarMap);
92 myField = aScalarMap->GetField();
93 myMeshName = myField->myMeshName;
94 myEntity = myField->myEntity;
95 myIteration = aScalarMap->GetIteration();
96 myFieldName = aScalarMap->GetFieldName();
98 SetScalarMode(aScalarMap->GetScalarMode());
100 SetRange(aScalarMap->GetMin(), aScalarMap->GetMax());
101 myIsFixedRange = aScalarMap->IsRangeFixed();
103 SetScaling(aScalarMap->GetScaling());
105 SetBarOrientation(aScalarMap->GetBarOrientation());
106 SetPosition(aScalarMap->GetPosX(), aScalarMap->GetPosY());
107 SetSize(aScalarMap->GetWidth(), aScalarMap->GetHeight());
108 SetNbColors(aScalarMap->GetNbColors());
109 SetLabels(aScalarMap->GetLabels());
110 SetTitle(aScalarMap->GetTitle());
112 SetBoldTitle(aScalarMap->IsBoldTitle());
113 SetItalicTitle(aScalarMap->IsItalicTitle());
114 SetShadowTitle(aScalarMap->IsShadowTitle());
115 SetTitFontType(aScalarMap->GetTitFontType());
117 aScalarMap->GetTitleColor(&r,&g,&b);
118 SetTitleColor(r,g,b);
120 SetBoldLabel(aScalarMap->IsBoldLabel());
121 SetItalicLabel(aScalarMap->IsItalicLabel());
122 SetShadowLabel(aScalarMap->IsShadowLabel());
123 SetLblFontType(aScalarMap->GetLblFontType());
124 aScalarMap->GetLabelColor(&r,&g,&b);
125 SetLabelColor(r,g,b);
133 * Creates Scalar Map and initialises it from resources
135 VISU::Storable* VISU::ScalarMap_i::Create(const char* theMeshName, VISU::Entity theEntity,
136 const char* theFieldName, int theIteration)
141 QString aOrient = QAD_CONFIG->getSetting("Visu:SBOrientation");
142 if ( !aOrient.isEmpty() )
143 myOrientation = (VISU::ScalarMap::Orientation) aOrient.toInt();
145 myOrientation = VISU::ScalarMap::VERTICAL;
148 QString aXorigin = QAD_CONFIG->getSetting("Visu:SBXorigin");
149 if ( !aXorigin.isEmpty() )
150 myPosition[0] = aXorigin.toFloat();
152 if(myOrientation == VISU::ScalarMap::VERTICAL) {
153 myPosition[0] = 0.03;
159 QString aYorigin = QAD_CONFIG->getSetting("Visu:SBYorigin");
160 if ( !aYorigin.isEmpty() )
161 myPosition[1] = aYorigin.toFloat();
163 if(myOrientation == VISU::ScalarMap::VERTICAL) {
166 myPosition[1] = 0.012;
171 QString aWidth = QAD_CONFIG->getSetting("Visu:SBWidth");
172 if ( !aWidth.isEmpty() )
173 myWidth = aWidth.toFloat();
175 myWidth =(myOrientation == VISU::ScalarMap::VERTICAL)? 0.17:0.6;
177 QString aHeight = QAD_CONFIG->getSetting("Visu:SBHeight");
178 if ( !aHeight.isEmpty() )
179 myHeight = aHeight.toFloat();
181 myHeight =(myOrientation == VISU::ScalarMap::VERTICAL)? 0.8:0.12;
185 QString aColors = QAD_CONFIG->getSetting("Visu:SBNumberOfColors");
186 int aNumberOfColors = (aColors.isEmpty())? 64 : aColors.toInt();
187 if (aNumberOfColors > 64)
188 aNumberOfColors = 64;
189 SetNbColors(aNumberOfColors);
192 QString aLabels = QAD_CONFIG->getSetting("Visu:SBNumberOfLabels");
193 myNumberOfLabels = (aLabels.isEmpty())? 5 : aLabels.toInt();
194 if (myNumberOfLabels > 65)
195 myNumberOfLabels = 65;
198 QString aFixRange = QAD_CONFIG->getSetting("Visu:SBImposeRange");
199 myIsFixedRange = (aFixRange.compare("true") == 0);
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)
299 myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
300 myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
301 myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
302 myIteration = VISU::Storable::FindValue(theMap,"myIteration").toInt();
304 SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
305 SetScaling(VISU::Scaling(VISU::Storable::FindValue(theMap,"myScaling").toInt()));
306 float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
307 float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
309 myIsFixedRange = VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt();
311 myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
312 myOrientation = (VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt();
313 SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
314 myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
315 myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
316 myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
317 myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
318 myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
320 myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
321 myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
322 myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
323 myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
324 myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
325 myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
326 myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
328 myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
329 myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
330 myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
331 myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
332 myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
333 myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
334 myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
336 Prs3d_i::Restore(theMap);
337 myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
342 void VISU::ScalarMap_i::ToStream(std::ostringstream& theStr){
343 Prs3d_i::ToStream(theStr);
345 Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
346 Storable::DataToStream( theStr, "myEntity", myEntity );
347 Storable::DataToStream( theStr, "myFieldName", myFieldName.c_str() );
348 Storable::DataToStream( theStr, "myIteration", myIteration );
350 Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) );
351 Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
352 Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
353 Storable::DataToStream( theStr, "myIsFixedRange", myIsFixedRange );
354 Storable::DataToStream( theStr, "myScaling", GetScaling() );
356 Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
357 Storable::DataToStream( theStr, "myOrientation", myOrientation );
358 Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
359 Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
360 Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] );
361 Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] );
362 Storable::DataToStream( theStr, "myWidth", myWidth );
363 Storable::DataToStream( theStr, "myHeight", myHeight );
365 Storable::DataToStream( theStr, "myTitFontType", myTitFontType );
366 Storable::DataToStream( theStr, "myIsBoldTitle", myIsBoldTitle );
367 Storable::DataToStream( theStr, "myIsItalicTitle", myIsItalicTitle );
368 Storable::DataToStream( theStr, "myIsShadowTitle", myIsShadowTitle );
369 Storable::DataToStream( theStr, "myTitleColor[0]", myTitleColor[0] );
370 Storable::DataToStream( theStr, "myTitleColor[1]", myTitleColor[1] );
371 Storable::DataToStream( theStr, "myTitleColor[2]", myTitleColor[2] );
373 Storable::DataToStream( theStr, "myLblFontType", myLblFontType );
374 Storable::DataToStream( theStr, "myIsBoldLabel", myIsBoldLabel );
375 Storable::DataToStream( theStr, "myIsItalicLabel", myIsItalicLabel );
376 Storable::DataToStream( theStr, "myIsShadowLabel", myIsShadowLabel );
377 Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
378 Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
379 Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
383 CORBA::Long VISU::ScalarMap_i::GetScalarMode(){
384 return myScalarMapPL->GetScalarMode();
386 void VISU::ScalarMap_i::SetScalarMode(CORBA::Long theScalarMode) {
387 myScalarMapPL->SetScalarMode(theScalarMode);
391 VISU::Scaling VISU::ScalarMap_i::GetScaling(){
392 return VISU::Scaling(myScalarMapPL->GetScaling());
394 void VISU::ScalarMap_i::SetScaling(VISU::Scaling theScaling){
395 myScalarMapPL->SetScaling(theScaling);
399 void VISU::ScalarMap_i::SetRange(CORBA::Double theMin, CORBA::Double theMax){
400 if(theMin > theMax) return;
401 float aScalarRange[2] = {theMin, theMax};
402 myScalarMapPL->SetScalarRange(aScalarRange);
403 myIsFixedRange = true;
406 CORBA::Double VISU::ScalarMap_i::GetMin(){
407 return myScalarMapPL->GetScalarRange()[0];
410 CORBA::Double VISU::ScalarMap_i::GetMax(){
411 return myScalarMapPL->GetScalarRange()[1];
415 void VISU::ScalarMap_i::SetNbColors(CORBA::Long theNbColors){
416 myScalarMapPL->SetNbColors(theNbColors);
419 CORBA::Long VISU::ScalarMap_i::GetNbColors(){
420 return myScalarMapPL->GetNbColors();
424 VISU::ScalarMap_i::~ScalarMap_i(){}
427 VISU::Storable* VISU::ScalarMap_i::Build(int theRestoring){
429 MESSAGE("ScalarMap_i::Build - "<<myFieldName<<"; theRestoring = "<<theRestoring);
430 SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
431 if(myAddToStudy) aStudyBuilder->NewCommand(); // There is a transaction
433 if(myResult->GetInput() == NULL)
434 throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
435 myField = myResult->GetInput()->GetField(myMeshName,myEntity,myFieldName);
436 if(myField == NULL) throw std::runtime_error("There is no Field with the parameters !!!");
437 VISU_Convertor::TOutput *anOutput =
438 myResult->GetInput()->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
439 if(anOutput == NULL) throw std::runtime_error("There is no TimeStamp with the parameters !!!");
440 myScalarMapPL->SetInput(anOutput);
441 myScalarMapPL->Build();
444 if(theRestoring <= 0){
445 if(theRestoring == 0) myScalarMapPL->Init();
446 if(!myIsFixedRange) myScalarMapPL->SetSourceRange();
447 const VISU::TValField& aValField = myField->myValField;
448 const VISU::PValForTime aValForTime = aValField.find(myIteration)->second;
449 aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
450 if (theRestoring == 0) myTitle = aComment.simplifyWhiteSpace().latin1();
453 myName = GenerateName().latin1();
454 aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
455 VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
456 string aResultEntry = myResult->GetEntry();
457 string aRefFatherEntry = myResult->GetRefFatherEntry();
458 string anEntry = myResult->GetEntry(aComment.latin1());
459 if(anEntry == "") throw std::runtime_error("There is no Entry for binding the presentation !!!");
460 aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
461 GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
462 CORBA::String_var anIOR = GetID();
463 CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
464 mySObject = myStudy->FindObjectIOR(anIOR);
466 }catch(std::exception& exc){
467 INFOS("Follow exception was occured :\n"<<exc.what());
470 INFOS("Unknown exception was occured!");
473 if(myAddToStudy) aStudyBuilder->CommitCommand();
478 void VISU::ScalarMap_i::DoHook(){
479 if(MYDEBUG) MESSAGE("ScalarMap_i::DoHook() - "<<myPipeLine);
481 myPipeLine = VISU_ScalarMapPL::New();
482 myPipeLine->GetMapper()->SetScalarVisibility(1);
484 myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
487 void VISU::ScalarMap_i::Update() {
488 VISU::Prs3d_i::Update();
491 void VISU::ScalarMap_i::SetMapScale(double theMapScale){
492 myScalarMapPL->SetMapScale(theMapScale);
495 VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
497 VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
499 VISU::Prs3d_i::CreateActor(anActor,theIO);
500 anActor->SetBarVisibility(true);
501 anActor->SetRepresentation(2);
502 UpdateActor(anActor);
505 throw std::runtime_error("CreateActor error");
510 void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) {
511 if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
512 VISU::Prs3d_i::UpdateActor(theActor);
513 VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
514 aScalarBar->SetLookupTable(myScalarMapPL->GetBarTable());
515 aScalarBar->SetTitle(myTitle.c_str());
516 aScalarBar->SetOrientation(myOrientation);
517 aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
518 aScalarBar->GetPositionCoordinate()->SetValue(myPosition[0],myPosition[1]);
519 aScalarBar->SetWidth(myWidth);
520 aScalarBar->SetHeight(myHeight);
521 aScalarBar->SetNumberOfLabels(myNumberOfLabels);
523 vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
524 aTitleProp->SetFontFamily(myTitFontType);
525 aTitleProp->SetColor(myTitleColor);
526 (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
527 (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
528 (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
530 vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
531 aLabelProp->SetFontFamily(myLblFontType);
532 aLabelProp->SetColor(myLabelColor);
533 (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
534 (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
535 (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
537 aScalarBar->Modified();
542 void VISU::ScalarMap_i::SetSourceRange(){
543 myScalarMapPL->SetSourceRange();
544 myIsFixedRange = false;