#include "SUIT_ResourceMgr.h"
#include "SALOME_Event.hxx"
+#include <strstream>
#include <vtkMapper.h>
#ifdef _DEBUG_
CreatePipeLine(NULL); // to create proper pipeline
DoSetInput();
+ SetTitle(GetCTitle().c_str());
return anIsNotCreated;
}
}
-//---------------------------------------------------------------
-void
+//----------------------------------------------------------------------------
+const VISU::PValForTime&
VISU::ColoredPrs3d_i
-::SameAs(const Prs3d_i* theOrigin)
-{
- if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
- ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
-
- SetMeshName(anOrigin->GetCMeshName().c_str());
- SetEntity(anOrigin->GetEntity());
- SetFieldName(anOrigin->GetCFieldName().c_str());
- SetTimeStampNumber(anOrigin->GetTimeStampNumber());
- OnSetInput();
-
- Build(ESameAs);
-
- TSuperClass::SameAs(theOrigin);
-
- SetScalarMode(anOrigin->GetScalarMode());
- SetNbColors(anOrigin->GetNbColors());
- SetBarOrientation(anOrigin->GetBarOrientation());
-
- SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
- SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
- SetLabels(anOrigin->GetLabels());
- SetTitle(anOrigin->GetTitle());
-
- SetBoldTitle(anOrigin->IsBoldTitle());
- SetItalicTitle(anOrigin->IsItalicTitle());
- SetShadowTitle(anOrigin->IsShadowTitle());
- SetTitFontType(anOrigin->GetTitFontType());
- vtkFloatingPointType r,g,b;
- anOrigin->GetTitleColor(&r,&g,&b);
- SetTitleColor(r,g,b);
-
- SetBoldLabel(anOrigin->IsBoldLabel());
- SetItalicLabel(anOrigin->IsItalicLabel());
- SetShadowLabel(anOrigin->IsShadowLabel());
- SetLblFontType(anOrigin->GetLblFontType());
- anOrigin->GetLabelColor(&r,&g,&b);
- SetLabelColor(r,g,b);
- }
+::GetValForTime() const
+{
+ VISU::TValField& aValField = GetField()->myValField;
+ PValForTime& aValForTime = aValField[myTimeStampNumber];
+ return aValForTime;
}
-
-void
-VISU::ColoredPrs3d_i
-::SameAsParams(const ColoredPrs3d_i* theOrigin)
-{
- int aTimeStampNumber = GetTimeStampNumber();
- SameAs(theOrigin);
- SetTimeStampNumber(aTimeStampNumber);
- OnSetInput();
- Build(ESameAs);
- Update();
-}
VISU::ColoredPrs3d::TimeStampsRange*
VISU::ColoredPrs3d_i
{
VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange();
VISU::TValField& aValField = GetField()->myValField;
- if(myIsTimeStampFixed){
+ if(IsTimeStampFixed()){
aTimeStampsRange->length(1);
PValForTime& aValForTime = aValField[GetTimeStampNumber()];
std::string aTime = VISU_Convertor::GenerateName(aValForTime->myTime);
return aTimeStampsRange._retn();
}
+//----------------------------------------------------------------------------
+CORBA::Boolean
+VISU::ColoredPrs3d_i
+::IsTimeStampFixed()
+{
+ return myIsTimeStampFixed;
+}
+
+//---------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+ if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
+ ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
+
+ SetMeshName(anOrigin->GetCMeshName().c_str());
+ SetEntity(anOrigin->GetEntity());
+ SetFieldName(anOrigin->GetCFieldName().c_str());
+ SetTimeStampNumber(anOrigin->GetTimeStampNumber());
+ OnSetInput();
+
+ Build(ESameAs);
+
+ TSuperClass::SameAs(theOrigin);
+
+ SetScalarMode(anOrigin->GetScalarMode());
+ SetNbColors(anOrigin->GetNbColors());
+ SetBarOrientation(anOrigin->GetBarOrientation());
+
+ SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
+ SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
+ SetLabels(anOrigin->GetLabels());
+ SetTitle(anOrigin->GetTitle());
+
+ SetBoldTitle(anOrigin->IsBoldTitle());
+ SetItalicTitle(anOrigin->IsItalicTitle());
+ SetShadowTitle(anOrigin->IsShadowTitle());
+ SetTitFontType(anOrigin->GetTitFontType());
+ vtkFloatingPointType r,g,b;
+ anOrigin->GetTitleColor(&r,&g,&b);
+ SetTitleColor(r,g,b);
+
+ SetBoldLabel(anOrigin->IsBoldLabel());
+ SetItalicLabel(anOrigin->IsItalicLabel());
+ SetShadowLabel(anOrigin->IsShadowLabel());
+ SetLblFontType(anOrigin->GetLblFontType());
+ anOrigin->GetLabelColor(&r,&g,&b);
+ SetLabelColor(r,g,b);
+ }
+}
+
+void
+VISU::ColoredPrs3d_i
+::SameAsParams(const ColoredPrs3d_i* theOrigin)
+{
+ int aTimeStampNumber = GetTimeStampNumber();
+ SameAs(theOrigin);
+ SetTimeStampNumber(aTimeStampNumber);
+ OnSetInput();
+
+ Build(ESameAs);
+ Update();
+}
+
//----------------------------------------------------------------------------
CORBA::Long
VISU::ColoredPrs3d_i
VISU::ColoredPrs3d_i
::SetTitle(const char* theTitle)
{
- if(myTitle != theTitle){
+ std::strstream aStream;
+ const VISU::PValForTime& aValForTime = GetValForTime();
+ aStream<<theTitle<<" "<<VISU_Convertor::GenerateName(aValForTime->myTime)<<std::ends;
+ std::string aScalarBarTitle = aStream.str();
+ if(myTitle != theTitle || myScalarBarTitle != aScalarBarTitle){
+ myScalarBarTitle = aScalarBarTitle;
myTitle = theTitle;
myParamsTime.Modified();
}
myIsFixedRange = theUseFixedRange;
}
+std::string
+VISU::ColoredPrs3d_i
+::GetScalarBarTitle()
+{
+ return myScalarBarTitle;
+}
+
//----------------------------------------------------------------------------
/**
* Creates ColoredPrs3d and initialises it from resources
if(theBuildMode == ECreateNew || theBuildMode == ESameAs){
if(!myIsFixedRange)
myScalarMapPL->SetSourceRange();
- const VISU::TValField& aValField = GetField()->myValField;
- const VISU::PValForTime aValForTime = aValField.find(GetTimeStampNumber())->second;
- aComment.sprintf("%s %s",
- GetCFieldName().c_str(),
- VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
if(theBuildMode == ECreateNew)
- myTitle = aComment.simplifyWhiteSpace().latin1();
+ SetTitle(GetCFieldName().c_str());
}
if(myPublishInStudyMode == EPublishUnderTimeStamp){
myName = GenerateName().latin1();