1. It is forbiden to change input of Prs3d objects outside of "3D Cache System". So, corresponding functions are removed from IDL (but stays as it is in implementation)
2. "ScalaraMapOnDefomedShape" presentation was modified in the following way:
a) Method
void SetScalarField(in string theMeshName, in string theFieldName, in long theIteration, in Entity theEntity)
was changed to the
void SetScalarField(in Entity theEntity, in string theFieldName, in long theTimeStampNumber)
b) Method
string GetScalarCMeshName()
was removed at all
c) Method
Entity GetScalarEEntity()
was changed to the
Entity GetScalarEntity();
c) Method
long GetScalarLIteration();
was changed to the
long GetScalarTimeStampNumber();
d) Method
string GetScalarCFieldName();
was changed to the
string GetScalarFieldName();
const std::string& theFieldName,
CORBA::Long theTimeStampNumber)
{
- SetScalarField(theMeshName.c_str(),
- theFieldName.c_str(),
- theTimeStampNumber,
- theEntity);
-
- return TSuperClass::Create(theMeshName,
+ TSuperClass::Create(theMeshName,
theEntity,
theFieldName,
theTimeStampNumber);
+ SetScalarField(theEntity,
+ theFieldName.c_str(),
+ theTimeStampNumber);
+ return this;
}
QString aFieldName = VISU::Storable::FindValue(theMap,"myScalarFieldName");
int aTimeStampNumber = VISU::Storable::FindValue(theMap,"myScalarIteration").toInt();
- SetScalarField(aMeshName,
+ SetScalarField(anEntity,
aFieldName,
- aTimeStampNumber,
- anEntity);
+ aTimeStampNumber);
SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
{
TSuperClass::ToStream(theStr);
+ Storable::DataToStream( theStr, "myScalarEntity", int(myScalarEntity));
Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
- Storable::DataToStream( theStr, "myScalarMeshName", myScalarMeshName.c_str());
Storable::DataToStream( theStr, "myScalarIteration", int(myScalarTimeStampNumber));
- Storable::DataToStream( theStr, "myScalarEntity", int(myScalarEntity));
Storable::DataToStream( theStr, "myFactor", GetScale() );
}
if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
- CORBA::String_var aMeshName = anOrigin->GetScalarCMeshName();
- CORBA::String_var aFieldName = anOrigin->GetScalarCFieldName();
+ CORBA::String_var aFieldName = anOrigin->GetScalarFieldName();
- SetScalarField(aMeshName,
+ SetScalarField(anOrigin->GetScalarEntity(),
aFieldName,
- anOrigin->GetScalarLIteration(),
- anOrigin->GetScalarEEntity());
+ anOrigin->GetScalarTimeStampNumber());
Update();
}
}
//---------------------------------------------------------------
void
VISU::ScalarMapOnDeformedShape_i
-::SetScalarField(const char* theMeshName,
- const char* theFieldName,
- CORBA::Long theTimeStampNumber,
- VISU::Entity theEntity)
+::SetScalarField(VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theTimeStampNumber)
{
bool anIsModified = false;
- if(!anIsModified)
- anIsModified |= myScalarMeshName != theMeshName;
-
if(!anIsModified)
anIsModified |= myScalarEntity != theEntity;
VISU::TEntity aEntity = VISU::TEntity(theEntity);
VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
- myScalarField = anInput->GetField(theMeshName, aEntity, theFieldName);
+ myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
VISU::PUnstructuredGridIDMapper anIDMapper =
- anInput->GetTimeStampOnMesh(theMeshName,
+ anInput->GetTimeStampOnMesh(GetCMeshName(),
aEntity,
theFieldName,
theTimeStampNumber);
ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkDataSet*>
(GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScalars, anOutput));
- myScalarMeshName = theMeshName;
myScalarEntity = theEntity;
myScalarFieldName = theFieldName;
myScalarTimeStampNumber = theTimeStampNumber;
}
-//---------------------------------------------------------------
-char*
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarCMeshName()
-{
- return CORBA::string_dup(myScalarMeshName.c_str());
-}
-
-
//---------------------------------------------------------------
VISU::Entity
VISU::ScalarMapOnDeformedShape_i
-::GetScalarEEntity()
+::GetScalarEntity()
{
return myScalarEntity;
}
//---------------------------------------------------------------
char*
VISU::ScalarMapOnDeformedShape_i
-::GetScalarCFieldName()
+::GetScalarFieldName()
{
return CORBA::string_dup(myScalarFieldName.c_str());
}
//---------------------------------------------------------------
CORBA::Long
VISU::ScalarMapOnDeformedShape_i
-::GetScalarLIteration()
+::GetScalarTimeStampNumber()
{
return myScalarTimeStampNumber;
}
{
return myScalarField;
}
-
-
-//---------------------------------------------------------------
-CORBA::Long
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarTimeStampNumber() const
-{
- return myScalarTimeStampNumber;
-}
-
-
-//---------------------------------------------------------------
virtual
void
- SetScalarField(const char* theMeshName,
+ SetScalarField(VISU::Entity theEntity,
const char* theFieldName,
- CORBA::Long theTimeStampNumber,
- VISU::Entity theEntity);
-
- virtual
- char*
- GetScalarCMeshName();
+ CORBA::Long theTimeStampNumber);
virtual
VISU::Entity
- GetScalarEEntity();
+ GetScalarEntity();
virtual
char*
- GetScalarCFieldName();
+ GetScalarFieldName();
virtual
CORBA::Long
- GetScalarLIteration();
+ GetScalarTimeStampNumber();
virtual
const VISU::PField&
GetScalarField() const;
- virtual
- CORBA::Long
- GetScalarTimeStampNumber() const;
-
private:
VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
PField myScalarField;
- std::string myScalarMeshName;
- std::string myScalarFieldName;
VISU::Entity myScalarEntity;
+ std::string myScalarFieldName;
CORBA::Long myScalarTimeStampNumber;
};
}
+++ /dev/null
-import os
-import time
-import VISU
-import SALOMEDS
-from batchmode_visu import *
-
-#---------------------------------------------------------------
-def GetPrsType2OldFactoryMethod(theVISUType):
- if theVISUType == VISU.TGAUSSPOINTS:
- return myVisu.GaussPointsOnField
- if theVISUType == VISU.TSCALARMAP:
- return myVisu.ScalarMapOnField
- if theVISUType == VISU.TISOSURFACES:
- return myVisu.IsoSurfacesOnField
- if theVISUType == VISU.TCUTPLANES:
- return myVisu.CutPlanesOnField
- if theVISUType == VISU.TCUTLINES:
- return myVisu.CutLinesOnField
- if theVISUType == VISU.TPLOT3D:
- return myVisu.Plot3DOnField
- if theVISUType == VISU.TDEFORMEDSHAPE:
- return myVisu.DeformedShapeOnField
- if theVISUType == VISU.TVECTORS:
- return myVisu.VectorsOnField
- if theVISUType == VISU.TSTREAMLINES:
- return myVisu.StreamLinesOnField
- if theVISUType == VISU.TSCALARMAPONDEFORMEDSHAPE:
- return myVisu.ScalarMapOnDeformedShapeOnField
- return None
-
-
-#---------------------------------------------------------------
-def WalkTroughTimeStamps(theVISUType,
- theResult, theMeshName,theEntity, theFieldName, theTimeStampNumber,
- theViewManager):
- anOldFactoryMethod = GetPrsType2OldFactoryMethod(theVISUType)
- aPrs3d = anOldFactoryMethod(theResult, theMeshName, theEntity, theFieldName, theTimeStampNumber)
-
- aPrs3d = myVisu.CreatePrs3d(theVISUType, myVisu.GetCurrentStudy())
- aPrs3d.SetResultObject(theResult)
- aPrs3d.SetMeshName(theMeshName)
- aPrs3d.SetEntity(theEntity)
- aPrs3d.SetFieldName(theFieldName)
- aPrs3d.SetTimeStampNumber(theTimeStampNumber)
- if not aPrs3d.Apply(0):
- print "It is impossible to create such kind of presentation (%s) with the given parameters" % theVISUType
- print "\ttheMeshName = '%s'" % theMeshName
- print "\ttheEntity = %s" % theEntity
- print "\ttheFieldName = '%s'" % theFieldName
- print "\ttheTimeStampNumber = %s" % theTimeStampNumber
- return
-
- aView = theViewManager.Create3DView();
- aView.SetTitle("To test presentation of %s type" % theVISUType)
- aView.Display(aPrs3d);
- aView.FitAll()
-
- aDelay = 0.0
- aRange = aPrs3d.GetTimeStampsRange()
- for anInfo in aRange:
- print "%d (%s); " % (anInfo.myNumber, anInfo.myTime)
- aPrs3d.SetTimeStampNumber(anInfo.myNumber)
- aPrs3d.Apply(0)
- aView.Update();
- time.sleep(aDelay)
- pass
- pass
-
-
-#---------------------------------------------------------------
-PRS3D_TYPE_LIST = []
-PRS3D_TYPE_LIST.append(VISU.TGAUSSPOINTS)
-PRS3D_TYPE_LIST.append(VISU.TSCALARMAP)
-PRS3D_TYPE_LIST.append(VISU.TISOSURFACES)
-PRS3D_TYPE_LIST.append(VISU.TCUTPLANES)
-PRS3D_TYPE_LIST.append(VISU.TCUTLINES)
-PRS3D_TYPE_LIST.append(VISU.TPLOT3D)
-PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPE)
-PRS3D_TYPE_LIST.append(VISU.TVECTORS)
-PRS3D_TYPE_LIST.append(VISU.TSTREAMLINES)
-PRS3D_TYPE_LIST.append(VISU.TSCALARMAPONDEFORMEDSHAPE)
-
-
-#---------------------------------------------------------------
-aMedFile = "TimeStamps.med"
-aMedFile = "ResOK_0000.med"
-aMedFile = os.getenv('DATA_DIR') + '/MedFiles/' + aMedFile
-aResult = myVisu.ImportFile(aMedFile)
-
-aMeshName ="dom"
-anEntity = VISU.NODE
-aFieldName = "vitesse";
-aTimeStampNumber = 1
-
-aViewManager = myVisu.GetViewManager();
-
-WalkTroughTimeStamps(VISU.TSCALARMAPONDEFORMEDSHAPE, aResult, aMeshName, anEntity, aFieldName, aTimeStampNumber, aViewManager)
-
-for aVISUType in PRS3D_TYPE_LIST:
- WalkTroughTimeStamps(aVISUType, aResult, aMeshName, anEntity, aFieldName, aTimeStampNumber, aViewManager)
- pass
-
-anEntity = VISU.CELL
-aFieldName = "pression";
-
-WalkTroughTimeStamps(VISU.TGAUSSPOINTS, aResult, aMeshName, anEntity, aFieldName, aTimeStampNumber, aViewManager)