- case VISU::TRESULT:
- if(Result_i* aServant = dynamic_cast<Result_i*>(GetServant(anObj).in())){
- std::string aFileName = aServant->GetInitFileName();
- Result_i::ECreationId anId = aServant->GetCreationId();
- if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
- switch(anId){
- case Result_i::eImportFile:
- theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
-
- theStr<<thePrefix<<aName<<".SetBuildGroups("<<
- GetBoolean(aServant->IsGroupsDone())<<")"<<
- endl;
-
- theStr<<thePrefix<<aName<<".SetBuildFields("<<
- GetBoolean(aServant->IsFieldsDone())<<", "<<
- GetBoolean(aServant->IsMinMaxDone())<<")"<<
- endl;
-
- theStr<<thePrefix<<aName<<".Build(False, True)"<<endl;
-
- theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
- break;
- case Result_i::eCopyAndImportFile:
- theStr<<thePrefix<<aName<<" = aVisu.CopyAndImportFile('"<<aFileName<<"')"<<endl;
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- break;
- }
-
- thePrefix += PREFIX;
- {
- VISU::Result::EntityNames_var aMeshNames = aServant->GetMeshNames();
- if (aMeshNames->length() > 0) {
- for(size_t aMeshId = 0; aMeshId < aMeshNames->length(); aMeshId++){
- CORBA::String_var aMeshName = aMeshNames[aMeshId];
- VISU::Result::EntityNames_var aParts = aServant->GetPartNames(aMeshName);
- if (aParts->length() > 0) {
- for(size_t aPartId = 0; aPartId < aParts->length(); aPartId++){
- CORBA::String_var aPart = aParts[aPartId];
- VISU::Result::Resolution aResolution = aServant->GetResolution(aMeshName, aPart);
- std::string aParam;
- switch(aResolution){
- case VISU::Result::FULL:
- aParam = "VISU.Result.FULL";
- break;
- case VISU::Result::MEDIUM:
- aParam = "VISU.Result.MEDIUM";
- break;
- case VISU::Result::LOW:
- aParam = "VISU.Result.LOW";
- break;
- case VISU::Result::HIDDEN:
- aParam = "VISU.Result.HIDDEN";
- break;
- }
- theStr<<thePrefix<<aName<<".SetResolution('"<<aMeshName.in()<<"', '"<<aPart.in()<<"', "<<aParam<<")"<<endl;
- }
- theStr<<thePrefix<<endl;
- }
- }
- }
- }
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }else{
- SALOMEDS::SObject_var aRefSObj;
- if(theSObject->FindSubObject(1,aRefSObj)){
- SALOMEDS::SObject_var aTargetRefSObj;
- if(aRefSObj->ReferencedObject(aTargetRefSObj)){
- CORBA::String_var aString = aTargetRefSObj->GetName();
- theStr<<thePrefix<<"aSObject = theStudy.FindObject('"<<aString.in()<<"')"<<endl;
- theStr<<thePrefix<<"if aSObject:"<<endl;
- thePrefix += PREFIX;
- theStr<<thePrefix<<"anObject = aSObject.GetObject()"<<endl;
- theStr<<thePrefix<<"if anObject:"<<endl;
- std::string aPrefix1 = thePrefix;
- thePrefix += PREFIX;
-
- switch(anId){
- case Result_i::eImportMed:
- theStr<<thePrefix<<aName<<" = aVisu.ImportMed(aSObject)"<<endl;
- break;
- case Result_i::eImportMedField:
- theStr<<thePrefix<<aName<<" = aVisu.ImportMedField(anObject)"<<endl;
- break;
- }
-
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- std::string aPrefix2 = thePrefix;
- thePrefix += PREFIX;
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- theStr<<aPrefix2<<"pass"<<endl<<endl;
- theStr<<aPrefix1<<"pass"<<endl<<endl;
- }
- }
- }
- }
- return;
- case VISU::TMESH:
- if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
- VISU::Entity anEntity = aServant->GetEntity();
- const std::string& aSubMeshName = aServant->GetSubMeshName();
- if(anEntity >= 0){
- std::string aParam;
- 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;
- }
-
- if(aSubMeshName == "")
- theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
- ", '"<<aServant->GetCMeshName()<<"'"<<
- ", "<<aParam<<
- ")"<<endl;
- else
- theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
- ", '"<<aServant->GetCMeshName()<<"'"<<
- ", "<<aParam<<
- ", '"<<aSubMeshName<<"'"<<
- ")"<<endl;
- }else
- theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
- ", '"<<aServant->GetCMeshName()<<"'"<<
- ", '"<<aSubMeshName<<"'"<<
- ")"<<endl;
-
- theStr<<thePrefix<<"if "<<aName<<":"<<endl;
- thePrefix += PREFIX;
-
- // Add to Name->Object map
- theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
-
- // Set name (as this object could be renamed by user)
- theStr<<thePrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
-
- // Set parameters common for all Prs3d objects (offset values)
- Prs3dToPython(aServant,theStr,aName,thePrefix);
-
- // Set presentation parameters
- SALOMEDS::Color aColor;
- aColor = aServant->GetCellColor();
- theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
- aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
-
- aColor = aServant->GetNodeColor();
- theStr<<thePrefix<<aName<<".SetNodeColor(SALOMEDS.Color("<<
- aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
-
- aColor = aServant->GetLinkColor();
- theStr<<thePrefix<<aName<<".SetLinkColor(SALOMEDS.Color("<<
- aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
-
- std::string aParam;
- switch(aServant->GetPresentationType()){
- case POINT:
- aParam = "VISU.POINT";
- break;
- case WIREFRAME:
- aParam = "VISU.WIREFRAME";
- break;
- case SHADED:
- aParam = "VISU.SHADED";
- break;
- case INSIDEFRAME:
- aParam = "VISU.INSIDEFRAME";
- break;
- case SURFACEFRAME:
- aParam = "VISU.SURFACEFRAME";
- break;
- case SHRINK:
- aParam = "VISU.SHRINK";
- break;
- }
- theStr<<thePrefix<<aName<<".SetPresentationType("<<aParam<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetShrink("<<(aServant->IsShrank()? "True" : "False")<<")"<<endl;
- theStr<<thePrefix<<endl;
-
- std::string aQuad2DPresent;
- switch(aServant->GetQuadratic2DPresentationType()){
- case LINES:
- aQuad2DPresent = "VISU.LINES";
- break;
- case ARCS:
- aQuad2DPresent = "VISU.ARCS";
- break;
- }
-
- theStr<<thePrefix<<aName<<".SetQuadratic2DPresentationType("<<aQuad2DPresent<<")"<<endl;
-
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- return;
- }
- break;
- case VISU::TSCALARMAP:
- if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(GetServant(anObj).in())){
- 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())){
- 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())){
- 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:
- case VISU::TDEFORMEDSHAPEANDSCALARMAP:
- if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeAndScalarMapOnField", theArgumentName);
- thePrefix = DeformedShapeAndScalarMapToPython(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())){
- 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())){
- 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())){
- 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())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutLinesOnField", theArgumentName);
- thePrefix = CutLinesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TCUTSEGMENT:
- if(CutSegment_i* aServant = dynamic_cast<CutSegment_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutSegmentOnField", theArgumentName);
- thePrefix = CutSegmentToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TPLOT3D:
- if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(GetServant(anObj).in())) {
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "Plot3DOnField", theArgumentName);
- thePrefix = Plot3DToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TPOINTMAP3D:
- if (PointMap3d_i* aServant = dynamic_cast<PointMap3d_i*>(GetServant(anObj).in())) {
- CORBA::Short aTag = theSObject->Tag();
- theStr<<thePrefix<<"anIsFound, aSObject = "<<theArgumentName<<".FindSubObject("<<aTag<<")"<<endl;
- theStr<<thePrefix<<"if anIsFound:"<<endl;
- thePrefix += PREFIX;
-
- theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
- theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
-
- // Set name (as this object could be renamed by user)
- theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
-
- // Set PointMap3D Properties
-
- theStr<<thePrefix<<aName<<".SetScaleFactor("<<aServant->GetScaleFactor()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetContourPrs("<<aServant->GetIsContourPrs()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetNbOfContours("<<aServant->GetNbOfContours()<<")"<<endl;
-
- std::string aParam;
- switch(aServant->GetScaling()){
- case LINEAR:
- aParam = "VISU.LINEAR";
- break;
- case LOGARITHMIC:
- aParam = "VISU.LOGARITHMIC";
- break;
- }
- theStr<<thePrefix<<aName<<".SetScaling("<<aParam<<")"<<endl;
-
- theStr<<thePrefix<<aName<<".SetNbColors("<<aServant->GetNbColors()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetLabels("<<aServant->GetLabels()<<")"<<endl;
-
- switch(aServant->GetBarOrientation()){
- case ColoredPrs3dBase::HORIZONTAL:
- aParam = "VISU.ColoredPrs3d.HORIZONTAL";
- break;
- case ColoredPrs3dBase::VERTICAL:
- aParam = "VISU.ColoredPrs3d.VERTICAL";
- break;
- }
- theStr<<thePrefix<<aName<<".SetBarOrientation("<<aParam<<")"<<endl;
-
- if(aServant->IsRangeFixed())
- theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<", "<<aServant->GetMax()<<")"<<endl;
- else
- theStr<<thePrefix<<aName<<".SetSourceRange()"<<endl;
-
- theStr<<thePrefix<<aName<<".SetPosition("<<aServant->GetPosX()<<", "<<aServant->GetPosY()<<")"<<endl;
- theStr<<thePrefix<<aName<<".SetSize("<<aServant->GetWidth()<<", "<<aServant->GetHeight()<<")"<<endl;
-
- float dx, dy, dz;
- aServant->GetOffset(dx, dy, dz);
- theStr<<thePrefix<<aName<<".SetOffset("<<dx<<", "<<dy<<", "<<dz<<")"<<endl;
-
-
- theStr<<thePrefix<<endl;
-
- theArgumentName = aName;
- DumpChildrenToPython(theStudy,
- theIsPublished,
- theIsValidScript,
- theSObject,
- theStr,
- theName2EntryMap,
- theEntry2NameMap,
- theArgumentName,
- thePrefix);
-
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TGAUSSPOINTS:
- if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
- TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
- thePrefix = GaussPointsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
- theStr<<thePrefix<<"pass"<<endl<<endl;
- }
- return;
- case VISU::TCURVE:
- if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
- {
- bool withZ = aServant->GetZRow()>0;
-
- theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve";
- if( withZ )
- theStr << "WithZ";
- theStr << "(" <<
+ case VISU::TRESULT:
+ if(Result_i* aServant = dynamic_cast<Result_i*>(GetServant(anObj).in())){
+ std::string aFileName = aServant->GetInitFileName();
+ Result_i::ECreationId anId = aServant->GetCreationId();
+ if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
+ switch(anId){
+ case Result_i::eImportFile:
+ theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetBuildGroups("<<
+ GetBoolean(aServant->IsGroupsDone())<<")"<<
+ endl;
+
+ theStr<<thePrefix<<aName<<".SetBuildFields("<<
+ GetBoolean(aServant->IsFieldsDone())<<", "<<
+ GetBoolean(aServant->IsMinMaxDone())<<")"<<
+ endl;
+
+ theStr<<thePrefix<<aName<<".Build(False, True)"<<endl;
+
+ theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
+ break;
+ case Result_i::eCopyAndImportFile:
+ theStr<<thePrefix<<aName<<" = aVisu.CopyAndImportFile('"<<aFileName<<"')"<<endl;
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ break;
+ }
+
+ thePrefix += PREFIX;
+ {
+ VISU::Result::EntityNames_var aMeshNames = aServant->GetMeshNames();
+ if (aMeshNames->length() > 0) {
+ for(size_t aMeshId = 0; aMeshId < aMeshNames->length(); aMeshId++){
+ CORBA::String_var aMeshName = aMeshNames[aMeshId];
+ VISU::Result::EntityNames_var aParts = aServant->GetPartNames(aMeshName);
+ if (aParts->length() > 0) {
+ for(size_t aPartId = 0; aPartId < aParts->length(); aPartId++){
+ CORBA::String_var aPart = aParts[aPartId];
+ VISU::Result::Resolution aResolution = aServant->GetResolution(aMeshName, aPart);
+ std::string aParam;
+ switch(aResolution){
+ case VISU::Result::FULL:
+ aParam = "VISU.Result.FULL";
+ break;
+ case VISU::Result::MEDIUM:
+ aParam = "VISU.Result.MEDIUM";
+ break;
+ case VISU::Result::LOW:
+ aParam = "VISU.Result.LOW";
+ break;
+ case VISU::Result::HIDDEN:
+ aParam = "VISU.Result.HIDDEN";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetResolution('"<<aMeshName.in()<<"', '"<<aPart.in()<<"', "<<aParam<<")"<<endl;
+ }
+ theStr<<thePrefix<<endl;
+ }
+ }
+ }
+ }
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }else{
+ SALOMEDS::SObject_var aRefSObj;
+ if(theSObject->FindSubObject(1,aRefSObj)){
+ SALOMEDS::SObject_var aTargetRefSObj;
+ if(aRefSObj->ReferencedObject(aTargetRefSObj)){
+ CORBA::String_var aString = aTargetRefSObj->GetName();
+ theStr<<thePrefix<<"aSObject = theStudy.FindObject('"<<aString.in()<<"')"<<endl;
+ theStr<<thePrefix<<"if aSObject:"<<endl;
+ thePrefix += PREFIX;
+ theStr<<thePrefix<<"anObject = aSObject.GetObject()"<<endl;
+ theStr<<thePrefix<<"if anObject:"<<endl;
+ std::string aPrefix1 = thePrefix;
+ thePrefix += PREFIX;
+
+ switch(anId){
+ case Result_i::eImportMed:
+ theStr<<thePrefix<<aName<<" = aVisu.ImportMed(aSObject)"<<endl;
+ break;
+ case Result_i::eImportMedField:
+ theStr<<thePrefix<<aName<<" = aVisu.ImportMedField(anObject)"<<endl;
+ break;
+ }
+
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ std::string aPrefix2 = thePrefix;
+ thePrefix += PREFIX;
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ theStr<<aPrefix2<<"pass"<<endl<<endl;
+ theStr<<aPrefix1<<"pass"<<endl<<endl;
+ }
+ }
+ }
+ }
+ return;
+ case VISU::TMESH:
+ if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
+ VISU::Entity anEntity = aServant->GetEntity();
+ const std::string& aSubMeshName = aServant->GetSubMeshName();
+ if(anEntity >= 0){
+ std::string aParam;
+ 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;
+ }
+
+ if(aSubMeshName == "")
+ theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", "<<aParam<<
+ ")"<<endl;
+ else
+ theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", "<<aParam<<
+ ", '"<<aSubMeshName<<"'"<<
+ ")"<<endl;
+ }else
+ theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
+ ", '"<<aServant->GetCMeshName()<<"'"<<
+ ", '"<<aSubMeshName<<"'"<<
+ ")"<<endl;
+
+ theStr<<thePrefix<<"if "<<aName<<":"<<endl;
+ thePrefix += PREFIX;
+
+ // Add to Name->Object map
+ theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
+
+ // Set parameters common for all Prs3d objects (offset values)
+ Prs3dToPython(aServant,theStr,aName,thePrefix);
+
+ // Set presentation parameters
+ SALOMEDS::Color aColor;
+ aColor = aServant->GetCellColor();
+ theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+ aColor = aServant->GetNodeColor();
+ theStr<<thePrefix<<aName<<".SetNodeColor(SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+ aColor = aServant->GetLinkColor();
+ theStr<<thePrefix<<aName<<".SetLinkColor(SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+ std::string aParam;
+ switch(aServant->GetPresentationType()){
+ case POINT:
+ aParam = "VISU.POINT";
+ break;
+ case WIREFRAME:
+ aParam = "VISU.WIREFRAME";
+ break;
+ case SHADED:
+ aParam = "VISU.SHADED";
+ break;
+ case INSIDEFRAME:
+ aParam = "VISU.INSIDEFRAME";
+ break;
+ case SURFACEFRAME:
+ aParam = "VISU.SURFACEFRAME";
+ break;
+ case SHRINK:
+ aParam = "VISU.SHRINK";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetPresentationType("<<aParam<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetShrink("<<(aServant->IsShrank()? "True" : "False")<<")"<<endl;
+ theStr<<thePrefix<<endl;
+
+ std::string aQuad2DPresent;
+ switch(aServant->GetQuadratic2DPresentationType()){
+ case LINES:
+ aQuad2DPresent = "VISU.LINES";
+ break;
+ case ARCS:
+ aQuad2DPresent = "VISU.ARCS";
+ break;
+ }
+
+ theStr<<thePrefix<<aName<<".SetQuadratic2DPresentationType("<<aQuad2DPresent<<")"<<endl;
+
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ return;
+ }
+ break;
+ case VISU::TSCALARMAP:
+ if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(GetServant(anObj).in())){
+ 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())){
+ 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())){
+ 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:
+ case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeAndScalarMapOnField", theArgumentName);
+ thePrefix = DeformedShapeAndScalarMapToPython(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())){
+ 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())){
+ 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())){
+ 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())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutLinesOnField", theArgumentName);
+ thePrefix = CutLinesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TCUTSEGMENT:
+ if(CutSegment_i* aServant = dynamic_cast<CutSegment_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutSegmentOnField", theArgumentName);
+ thePrefix = CutSegmentToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TPLOT3D:
+ if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(GetServant(anObj).in())) {
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "Plot3DOnField", theArgumentName);
+ thePrefix = Plot3DToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TPOINTMAP3D:
+ if (PointMap3d_i* aServant = dynamic_cast<PointMap3d_i*>(GetServant(anObj).in())) {
+
+ SALOMEDS::GenericAttribute_var anAttr;
+ if(theSObject->FindAttribute(anAttr,"AttributeString")){
+ using namespace SALOMEDS;
+ AttributeString_var aComment = AttributeString::_narrow(anAttr);
+ CORBA::String_var aValue = aComment->Value();
+ Storable::TRestoringMap aMap;
+ Storable::StringToMap(aValue.in(),aMap);
+ bool anIsExist;
+ QString aSourceId = VISU::Storable::FindValue(aMap,"mySourceId",&anIsExist);
+ if(anIsExist) {
+ if( aSourceId == "TableAttr" ) {
+ DumpTableAttrToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+ }
+ }
+ }
+
+ CORBA::Short aTag = theSObject->Tag();
+ theStr<<thePrefix<<"anIsFound, aSObject = "<<(theArgumentName.empty() ? "aSComponent" : theArgumentName)<<".FindSubObject("<<aTag<<")"<<endl;
+ theStr<<thePrefix<<"if anIsFound:"<<endl;
+ thePrefix += PREFIX;
+
+ theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
+ theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
+
+ // Set PointMap3D Properties
+
+ theStr<<thePrefix<<aName<<".SetScaleFactor("<<aServant->GetScaleFactor()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetContourPrs("<<aServant->GetIsContourPrs()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetNbOfContours("<<aServant->GetNbOfContours()<<")"<<endl;
+
+ std::string aParam;
+ switch(aServant->GetScaling()){
+ case LINEAR:
+ aParam = "VISU.LINEAR";
+ break;
+ case LOGARITHMIC:
+ aParam = "VISU.LOGARITHMIC";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetScaling("<<aParam<<")"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetNbColors("<<aServant->GetNbColors()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetLabels("<<aServant->GetLabels()<<")"<<endl;
+
+ switch(aServant->GetBarOrientation()){
+ case ColoredPrs3dBase::HORIZONTAL:
+ aParam = "VISU.ColoredPrs3d.HORIZONTAL";
+ break;
+ case ColoredPrs3dBase::VERTICAL:
+ aParam = "VISU.ColoredPrs3d.VERTICAL";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetBarOrientation("<<aParam<<")"<<endl;
+
+ if(aServant->IsRangeFixed())
+ theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<", "<<aServant->GetMax()<<")"<<endl;
+ else
+ theStr<<thePrefix<<aName<<".SetSourceRange()"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetPosition("<<aServant->GetPosX()<<", "<<aServant->GetPosY()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetSize("<<aServant->GetWidth()<<", "<<aServant->GetHeight()<<")"<<endl;
+
+ float dx, dy, dz;
+ aServant->GetOffset(dx, dy, dz);
+ theStr<<thePrefix<<aName<<".SetOffset("<<dx<<", "<<dy<<", "<<dz<<")"<<endl;
+
+
+ theStr<<thePrefix<<endl;
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TGAUSSPOINTS:
+ if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
+ TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
+ thePrefix = GaussPointsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
+ case VISU::TCURVE:
+ if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
+ {
+ bool withZ = aServant->GetZRow()>0;
+ bool isV2 = aServant->GetIsV2();
+
+ theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve";
+ if( isV2 )
+ theStr << "WithZExt";
+ else if( withZ )
+ theStr << "WithZ";
+ theStr << "(" <<