*/
interface ColoredPrs3d : Prs3d
{
+ /*! Sets Entity input parameter that defines where the parent mesh to be taken from.
+ */
void SetEntity(in Entity theEntity);
+ /*! Gets Entity input parameter that defines where the parent mesh is taken from.
+ */
Entity GetEntity();
+ /*! Sets name of field input parameter that defines what phisical data to be retrived.
+ */
void SetFieldName(in string theName);
+ /*! Gets name of field input parameter that defines what phisical data is retrived.
+ */
string GetFieldName();
+ /*! Sets number of timestamp input parameter that defines what time of phisical data to be retrived.
+ */
void SetTimeStampNumber(in long theTimeStampNumber);
+ /*! Gets number of timestamp input parameter that defines what time of phisical data is retrived.
+ */
long GetTimeStampNumber();
+ /*! Defines timestamp representation.
+ */
+ struct TimeStampInfo
+ {
+ string myTime;
+ long myNumber;
+ };
+
+ /*! Defines representation range of timestamps.
+ */
+ typedef sequence<TimeStampInfo> TimeStampsRange;
+
+ /*! Gets available range of timestamps.
+ */
+ TimeStampsRange GetTimeStampsRange();
+
/*! Sets the method of coloring of the elements composing a 3D presentation.
*/
void SetScalarMode(in long theScalarMode);
Update();
}
+VISU::ColoredPrs3d::TimeStampsRange*
+VISU::ColoredPrs3d_i
+::GetTimeStampsRange()
+{
+ typedef std::map<std::string, long> TTimeStampsRange;
+ TTimeStampsRange aRange;
+ {
+ const VISU::TValField& aValField = GetField()->myValField;
+ VISU::TValField::const_iterator anIter = aValField.begin();
+ for(; anIter != aValField.end(); anIter++){
+ vtkIdType aTimeStampNumber = anIter->first;
+ const PValForTime& aValForTime = anIter->second;
+ std::string aTime = VISU_Convertor::GenerateName(aValForTime->myTime);
+ aRange[aTime] = aTimeStampNumber;
+ }
+ }
+ VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange();
+ {
+ aTimeStampsRange->length(aRange.size());
+ TTimeStampsRange::const_iterator anIter = aRange.begin();
+ for(size_t aCounter = 0; anIter != aRange.end(); anIter++, aCounter++){
+ vtkIdType aTimeStampNumber = anIter->second;
+ const std::string& aTime = anIter->first;
+ VISU::ColoredPrs3d::TimeStampInfo anInfo;
+ anInfo.myNumber = aTimeStampNumber;
+ anInfo.myTime = aTime.c_str();
+ aTimeStampsRange[aCounter] = anInfo;
+ }
+ }
+ return aTimeStampsRange._retn();
+}
//----------------------------------------------------------------------------
CORBA::Long
CORBA::Long
GetTimeStampNumber();
+ virtual
+ VISU::ColoredPrs3d::TimeStampsRange*
+ GetTimeStampsRange();
+
//----------------------------------------------------------------------------
virtual
CORBA::Long
print "\ttheFieldName = '%s'" % theFieldName
print "\ttheTimeStampNumber = %s" % theTimeStampNumber
return
+
+ aRange = aPrs3d.GetTimeStampsRange()
+ for anInfo in aRange:
+ print "%d (%s); " % (anInfo.myNumber, anInfo.myTime),
+ pass
+ print
aView = theViewManager.Create3DView();
aView.SetTitle("To test presentation of %s type" % theVISUType)
aView.FitAll()
aDelay = 0.0
- for aTimeStampNumber in xrange(1,3):
+ for aTimeStampNumber in xrange(1,7):
aPrs3d.SetTimeStampNumber(aTimeStampNumber)
aPrs3d.Apply()
aView.Update();
#---------------------------------------------------------------
aMedFile = "TimeStamps.med"
-aMedFile = "ResOK_0000.med"
+#aMedFile = "ResOK_0000.med"
aMedFile = os.getenv('DATA_DIR') + '/MedFiles/' + aMedFile
aResult = myVisu.ImportFile(aMedFile)