}
- //===========================================================================
+ //---------------------------------------------------------------------------
typedef void (*TDumpToPython)(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
CORBA::Boolean& theIsValidScript,
std::string thePrefix);
- //===========================================================================
+ //---------------------------------------------------------------------------
void
Prs3dToPython(VISU::Prs3d_i* theServant,
std::ostream& theStr,
- std::string& theName,
+ const std::string& theName,
std::string thePrefix)
{
float x, y, z;
theServant->GetOffset(x,y,z);
- theStr<<thePrefix<<theName<<".SetOffset("<<x<<","<<y<<","<<z<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetOffset("<<x<<", "<<y<<", "<<z<<")"<<endl;
}
- //===========================================================================
- std::string
- ColoredPrs3dToPython(SALOMEDS::SObject_ptr theSObject,
- VISU::ColoredPrs3d_i* theServant,
- std::ostream& theStr,
- std::string& theName,
- const std::string& theConstructorName,
- const std::string& theArgumentName,
- std::string thePrefix)
+ //---------------------------------------------------------------------------
+ struct TColoredPrs3dFactory
{
- std::string aParam;
- switch(theServant->GetEntity()){
- case NODE:
- aParam = "VISU.NODE";
- break;
- case EDGE:
- aParam = "VISU.EDGE";
- break;
- case FACE:
- aParam = "VISU.FACE";
- break;
- case CELL:
- aParam = "VISU.CELL";
- break;
+ virtual
+ std::string
+ operator()(std::ostream& theStr,
+ std::string thePrefix)
+ {
+
+ return thePrefix;
}
+ };
- theStr<<thePrefix<<theName<<" = aVisu."<<theConstructorName<<"("<<theArgumentName<<
- ",'"<<theServant->GetCMeshName()<<"'"<<
- ","<<aParam<<
- ",'"<<theServant->GetCFieldName()<<"'"<<
- ","<<theServant->GetTimeStampNumber()<<
- ")"<<endl;
- theStr<<thePrefix<<"if "<<theName<<":"<<endl;
- thePrefix += PREFIX;
+ struct TCreateFromResult: TColoredPrs3dFactory
+ {
+ VISU::ColoredPrs3d_i* myServant;
+ std::string myConstructorName;
+ std::string myArgumentName;
+
+ SALOMEDS::SObject_var mySObject;
+ std::string myName;
+
+ TCreateFromResult(const SALOMEDS::SObject_var& theSObject,
+ VISU::ColoredPrs3d_i* theServant,
+ const std::string& theName,
+ const std::string& theConstructorName,
+ const std::string& theArgumentName):
+ myServant(theServant),
+ myConstructorName(theConstructorName),
+ myArgumentName(theArgumentName),
+ mySObject(theSObject),
+ myName(theName)
+ {}
+
+ virtual
+ std::string
+ operator()(std::ostream& theStr,
+ std::string thePrefix)
+ {
+ std::string aParam;
+ switch(myServant->GetEntity()){
+ case NODE:
+ aParam = "VISU.NODE";
+ break;
+ case EDGE:
+ aParam = "VISU.EDGE";
+ break;
+ case FACE:
+ aParam = "VISU.FACE";
+ break;
+ case CELL:
+ aParam = "VISU.CELL";
+ break;
+ }
- // Add to Name->Object map
- theStr<<thePrefix<<"aName2ObjectMap['"<<theName<<"'] = "<<theName<<endl;
+ theStr<<thePrefix<<myName<<" = aVisu."<<myConstructorName<<"("<<myArgumentName<<
+ ", '"<<myServant->GetCMeshName()<<"'"<<
+ ", "<<aParam<<
+ ", '"<<myServant->GetCFieldName()<<"'"<<
+ ", "<<myServant->GetTimeStampNumber()<<
+ ")"<<endl;
+
+ theStr<<thePrefix<<"if "<<myName<<" != None:"<<endl;
+ thePrefix += PREFIX;
+
+ // Add to Name->Object map
+ theStr<<thePrefix<<"aName2ObjectMap['"<<myName<<"'] = "<<myName<<endl;
- // Set name (as this object could be renamed by user)
- CORBA::String_var aNameInStudy = theSObject->GetName();
- theStr<<thePrefix<<"visu.SetName("<<theName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+ // Set name (as this object could be renamed by user)
+ CORBA::String_var aNameInStudy = mySObject->GetName();
+ theStr<<thePrefix<<"visu.SetName("<<myName<<", '"<<aNameInStudy.in()<<"')"<<endl;
- // Set parameters common for all Prs3d objects (offset values)
- Prs3dToPython(theServant,theStr,theName,thePrefix);
+ return thePrefix;
+ }
+ };
- // Set parameters
- theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
- theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<","<<theServant->GetPosY()<<")"<<endl;
- theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<","<<theServant->GetHeight()<<")"<<endl;
+ //---------------------------------------------------------------------------
+ std::string
+ ColoredPrs3dToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::ColoredPrs3d_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = thePrsFactory(theStr, thePrefix);
+
+ // Set parameters common for all Prs3d objects (offset values)
+ Prs3dToPython(theServant, theStr, theName, thePrefix);
+
+ theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<", "<<theServant->GetPosY()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<", "<<theServant->GetHeight()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetNbColors("<<theServant->GetNbColors()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetLabels("<<theServant->GetLabels()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetTitle('"<<theServant->GetTitle()<<"')"<<endl;
+ std::string aParam;
+ switch(theServant->GetBarOrientation()){
+ case ColoredPrs3d::HORIZONTAL:
+ aParam = "VISU.ColoredPrs3d.HORIZONTAL";
+ break;
+ case ColoredPrs3d::VERTICAL:
+ aParam = "VISU.ColoredPrs3d.VERTICAL";
+ break;
+ }
+ theStr<<thePrefix<<theName<<".SetBarOrientation("<<aParam<<")"<<endl;
+
+ theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
+
return thePrefix;
}
- //===========================================================================
+ //---------------------------------------------------------------------------
std::string
ScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
VISU::ScalarMap_i* theServant,
std::ostream& theStr,
- std::string& theName,
- const std::string& theConstructorName,
- const std::string& theArgumentName,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
std::string thePrefix)
{
- thePrefix = ColoredPrs3dToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+ thePrefix = ColoredPrs3dToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
std::string aParam;
switch(theServant->GetScaling()){
break;
}
theStr<<thePrefix<<theName<<".SetScaling("<<aParam<<")"<<endl;
- theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<","<<theServant->GetMax()<<")"<<endl;
-
- switch(theServant->GetBarOrientation()){
- case ScalarMap::HORIZONTAL:
- aParam = "VISU.ScalarMap.HORIZONTAL";
- break;
- case ScalarMap::VERTICAL:
- aParam = "VISU.ScalarMap.VERTICAL";
- break;
- }
- theStr<<thePrefix<<theName<<".SetBarOrientation("<<aParam<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
const VISU::ScalarMap_i::TGroupNames aGroupNames = theServant->GetGroupNames();
VISU::ScalarMap_i::TGroupNames::const_iterator anIter = aGroupNames.begin();
return thePrefix;
}
- //===========================================================================
+
+ //---------------------------------------------------------------------------
std::string
DeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
VISU::DeformedShape_i* theServant,
std::ostream& theStr,
- std::string& theName,
- const std::string& theConstructorName,
- const std::string& theArgumentName,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
std::string thePrefix)
{
- thePrefix = ScalarMapToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+ thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
theStr<<thePrefix<<theName<<".ShowColored("<<theServant->IsColored()<<")"<<endl;
SALOMEDS::Color aColor = theServant->GetColor();
theStr<<thePrefix<<theName<<".SetColor(SALOMEDS.Color("<<
- aColor.R<<","<<aColor.G<<","<<aColor.B<<"))"<<endl;
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+ return thePrefix;
+ }
+
+
+ //---------------------------------------------------------------------------
+ std::string
+ StreamLinesToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::StreamLines_i* theServant,
+ std::ostream& theStr,
+ TEntry2NameMap& theEntry2NameMap,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+ std::string aParam;
+ switch(theServant->GetDirection()){
+ case StreamLines::FORWARD:
+ aParam = "VISU.StreamLines.FORWARD";
+ break;
+ case StreamLines::BACKWARD:
+ aParam = "VISU.StreamLines.BACKWARD";
+ break;
+ case StreamLines::BOTH:
+ aParam = "VISU.StreamLines.BOTH";
+ break;
+ }
+
+ theStr<<thePrefix<<"aPrs3d = None"<<endl;
+ VISU::Prs3d_var aPrs3d = theServant->GetSource();
+ if(!CORBA::is_nil(aPrs3d)){
+ if(Prs3d_i* aServant3d = dynamic_cast<Prs3d_i*>(GetServant(aPrs3d).in())){
+ SALOMEDS::SObject_var aSObject = aServant3d->GetSObject();
+ CORBA::String_var anID = aSObject->GetID();
+ std::string anArg = theEntry2NameMap[anID.in()];
+ theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<anArg<<"'):"<<endl;
+ thePrefix += PREFIX;
+ theStr<<thePrefix<<"aPrs3d = aName2ObjectMap['"<<anArg<<"']"<<endl;
+ }
+ }
+
+ theStr<<thePrefix<<theName<<".SetParams("<<
+ theServant->GetIntegrationStep()<<", "<<
+ theServant->GetPropagationTime()<<", "<<
+ theServant->GetStepLength()<<", "<<
+ "aPrs3d"<<", "<<
+ theServant->GetUsedPoints()<<", "<<
+ aParam<<
+ ")"<<endl;
+
+ return thePrefix;
+ }
+
+
+ //---------------------------------------------------------------------------
+ std::string
+ ScalarMapOnDeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::ScalarMapOnDeformedShape_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+ theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
+
+ std::string aParam;
+ VISU::Entity anEntity = theServant->GetScalarEntity();
+ switch(anEntity){
+ case NODE:
+ aParam = "VISU.NODE";
+ break;
+ case EDGE:
+ aParam = "VISU.EDGE";
+ break;
+ case FACE:
+ aParam = "VISU.FACE";
+ break;
+ case CELL:
+ aParam = "VISU.CELL";
+ break;
+ }
+
+ CORBA::String_var aFieldName = theServant->GetScalarFieldName();
+ CORBA::Long aTimeStampNumber = theServant->GetScalarTimeStampNumber();
+
+ theStr<<thePrefix<<theName<<".SetScalarField("<<
+ aParam<<", "<<
+ "'"<<aFieldName<<"', "<<
+ aTimeStampNumber<<
+ ")"<<endl;
return thePrefix;
}
- //===========================================================================
+
+ //---------------------------------------------------------------------------
+ std::string
+ VectorsToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::Vectors_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+ theStr<<thePrefix<<theName<<".SetLineWidth("<<theServant->GetLineWidth()<<")"<<endl;
+
+ std::string aParam;
+ switch(theServant->GetGlyphType()){
+ case Vectors::ARROW:
+ aParam = "VISU.Vectors.ARROW";
+ break;
+ case Vectors::CONE2:
+ aParam = "VISU.Vectors.CONE2";
+ break;
+ case Vectors::CONE6:
+ aParam = "VISU.Vectors.CONE6";
+ break;
+ case Vectors::NONE:
+ aParam = "VISU.Vectors.NONE";
+ break;
+ }
+ theStr<<thePrefix<<theName<<".SetGlyphType("<<aParam<<")"<<endl;
+
+ switch(theServant->GetGlyphPos()){
+ case Vectors::CENTER:
+ aParam = "VISU.Vectors.CENTER";
+ break;
+ case Vectors::TAIL:
+ aParam = "VISU.Vectors.TAIL";
+ break;
+ case Vectors::HEAD:
+ aParam = "VISU.Vectors.HEAD";
+ break;
+ }
+ theStr<<thePrefix<<theName<<".SetGlyphPos("<<aParam<<")"<<endl;
+
+ return thePrefix;
+ }
+
+
+ //---------------------------------------------------------------------------
+ std::string
+ IsoSurfacesToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::IsoSurfaces_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+ theStr<<thePrefix<<theName<<".SetNbSurfaces("<<theServant->GetNbSurfaces()<<")"<<endl;
+
+ return thePrefix;
+ }
+
+
+ //---------------------------------------------------------------------------
+ std::string
+ CutPlanesToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::CutPlanes_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+ std::string aParam;
+ switch(theServant->GetOrientationType()){
+ case CutPlanes::XY:
+ aParam = "VISU.CutPlanes.XY";
+ break;
+ case CutPlanes::YZ:
+ aParam = "VISU.CutPlanes.YZ";
+ break;
+ case CutPlanes::ZX:
+ aParam = "VISU.CutPlanes.ZX";
+ break;
+ }
+ theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
+
+ theStr<<thePrefix<<theName<<".SetDisplacement("<<theServant->GetDisplacement()<<")"<<endl;
+ CORBA::Long aNbPlanes = theServant->GetNbPlanes();
+ theStr<<thePrefix<<theName<<".SetNbPlanes("<<aNbPlanes<<")"<<endl;
+
+ for(CORBA::Long anId = 0; anId < aNbPlanes; anId++){
+ if(!theServant->IsDefault(anId))
+ theStr<<thePrefix<<theName<<".SetPlanePosition("<<anId<<", "<<theServant->GetPlanePosition(anId)<<")"<<endl;
+ }
+
+ return thePrefix;
+ }
+
+
+ //---------------------------------------------------------------------------
+ std::string
+ CutLinesToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::CutLines_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+ std::string aParam;
+ switch(theServant->GetOrientationType()){
+ case CutPlanes::XY:
+ aParam = "VISU.CutPlanes.XY";
+ break;
+ case CutPlanes::YZ:
+ aParam = "VISU.CutPlanes.YZ";
+ break;
+ case CutPlanes::ZX:
+ aParam = "VISU.CutPlanes.ZX";
+ break;
+ }
+ theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
+
+ switch(theServant->GetOrientationType2()){
+ case CutPlanes::XY:
+ aParam = "VISU.CutPlanes.XY";
+ break;
+ case CutPlanes::YZ:
+ aParam = "VISU.CutPlanes.YZ";
+ break;
+ case CutPlanes::ZX:
+ aParam = "VISU.CutPlanes.ZX";
+ break;
+ }
+ theStr<<thePrefix<<theName<<".SetOrientation2("<<aParam<<", "<<theServant->GetRotateX2()<<", "<<theServant->GetRotateY2()<<")"<<endl;
+
+ theStr<<thePrefix<<theName<<".SetDisplacement("<<theServant->GetDisplacement()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetDisplacement2("<<theServant->GetDisplacement2()<<")"<<endl;
+
+ if(!theServant->IsDefault())
+ theStr<<thePrefix<<theName<<".SetBasePlanePosition("<<theServant->GetBasePlanePosition()<<")"<<endl;
+
+ CORBA::Boolean aUseAbsLength = theServant->IsUseAbsoluteLength();
+ theStr<<thePrefix<<theName<<".SetUseAbsoluteLength("<<aUseAbsLength<<")"<<endl;
+
+ CORBA::Long aNbLines = theServant->GetNbLines();
+ theStr<<thePrefix<<theName<<".SetNbLines("<<aNbLines<<")"<<endl;
+ for(CORBA::Long anId = 0; anId < aNbLines; anId++){
+ if(!theServant->IsDefaultPosition(anId))
+ theStr<<thePrefix<<theName<<".SetLinePosition("<<anId<<", "<<theServant->GetLinePosition(anId)<<")"<<endl;
+ }
+
+ return thePrefix;
+ }
+
+
+ //---------------------------------------------------------------------------
+ std::string
+ Plot3DToPython(SALOMEDS::SObject_ptr theSObject,
+ VISU::Plot3D_i* theServant,
+ std::ostream& theStr,
+ const std::string& theName,
+ TColoredPrs3dFactory& thePrsFactory,
+ std::string thePrefix)
+ {
+ thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+ std::string aParam;
+ switch(theServant->GetOrientationType()){
+ case CutPlanes::XY:
+ aParam = "VISU.Plot3D.XY";
+ break;
+ case CutPlanes::YZ:
+ aParam = "VISU.Plot3D.YZ";
+ break;
+ case CutPlanes::ZX:
+ aParam = "VISU.Plot3D.ZX";
+ break;
+ }
+ theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
+
+ theStr<<thePrefix<<theName<<".SetPlanePosition("<<theServant->GetPlanePosition()<<", "<<theServant->IsPositionRelative()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetScaleFactor("<<theServant->GetScaleFactor()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetContourPrs("<<theServant->GetIsContourPrs()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetNbOfContours("<<theServant->GetNbOfContours()<<")"<<endl;
+
+ return thePrefix;
+ }
+
+
+ //---------------------------------------------------------------------------
// declaration
void DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
std::string theArgumentName,
std::string thePrefix);
- //===========================================================================
+ //---------------------------------------------------------------------------
template<class TTableAttr>
void
TableAttrToPython(SALOMEDS::Study_ptr theStudy,
theStr<<thePrefix<<"aBuilder.SetName("<<aSObjectName<<", \""<<theSObject->GetName()<<"\")"<<endl; // Fix for IPAL13165
std::string aName = "aTableAttr";
theStr<<thePrefix<<aName<<" = aBuilder.FindOrCreateAttribute("<<
- aSObjectName<<",'"<<theAttrName<<"')"<<endl;
+ aSObjectName<<", '"<<theAttrName<<"')"<<endl;
theStr<<thePrefix<<"if "<<aName<<":"<<endl;
std::string aPrefix = thePrefix;
}
- //===========================================================================
+ //---------------------------------------------------------------------------
void
DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
}
- //===========================================================================
+ //---------------------------------------------------------------------------
void
DumpTableAttrToPython(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
}
- //===========================================================================
+ //---------------------------------------------------------------------------
void
DumpToPython(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
endl;
theStr<<thePrefix<<aName<<".SetBuildFields("<<
- aServant->IsFieldsDone()<<","<<
+ aServant->IsFieldsDone()<<", "<<
aServant->IsMinMaxDone()<<")"<<
endl;
if(aSubMeshName == "")
theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
- ",'"<<aServant->GetCMeshName()<<"'"<<
- ","<<aParam<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", "<<aParam<<
")"<<endl;
else
theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
- ",'"<<aServant->GetCMeshName()<<"'"<<
- ","<<aParam<<
- ",'"<<aSubMeshName<<"'"<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", "<<aParam<<
+ ", '"<<aSubMeshName<<"'"<<
")"<<endl;
}else
theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
- ",'"<<aServant->GetCMeshName()<<"'"<<
- ",'"<<aSubMeshName<<"'"<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", '"<<aSubMeshName<<"'"<<
")"<<endl;
theStr<<thePrefix<<"if "<<aName<<":"<<endl;
theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
// Set name (as this object could be renamed by user)
- theStr<<thePrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+ theStr<<thePrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
// Set parameters common for all Prs3d objects (offset values)
Prs3dToPython(aServant,theStr,aName,thePrefix);
SALOMEDS::Color aColor;
aColor = aServant->GetCellColor();
theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
- aColor.R<<","<<aColor.G<<","<<aColor.B<<"))"<<endl;
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
aColor = aServant->GetNodeColor();
theStr<<thePrefix<<aName<<".SetNodeColor(SALOMEDS.Color("<<
- aColor.R<<","<<aColor.G<<","<<aColor.B<<"))"<<endl;
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
aColor = aServant->GetLinkColor();
theStr<<thePrefix<<aName<<".SetLinkColor(SALOMEDS.Color("<<
- aColor.R<<","<<aColor.G<<","<<aColor.B<<"))"<<endl;
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
std::string aParam;
switch(aServant->GetPresentationType()){
break;
case VISU::TSCALARMAP:
if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(GetServant(anObj).in())){
- thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnField",theArgumentName,thePrefix);
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "ScalarMapOnField", theArgumentName);
+ thePrefix = ScalarMapToPython(theSObject, aServant, theStr,aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
case VISU::TDEFORMEDSHAPE:
if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(GetServant(anObj).in())){
- thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"DeformedShapeOnField",theArgumentName,thePrefix);
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeOnField", theArgumentName);
+ thePrefix = DeformedShapeToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
case VISU::TSTREAMLINES:
if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(GetServant(anObj).in())){
- thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"StreamLinesOnField",theArgumentName,thePrefix);
-
- std::string aParam;
- switch(aServant->GetDirection()){
- case StreamLines::FORWARD:
- aParam = "VISU.StreamLines.FORWARD";
- break;
- case StreamLines::BACKWARD:
- aParam = "VISU.StreamLines.BACKWARD";
- break;
- case StreamLines::BOTH:
- aParam = "VISU.StreamLines.BOTH";
- break;
- }
-
- theStr<<thePrefix<<"aPrs3d = None"<<endl;
- VISU::Prs3d_var aPrs3d = aServant->GetSource();
- if(!CORBA::is_nil(aPrs3d)){
- if(Prs3d_i* aServant3d = dynamic_cast<Prs3d_i*>(GetServant(aPrs3d).in())){
- SALOMEDS::SObject_var aSObject = aServant3d->GetSObject();
- CORBA::String_var anID = aSObject->GetID();
- std::string anArg = theEntry2NameMap[anID.in()];
- theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<anArg<<"'):"<<endl;
- thePrefix += PREFIX;
- theStr<<thePrefix<<"aPrs3d = aName2ObjectMap['"<<anArg<<"']"<<endl;
- }
- }
-
- theStr<<thePrefix<<aName<<".SetParams("<<
- aServant->GetIntegrationStep()<<","<<
- aServant->GetPropagationTime()<<","<<
- aServant->GetStepLength()<<","<<
- "aPrs3d"<<","<<
- aServant->GetUsedPoints()<<","<<
- aParam<<
- ")"<<endl;
-
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "StreamLinesOnField", theArgumentName);
+ thePrefix = StreamLinesToPython(theSObject, aServant, theStr, theEntry2NameMap, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
case VISU::TSCALARMAPONDEFORMEDSHAPE:
if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(GetServant(anObj).in())){
- thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnDeformedShapeOnField",theArgumentName,thePrefix);
-
- theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<","<<aServant->GetMax()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetScale("<<aServant->GetScale()<<")"<<endl;
-
- std::string aParam;
- VISU::Entity anEntity = aServant->GetScalarEntity();
- switch(anEntity){
- case NODE:
- aParam = "VISU.NODE";
- break;
- case EDGE:
- aParam = "VISU.EDGE";
- break;
- case FACE:
- aParam = "VISU.FACE";
- break;
- case CELL:
- aParam = "VISU.CELL";
- break;
- }
-
- CORBA::String_var aFieldName = aServant->GetScalarFieldName();
- CORBA::Long aTimeStampNumber = aServant->GetScalarTimeStampNumber();
-
- theStr<<thePrefix<<aName<<".SetScalarField("<<
- aParam<<","<<
- "'"<<aFieldName<<"',"<<
- aTimeStampNumber<<
- ")"<<endl;
-
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "ScalarMapOnDeformedShapeOnField", theArgumentName);
+ thePrefix = ScalarMapOnDeformedShapeToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
case VISU::TVECTORS:
if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(GetServant(anObj).in())){
- thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"VectorsOnField",theArgumentName,thePrefix);
-
- theStr<<thePrefix<<aName<<".SetLineWidth("<<aServant->GetLineWidth()<<")"<<endl;
-
- std::string aParam;
- switch(aServant->GetGlyphType()){
- case Vectors::ARROW:
- aParam = "VISU.Vectors.ARROW";
- break;
- case Vectors::CONE2:
- aParam = "VISU.Vectors.CONE2";
- break;
- case Vectors::CONE6:
- aParam = "VISU.Vectors.CONE6";
- break;
- case Vectors::NONE:
- aParam = "VISU.Vectors.NONE";
- break;
- }
- theStr<<thePrefix<<aName<<".SetGlyphType("<<aParam<<")"<<endl;
-
- switch(aServant->GetGlyphPos()){
- case Vectors::CENTER:
- aParam = "VISU.Vectors.CENTER";
- break;
- case Vectors::TAIL:
- aParam = "VISU.Vectors.TAIL";
- break;
- case Vectors::HEAD:
- aParam = "VISU.Vectors.HEAD";
- break;
- }
- theStr<<thePrefix<<aName<<".SetGlyphPos("<<aParam<<")"<<endl;
-
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "VectorsOnField", theArgumentName);
+ thePrefix = VectorsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
case VISU::TISOSURFACES:
if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(GetServant(anObj).in())){
- thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"IsoSurfacesOnField",theArgumentName,thePrefix);
- theStr<<thePrefix<<aName<<".SetNbSurfaces("<<aServant->GetNbSurfaces()<<")"<<endl;
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "IsoSurfacesOnField", theArgumentName);
+ thePrefix = IsoSurfacesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
case VISU::TCUTPLANES:
if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(GetServant(anObj).in())){
- thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"CutPlanesOnField",theArgumentName,thePrefix);
-
- std::string aParam;
- switch(aServant->GetOrientationType()){
- case CutPlanes::XY:
- aParam = "VISU.CutPlanes.XY";
- break;
- case CutPlanes::YZ:
- aParam = "VISU.CutPlanes.YZ";
- break;
- case CutPlanes::ZX:
- aParam = "VISU.CutPlanes.ZX";
- break;
- }
- theStr<<thePrefix<<aName<<".SetOrientation("<<aParam<<","<<aServant->GetRotateX()<<","<<aServant->GetRotateY()<<")"<<endl;
-
- theStr<<thePrefix<<aName<<".SetDisplacement("<<aServant->GetDisplacement()<<")"<<endl;
- CORBA::Long aNbPlanes = aServant->GetNbPlanes();
- theStr<<thePrefix<<aName<<".SetNbPlanes("<<aNbPlanes<<")"<<endl;
-
- for(CORBA::Long anId = 0; anId < aNbPlanes; anId++){
- if(!aServant->IsDefault(anId))
- theStr<<thePrefix<<aName<<".SetPlanePosition("<<anId<<","<<aServant->GetPlanePosition(anId)<<")"<<endl;
- }
-
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutPlanesOnField", theArgumentName);
+ thePrefix = CutPlanesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
case VISU::TCUTLINES:
if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(GetServant(anObj).in())){
- thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"CutLinesOnField",theArgumentName,thePrefix);
-
- std::string aParam;
- switch(aServant->GetOrientationType()){
- case CutPlanes::XY:
- aParam = "VISU.CutPlanes.XY";
- break;
- case CutPlanes::YZ:
- aParam = "VISU.CutPlanes.YZ";
- break;
- case CutPlanes::ZX:
- aParam = "VISU.CutPlanes.ZX";
- break;
- }
- theStr<<thePrefix<<aName<<".SetOrientation("<<aParam<<","<<aServant->GetRotateX()<<","<<aServant->GetRotateY()<<")"<<endl;
-
- switch(aServant->GetOrientationType2()){
- case CutPlanes::XY:
- aParam = "VISU.CutPlanes.XY";
- break;
- case CutPlanes::YZ:
- aParam = "VISU.CutPlanes.YZ";
- break;
- case CutPlanes::ZX:
- aParam = "VISU.CutPlanes.ZX";
- break;
- }
- theStr<<thePrefix<<aName<<".SetOrientation2("<<aParam<<","<<aServant->GetRotateX2()<<","<<aServant->GetRotateY2()<<")"<<endl;
-
- theStr<<thePrefix<<aName<<".SetDisplacement("<<aServant->GetDisplacement()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetDisplacement2("<<aServant->GetDisplacement2()<<")"<<endl;
-
- if(!aServant->IsDefault())
- theStr<<thePrefix<<aName<<".SetBasePlanePosition("<<aServant->GetBasePlanePosition()<<")"<<endl;
-
- CORBA::Boolean aUseAbsLength = aServant->IsUseAbsoluteLength();
- theStr<<thePrefix<<aName<<".SetUseAbsoluteLength("<<aUseAbsLength<<")"<<endl;
-
- CORBA::Long aNbLines = aServant->GetNbLines();
- theStr<<thePrefix<<aName<<".SetNbLines("<<aNbLines<<")"<<endl;
- for(CORBA::Long anId = 0; anId < aNbLines; anId++){
- if(!aServant->IsDefaultPosition(anId))
- theStr<<thePrefix<<aName<<".SetLinePosition("<<anId<<","<<aServant->GetLinePosition(anId)<<")"<<endl;
- }
-
- theStr<<endl;
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutLinesOnField", theArgumentName);
+ thePrefix = CutLinesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theArgumentName = aName;
DumpChildrenToPython(theStudy,
return;
case VISU::TPLOT3D:
if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(GetServant(anObj).in())) {
- thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName,"Plot3DOnField", theArgumentName, thePrefix);
-
- std::string aParam;
- switch(aServant->GetOrientationType()){
- case CutPlanes::XY: aParam = "VISU.Plot3D.XY"; break;
- case CutPlanes::YZ: aParam = "VISU.Plot3D.YZ"; break;
- case CutPlanes::ZX: aParam = "VISU.Plot3D.ZX"; break;
- }
- theStr<<thePrefix<<aName<<".SetOrientation("<<aParam<<","<<aServant->GetRotateX()<<","<<aServant->GetRotateY()<<")"<<endl;
-
- theStr<<thePrefix<<aName<<".SetPlanePosition("<<aServant->GetPlanePosition()<<","<<aServant->IsPositionRelative()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetScaleFactor("<<aServant->GetScaleFactor()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetContourPrs("<<aServant->GetIsContourPrs()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetNbOfContours("<<aServant->GetNbOfContours()<<")"<<endl;
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "Plot3DOnField", theArgumentName);
+ thePrefix = Plot3DToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
case VISU::TGAUSSPOINTS:
if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
- thePrefix = ColoredPrs3dToPython(theSObject,aServant,theStr,aName,"GaussPointsOnField",theArgumentName,thePrefix);
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
+ thePrefix = ColoredPrs3dToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
theStr << "WithZ";
theStr << "(" <<
theArgumentName<< // table
- ","<<aServant->GetHRow()<< // H row
- ","<<aServant->GetVRow(); // V row
+ ", "<<aServant->GetHRow()<< // H row
+ ", "<<aServant->GetVRow(); // V row
if( withZ )
- theStr << "," << aServant->GetZRow(); // Z row
+ theStr << ", " << aServant->GetZRow(); // Z row
- theStr << ",'"<<aServant->GetTitle()<<"'"; // title
+ theStr << ", '"<<aServant->GetTitle()<<"'"; // title
SALOMEDS::Color aColor = aServant->GetColor();
theStr << ",SALOMEDS.Color("<<
- aColor.R<<","<<aColor.G<<","<<aColor.B<<")"; // color
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<")"; // color
std::string aParam;
switch(aServant->GetMarker()){
case Curve::CROSS: aParam = "VISU.Curve.CROSS"; break;
case Curve::XCROSS: aParam = "VISU.Curve.XCROSS"; break;
}
- theStr<<","<<aParam; // marker
+ theStr<<", "<<aParam; // marker
switch(aServant->GetLine()){
case Curve::VOIDLINE: aParam = "VISU.Curve.VOIDLINE"; break;
case Curve::DASHDOTLINE: aParam = "VISU.Curve.DASHDOTLINE"; break;
case Curve::DASHDOTDOTLINE: aParam = "VISU.Curve.DASHDOTDOTLINE"; break;
}
- theStr<<","<<aParam<<","<<aServant->GetLineWidth()<<")"<<endl; // line type,width
+ theStr<<", "<<aParam<<", "<<aServant->GetLineWidth()<<")"<<endl; // line type,width
}
return;
case VISU::TTABLE:
}
return;
case VISU::TCOLOREDPRS3DCACHE:
- if(ColoredPrs3dCache_i* aServant = dynamic_cast<ColoredPrs3dCache_i*>(GetServant(anObj).in())){
- theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl<<endl;
- TColoredPrs3dHolderMap aHolderMap = aServant->GetHolderMap();
- TColoredPrs3dHolderMap::const_iterator aHolderIter = aHolderMap.begin();
- TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = aHolderMap.end();
- for(; aHolderIter != aHolderIterEnd; aHolderIter++){
- const TLastVisitedPrsList& aPrsList = aHolderIter->second;
- if(TPrs3dPtr aPrs3d = aPrsList.front())
- {
- ColoredPrs3dHolder::BasicInput_var anInput = aPrs3d->GetBasicInput();
-
- std::string anEntity;
- switch(anInput->myEntity){
- case VISU::NODE : anEntity = "VISU.NODE"; break;
- case VISU::EDGE : anEntity = "VISU.EDGE"; break;
- case VISU::FACE : anEntity = "VISU.FACE"; break;
- case VISU::CELL : anEntity = "VISU.CELL"; break;
+ theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl<<endl;
+ SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(theSObject);
+ for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
+ SALOMEDS::SObject_var aSObject = aChildItet->Value();
+ CORBA::Object_var anObject = SObjectToObject(aSObject);
+ if (CORBA::is_nil(anObject))
+ continue;
+ if(ColoredPrs3dHolder_i* aServant = dynamic_cast<ColoredPrs3dHolder_i*>(GetServant(anObject).in())){
+ ColoredPrs3dHolder::BasicInput_var anInput = aServant->GetBasicInput();
+ std::string anEntity;
+ switch(anInput->myEntity){
+ case VISU::NODE : anEntity = "VISU.NODE"; break;
+ case VISU::EDGE : anEntity = "VISU.EDGE"; break;
+ case VISU::FACE : anEntity = "VISU.FACE"; break;
+ case VISU::CELL : anEntity = "VISU.CELL"; break;
+ }
+
+ ColoredPrs3d_var aDevice = aServant->GetDevice();
+ theStr<<thePrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<
+ aResultName<<", '"<<
+ anInput->myMeshName<<"', "<<
+ anEntity<<", '"<<
+ anInput->myFieldName<<"', "<<
+ anInput->myTimeStampNumber<<")"<<
+ endl;
+
+ if(Prs3d_i* aPrs3d = dynamic_cast<Prs3d_i*>(GetServant(aDevice).in())){
+ std::string aComment = aPrs3d->GetComment();
+ theStr<<thePrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aComment<<", anInput)"<<endl;
+ theStr<<thePrefix<<"if aHolder != None:"<<endl;
+ {
+ std::string aPrefix = thePrefix + PREFIX;
+ CORBA::String_var aNameInStudy = aSObject->GetName();
+ theStr<<aPrefix<<"visu.SetName(aHolder, '"<<aNameInStudy.in()<<"')"<<endl;
+ theStr<<aPrefix<<"aDevice = aHolder.GetDevice()"<<endl;
+ TColoredPrs3dFactory aPrsFactory;
+ switch(aPrs3d->GetType()){
+ case VISU::TSCALARMAP:
+ if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(aPrs3d)){
+ aPrefix = ScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TDEFORMEDSHAPE:
+ if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(aPrs3d)){
+ aPrefix = DeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TSTREAMLINES:
+ if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(aPrs3d)){
+ aPrefix = StreamLinesToPython(aSObject, aServant, theStr, theEntry2NameMap, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TSCALARMAPONDEFORMEDSHAPE:
+ if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(aPrs3d)){
+ aPrefix = ScalarMapOnDeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TVECTORS:
+ if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(aPrs3d)){
+ aPrefix = VectorsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TISOSURFACES:
+ if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(aPrs3d)){
+ aPrefix = IsoSurfacesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TCUTPLANES:
+ if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(aPrs3d)){
+ aPrefix = CutPlanesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TCUTLINES:
+ if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(aPrs3d)){
+ aPrefix = CutLinesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TPLOT3D:
+ if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(aPrs3d)) {
+ aPrefix = Plot3DToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ case VISU::TGAUSSPOINTS:
+ if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(aPrs3d)){
+ aPrefix = ColoredPrs3dToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+ break;
+ }
+ }
+ theStr<<aPrefix<<"pass"<<endl<<endl;
}
-
- theStr<<thePrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<aResultName<<",'"<<
- anInput->myMeshName<<"',"<<anEntity<<",'"<<
- anInput->myFieldName<<"',"<<anInput->myTimeStampNumber<<")"<<endl;
-
- std::string aType = aPrs3d->GetComment();
- theStr<<thePrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aType<<",anInput)"<<endl<<endl;
}
}
}
}
if (aTypeName == "ENTITY" ) {
- theStr<<thePrefix<<"aVisu.RenameEntityInStudy("<<theArgumentName<<",'"<<aMeshName
- <<"',"<<anEntityType<<",'"<<aNameInStudy.in()<<"')"<<endl;
+ theStr<<thePrefix<<"aVisu.RenameEntityInStudy("<<theArgumentName<<", '"<<aMeshName
+ <<"', "<<anEntityType<<", '"<<aNameInStudy.in()<<"')"<<endl;
}
else if (aTypeName == "FAMILY") {
if (aSubMeshName != aNameInStudy.in()) {
- theStr<<thePrefix<<"aVisu.RenameFamilyInStudy("<<theArgumentName<<",'"<<aMeshName
- <<"',"<<anEntityType<<",'"<<aSubMeshName<<"','"<<aNameInStudy.in()<<"')"<<endl;
+ theStr<<thePrefix<<"aVisu.RenameFamilyInStudy("<<theArgumentName<<", '"<<aMeshName
+ <<"', "<<anEntityType<<", '"<<aSubMeshName<<"', '"<<aNameInStudy.in()<<"')"<<endl;
}
}
else { // "GROUP"
if (aSubMeshName != aNameInStudy.in()) {
- theStr<<thePrefix<<"aVisu.RenameGroupInStudy("<<theArgumentName<<",'"<<aMeshName
- <<"','"<<aSubMeshName<<"','"<<aNameInStudy.in()<<"')"<<endl;
+ theStr<<thePrefix<<"aVisu.RenameGroupInStudy("<<theArgumentName<<", '"<<aMeshName
+ <<"', '"<<aSubMeshName<<"', '"<<aNameInStudy.in()<<"')"<<endl;
}
}
}
}
- //===========================================================================
+ //---------------------------------------------------------------------------
void
DumpCurveToPython(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
}
- //===========================================================================
+ //---------------------------------------------------------------------------
void
DumpContainersToPython(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
// Set name (as this object could be renamed by user)
CORBA::String_var aNameInStudy = aSObject->GetName();
- theStr<<aPrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+ theStr<<aPrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
SALOMEDS::ChildIterator_var aCurveIter = theStudy->NewChildIterator(aSObject);
for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){
}
}
- //===========================================================================
+ //---------------------------------------------------------------------------
void
DumpAnimationsToPython(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
value = refObj->GetName();
QString path(theStudy->GetObjectPath(father));
//The following code requierd as a field name can contain '/' character
- theStr<<thePrefix<<"aBuilder.Addreference(fieldSO,getSObjectByFatherPathAndName(theStudy,'"<<path<<"','"<<value<<"'))"<<endl;
+ theStr<<thePrefix<<"aBuilder.Addreference(fieldSO,getSObjectByFatherPathAndName(theStudy, '"<<path<<"', '"<<value<<"'))"<<endl;
}
value = anObj->GetName();
if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(fieldSO, '"<<value<<"')"<< endl;
theStr<<endl;
}
- //===========================================================================
+ //---------------------------------------------------------------------------
Engines::TMPFile*
VISU_Gen_i::
DumpPython(CORBA::Object_ptr theStudy,