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;
41 static int MYDEBUGWITHFILES = 0;
43 static int MYDEBUG = 0;
44 static int MYDEBUGWITHFILES = 0;
47 static int INCMEMORY = 4;
49 int VISU::ScalarMap_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
50 const char* theFieldName, int theIteration, int isMemoryCheck)
53 float aSize = INCMEMORY*
54 theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
57 aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
58 MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
61 }catch(std::exception& exc){
62 INFOS("Follow exception was occured :\n"<<exc.what());
64 INFOS("Unknown exception was occured!");
69 int VISU::ScalarMap_i::myNbPresent = 0;
70 QString VISU::ScalarMap_i::GenerateName() { return VISU::GenerateName("ScalarMap",myNbPresent++);}
72 const string VISU::ScalarMap_i::myComment = "SCALARMAP";
73 const char* VISU::ScalarMap_i::GetComment() const { return myComment.c_str();}
75 VISU::ScalarMap_i::ScalarMap_i(Result_i* theResult, bool theAddToStudy, SALOMEDS::SObject_ptr theSObject) :
76 PrsObject_i(theResult->GetStudyDocument()),
77 Prs3d_i(theResult,theSObject)
79 myAddToStudy = theAddToStudy;
84 void VISU::ScalarMap_i::RemoveFromStudy(){
85 VISU::RemoveFromStudy(mySObject,false);
89 void VISU::ScalarMap_i::SameAs(const ScalarMap_i* theOrigin)
91 ScalarMap_i* aScalarMap = const_cast<ScalarMap_i*>(theOrigin);
93 VISU::Prs3d_i::SameAs(aScalarMap);
94 myField = aScalarMap->GetField();
95 myMeshName = myField->myMeshName;
96 myEntity = myField->myEntity;
97 myIteration = aScalarMap->GetIteration();
98 myFieldName = aScalarMap->GetFieldName();
100 SetScalarMode(aScalarMap->GetScalarMode());
102 SetRange(aScalarMap->GetMin(), aScalarMap->GetMax());
103 myIsFixedRange = aScalarMap->IsRangeFixed();
105 SetScaling(aScalarMap->GetScaling());
107 SetBarOrientation(aScalarMap->GetBarOrientation());
108 SetPosition(aScalarMap->GetPosX(), aScalarMap->GetPosY());
109 SetSize(aScalarMap->GetWidth(), aScalarMap->GetHeight());
110 SetNbColors(aScalarMap->GetNbColors());
111 SetLabels(aScalarMap->GetLabels());
112 SetTitle(aScalarMap->GetTitle());
114 SetBoldTitle(aScalarMap->IsBoldTitle());
115 SetItalicTitle(aScalarMap->IsItalicTitle());
116 SetShadowTitle(aScalarMap->IsShadowTitle());
117 SetTitFontType(aScalarMap->GetTitFontType());
119 aScalarMap->GetTitleColor(&r,&g,&b);
120 SetTitleColor(r,g,b);
122 SetBoldLabel(aScalarMap->IsBoldLabel());
123 SetItalicLabel(aScalarMap->IsItalicLabel());
124 SetShadowLabel(aScalarMap->IsShadowLabel());
125 SetLblFontType(aScalarMap->GetLblFontType());
126 aScalarMap->GetLabelColor(&r,&g,&b);
127 SetLabelColor(r,g,b);
135 * Creates Scalar Map and initialises it from resources
137 VISU::Storable* VISU::ScalarMap_i::Create(const char* theMeshName, VISU::Entity theEntity,
138 const char* theFieldName, int theIteration)
143 QString aOrient = QAD_CONFIG->getSetting("Visu:SBOrientation");
144 if ( !aOrient.isEmpty() )
145 myOrientation = (VISU::ScalarMap::Orientation) aOrient.toInt();
147 myOrientation = VISU::ScalarMap::VERTICAL;
150 QString aXorigin = QAD_CONFIG->getSetting("Visu:SBXorigin");
151 if ( !aXorigin.isEmpty() )
152 myPosition[0] = aXorigin.toFloat();
154 if(myOrientation == VISU::ScalarMap::VERTICAL) {
155 myPosition[0] = 0.03;
161 QString aYorigin = QAD_CONFIG->getSetting("Visu:SBYorigin");
162 if ( !aYorigin.isEmpty() )
163 myPosition[1] = aYorigin.toFloat();
165 if(myOrientation == VISU::ScalarMap::VERTICAL) {
168 myPosition[1] = 0.012;
173 QString aWidth = QAD_CONFIG->getSetting("Visu:SBWidth");
174 if ( !aWidth.isEmpty() )
175 myWidth = aWidth.toFloat();
177 myWidth =(myOrientation == VISU::ScalarMap::VERTICAL)? 0.17:0.6;
179 QString aHeight = QAD_CONFIG->getSetting("Visu:SBHeight");
180 if ( !aHeight.isEmpty() )
181 myHeight = aHeight.toFloat();
183 myHeight =(myOrientation == VISU::ScalarMap::VERTICAL)? 0.8:0.12;
187 QString aColors = QAD_CONFIG->getSetting("Visu:SBNumberOfColors");
188 int aNumberOfColors = (aColors.isEmpty())? 64 : aColors.toInt();
189 if (aNumberOfColors > 64)
190 aNumberOfColors = 64;
191 SetNbColors(aNumberOfColors);
194 QString aLabels = QAD_CONFIG->getSetting("Visu:SBNumberOfLabels");
195 myNumberOfLabels = (aLabels.isEmpty())? 5 : aLabels.toInt();
196 if (myNumberOfLabels > 65)
197 myNumberOfLabels = 65;
200 QString aFixRange = QAD_CONFIG->getSetting("Visu:SBImposeRange");
201 myIsFixedRange = (aFixRange.compare("true") == 0);
204 float aScalarRange[2];
205 QString aRangeMin = QAD_CONFIG->getSetting("Visu:SBMinimumValue");
206 float aMin = (aRangeMin.isEmpty())? 0 : aRangeMin.toFloat();
207 QString aRangeMax = QAD_CONFIG->getSetting("Visu:SBMaximumValue");
208 float aMax = (aRangeMax.isEmpty())? 0 : aRangeMax.toFloat();
212 QString aScaling = QAD_CONFIG->getSetting("Visu:SBScaling");
213 if(aScaling.compare("LOGARITHMIC") == 0)
214 SetScaling(VISU::LOGARITHMIC);
216 SetScaling(VISU::LINEAR);
218 // Fonts properties definition
219 QString aIsBoldTitle = QAD_CONFIG->getSetting("Visu:IsBoldTitle");
220 myIsBoldTitle = (aIsBoldTitle.isEmpty())? true : (aIsBoldTitle.compare("true") == 0);
222 QString aIsItalicTitle = QAD_CONFIG->getSetting("Visu:IsItalicTitle");
223 myIsItalicTitle = (aIsItalicTitle.isEmpty())? true : (aIsItalicTitle.compare("true") == 0);
225 QString aIsShadowTitle = QAD_CONFIG->getSetting("Visu:IsShadowTitle");
226 myIsShadowTitle = (aIsShadowTitle.isEmpty())? true : (aIsShadowTitle.compare("true") == 0);
228 QString aTitFontType = QAD_CONFIG->getSetting("Visu:TitFontType");
229 if (!aTitFontType.isEmpty()) {
230 switch (aTitFontType.toInt()) {
231 case 0: myTitFontType = VTK_ARIAL; break;
232 case 1: myTitFontType = VTK_COURIER; break;
233 case 2: myTitFontType = VTK_TIMES; break;
236 myTitFontType = VTK_ARIAL;
238 QString aRTitColor = QAD_CONFIG->getSetting("Visu:TitleColorR");
239 myTitleColor[0] = (aRTitColor.isEmpty())? 1 : aRTitColor.toFloat();
240 if (myTitleColor[0] > 1) myTitleColor[0] = 1;
241 if (myTitleColor[0] < 0) myTitleColor[0] = 0;
243 QString aGTitColor = QAD_CONFIG->getSetting("Visu:TitleColorG");
244 myTitleColor[1] = (aGTitColor.isEmpty())? 1 : aGTitColor.toFloat();
245 if (myTitleColor[1] > 1) myTitleColor[1] = 1;
246 if (myTitleColor[1] < 0) myTitleColor[1] = 0;
248 QString aBTitColor = QAD_CONFIG->getSetting("Visu:TitleColorB");
249 myTitleColor[2] = (aBTitColor.isEmpty())? 1 : aBTitColor.toFloat();
250 if (myTitleColor[2] > 1) myTitleColor[2] = 1;
251 if (myTitleColor[2] < 0) myTitleColor[2] = 0;
255 QString aIsBoldLabel = QAD_CONFIG->getSetting("Visu:IsBoldLabel");
256 myIsBoldLabel = (aIsBoldLabel.isEmpty())? true : (aIsBoldLabel.compare("true") == 0);
258 QString aIsItalicLabel = QAD_CONFIG->getSetting("Visu:IsItalicLabel");
259 myIsItalicLabel = (aIsItalicLabel.isEmpty())? true : (aIsItalicLabel.compare("true") == 0);
261 QString aIsShadowLabel = QAD_CONFIG->getSetting("Visu:IsShadowLabel");
262 myIsShadowLabel = (aIsShadowLabel.isEmpty())? true : (aIsShadowLabel.compare("true") == 0);
264 QString aLblFontType = QAD_CONFIG->getSetting("Visu:LblFontType");
265 if (!aLblFontType.isEmpty()) {
266 switch (aLblFontType.toInt()) {
267 case 0: myLblFontType = VTK_ARIAL; break;
268 case 1: myLblFontType = VTK_COURIER; break;
269 case 2: myLblFontType = VTK_TIMES; break;
272 myLblFontType = VTK_ARIAL;
274 QString aRLblColor = QAD_CONFIG->getSetting("Visu:LabelColorR");
275 myLabelColor[0] = (aRLblColor.isEmpty())? 1 : aRLblColor.toFloat();
276 if (myLabelColor[0] > 1) myLabelColor[0] = 1;
277 if (myLabelColor[0] < 0) myLabelColor[0] = 0;
279 QString aGLblColor = QAD_CONFIG->getSetting("Visu:LabelColorG");
280 myLabelColor[1] = (aGLblColor.isEmpty())? 1 : aGLblColor.toFloat();
281 if (myLabelColor[1] > 1) myLabelColor[1] = 1;
282 if (myLabelColor[1] < 0) myLabelColor[1] = 0;
284 QString aBLblColor = QAD_CONFIG->getSetting("Visu:LabelColorB");
285 myLabelColor[2] = (aBLblColor.isEmpty())? 1 : aBLblColor.toFloat();
286 if (myLabelColor[2] > 1) myLabelColor[2] = 1;
287 if (myLabelColor[2] < 0) myLabelColor[2] = 0;
290 myMeshName = theMeshName;
291 myEntity = (VISU::TEntity)theEntity;
292 myFieldName =theFieldName;
293 myIteration = theIteration;
299 VISU::Storable* VISU::ScalarMap_i::Restore(const Storable::TRestoringMap& theMap)
302 myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
303 myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
304 myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
305 myIteration = VISU::Storable::FindValue(theMap,"myIteration").toInt();
307 SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
308 SetScaling(VISU::Scaling(VISU::Storable::FindValue(theMap,"myScaling").toInt()));
309 float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
310 float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
312 myIsFixedRange = VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt();
314 myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
315 myOrientation = (VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt();
316 SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
317 myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
318 myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
319 myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
320 myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
321 myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
323 myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
324 myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
325 myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
326 myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
327 myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
328 myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
329 myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
331 myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
332 myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
333 myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
334 myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
335 myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
336 myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
337 myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
339 Prs3d_i::Restore(theMap);
340 myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
345 void VISU::ScalarMap_i::ToStream(std::ostringstream& theStr){
346 Prs3d_i::ToStream(theStr);
348 Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
349 Storable::DataToStream( theStr, "myEntity", myEntity );
350 Storable::DataToStream( theStr, "myFieldName", myFieldName.c_str() );
351 Storable::DataToStream( theStr, "myIteration", myIteration );
353 Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) );
354 Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
355 Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
356 Storable::DataToStream( theStr, "myIsFixedRange", myIsFixedRange );
357 Storable::DataToStream( theStr, "myScaling", GetScaling() );
359 Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
360 Storable::DataToStream( theStr, "myOrientation", myOrientation );
361 Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
362 Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
363 Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] );
364 Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] );
365 Storable::DataToStream( theStr, "myWidth", myWidth );
366 Storable::DataToStream( theStr, "myHeight", myHeight );
368 Storable::DataToStream( theStr, "myTitFontType", myTitFontType );
369 Storable::DataToStream( theStr, "myIsBoldTitle", myIsBoldTitle );
370 Storable::DataToStream( theStr, "myIsItalicTitle", myIsItalicTitle );
371 Storable::DataToStream( theStr, "myIsShadowTitle", myIsShadowTitle );
372 Storable::DataToStream( theStr, "myTitleColor[0]", myTitleColor[0] );
373 Storable::DataToStream( theStr, "myTitleColor[1]", myTitleColor[1] );
374 Storable::DataToStream( theStr, "myTitleColor[2]", myTitleColor[2] );
376 Storable::DataToStream( theStr, "myLblFontType", myLblFontType );
377 Storable::DataToStream( theStr, "myIsBoldLabel", myIsBoldLabel );
378 Storable::DataToStream( theStr, "myIsItalicLabel", myIsItalicLabel );
379 Storable::DataToStream( theStr, "myIsShadowLabel", myIsShadowLabel );
380 Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
381 Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
382 Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
386 CORBA::Long VISU::ScalarMap_i::GetScalarMode(){
387 return myScalarMapPL->GetScalarMode();
389 void VISU::ScalarMap_i::SetScalarMode(CORBA::Long theScalarMode) {
390 myScalarMapPL->SetScalarMode(theScalarMode);
394 VISU::Scaling VISU::ScalarMap_i::GetScaling(){
395 return VISU::Scaling(myScalarMapPL->GetScaling());
397 void VISU::ScalarMap_i::SetScaling(VISU::Scaling theScaling){
398 myScalarMapPL->SetScaling(theScaling);
402 void VISU::ScalarMap_i::SetRange(CORBA::Double theMin, CORBA::Double theMax){
403 if(theMin > theMax) return;
404 float aScalarRange[2] = {theMin, theMax};
405 myScalarMapPL->SetScalarRange(aScalarRange);
406 myIsFixedRange = true;
409 CORBA::Double VISU::ScalarMap_i::GetMin(){
410 return myScalarMapPL->GetScalarRange()[0];
413 CORBA::Double VISU::ScalarMap_i::GetMax(){
414 return myScalarMapPL->GetScalarRange()[1];
418 void VISU::ScalarMap_i::SetNbColors(CORBA::Long theNbColors){
419 myScalarMapPL->SetNbColors(theNbColors);
422 CORBA::Long VISU::ScalarMap_i::GetNbColors(){
423 return myScalarMapPL->GetNbColors();
427 VISU::ScalarMap_i::~ScalarMap_i(){}
430 VISU::Storable* VISU::ScalarMap_i::Build(int theRestoring){
432 MESSAGE("ScalarMap_i::Build - "<<myFieldName<<"; theRestoring = "<<theRestoring);
433 SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
434 if(myAddToStudy) aStudyBuilder->NewCommand(); // There is a transaction
436 if(myResult->GetInput() == NULL)
437 throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
438 myField = &(myResult->GetInput()->GetField(myMeshName,myEntity,myFieldName));
439 if(myField == NULL) throw std::runtime_error("There is no Field with the parameters !!!");
440 VISU_Convertor::TOutput *anOutput =
441 myResult->GetInput()->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
442 if(anOutput == NULL) throw std::runtime_error("There is no TimeStamp with the parameters !!!");
443 myScalarMapPL->SetInput(anOutput);
444 myScalarMapPL->Build();
447 if(theRestoring <= 0){
448 if(theRestoring == 0) myScalarMapPL->Init();
449 if(!myIsFixedRange) myScalarMapPL->SetSourceRange();
450 const VISU::TField::TValField& aValField = myField->myValField;
451 const VISU::TField::TValForTime& aValForTime = aValField.find(myIteration)->second;
452 aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime.myTime).c_str());
453 if (theRestoring == 0) myTitle = aComment.simplifyWhiteSpace().latin1();
456 myName = GenerateName().latin1();
457 aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
458 VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
459 string aResultEntry = myResult->GetEntry();
460 string aRefFatherEntry = myResult->GetRefFatherEntry();
461 string anEntry = FindEntryWithComment(myStudy,aResultEntry.c_str(),aComment.latin1());
462 if(anEntry == "") throw std::runtime_error("There is no Entry for binding the presentation !!!");
463 aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
464 GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
465 CORBA::String_var anIOR = GetID();
466 CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
467 mySObject = myStudy->FindObjectIOR(anIOR);
469 }catch(std::exception& exc){
470 INFOS("Follow exception was occured :\n"<<exc.what());
473 INFOS("Unknown exception was occured!");
476 if(myAddToStudy) aStudyBuilder->CommitCommand();
481 void VISU::ScalarMap_i::DoHook(){
482 if(MYDEBUG) MESSAGE("ScalarMap_i::DoHook() - "<<myPipeLine);
484 myPipeLine = VISU_ScalarMapPL::New();
485 myPipeLine->GetMapper()->SetScalarVisibility(1);
487 myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
490 void VISU::ScalarMap_i::Update() {
491 VISU::Prs3d_i::Update();
494 void VISU::ScalarMap_i::SetMapScale(double theMapScale){
495 myScalarMapPL->SetMapScale(theMapScale);
498 VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
500 VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
502 VISU::Prs3d_i::CreateActor(anActor,theIO);
503 anActor->SetBarVisibility(true);
504 anActor->SetRepresentation(2);
505 anActor->myFieldName = myFieldName;
506 UpdateActor(anActor);
509 throw std::runtime_error("CreateActor error");
514 void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) {
515 if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
516 VISU::Prs3d_i::UpdateActor(theActor);
517 VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
518 aScalarBar->SetLookupTable(myScalarMapPL->GetBarTable());
519 aScalarBar->SetTitle(myTitle.c_str());
520 aScalarBar->SetOrientation(myOrientation);
521 aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
522 aScalarBar->GetPositionCoordinate()->SetValue(myPosition[0],myPosition[1]);
523 aScalarBar->SetWidth(myWidth);
524 aScalarBar->SetHeight(myHeight);
525 aScalarBar->SetNumberOfLabels(myNumberOfLabels);
527 vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
528 aTitleProp->SetFontFamily(myTitFontType);
529 aTitleProp->SetColor(myTitleColor);
530 (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
531 (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
532 (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
534 vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
535 aLabelProp->SetFontFamily(myLblFontType);
536 aLabelProp->SetColor(myLabelColor);
537 (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
538 (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
539 (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
541 aScalarBar->Modified();
546 void VISU::ScalarMap_i::SetSourceRange(){
547 myScalarMapPL->SetSourceRange();
548 myIsFixedRange = false;