From: apo Date: Mon, 18 Jun 2007 07:10:21 +0000 (+0000) Subject: Fix for Bug IPAL16146 X-Git-Tag: Before_Merging_With_Windows_20jun07~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c91e4d66aa1834c2c585fec3ef77ec7a7cbfd27b;p=modules%2Fvisu.git Fix for Bug IPAL16146 - IOLS. Loaded study has wrong order and displaying, no arrange actors for 3D presentations --- diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index d35c649e..560a870a 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -520,6 +520,24 @@ module VISU { * Gets the title of the scalar bar. */ string GetTitle(); + + /*! %Orientation of the scalar bar (to provide backward compatibility). */ + enum Orientation { + HORIZONTAL, /*!< Horizontal orientation of the scalar bar.*/ + VERTICAL /*!< Vertical orientation of the scalar bar.*/ + }; + + /*! + * Sets the type of orientation of the scalar bar (to provide backward compatibility). + * \param theOrientation This parameter defines the orientation of the scalar bar. + * It is taken from the Orientaton enumeration. + */ + void SetBarOrientation(in Orientation theOrientation); + + /*! + * Gets the type of orientation of the scalar bar (to provide backward compatibility). + */ + Orientation GetBarOrientation(); }; @@ -680,24 +698,6 @@ module VISU { */ void SetSourceRange(); - /*! %Orientation of the scalar bar (to provide backward compatibility). */ - enum Orientation { - HORIZONTAL, /*!< Horizontal orientation of the scalar bar.*/ - VERTICAL /*!< Vertical orientation of the scalar bar.*/ - }; - - /*! - * Sets the type of orientation of the scalar bar (to provide backward compatibility). - * \param theOrientation This parameter defines the orientation of the scalar bar. - * It is taken from the Orientaton enumeration. - */ - void SetBarOrientation(in Orientation theOrientation); - - /*! - * Gets the type of orientation of the scalar bar (to provide backward compatibility). - */ - Orientation GetBarOrientation(); - /*! * Add group as geometry of presentation. * \param theMeshName - mesh name diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index 8097d468..696e75d9 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -380,7 +380,7 @@ int VisuGUI_GaussScalarBarPane::storeToPrsObject(VISU::GaussPoints_i* thePrs) { thePrs->SetPosition(XSpin->value(), YSpin->value()); thePrs->SetSize(WidthSpin->value(), HeightSpin->value()); thePrs->SetSpacing(SpacingSpin->value()); - thePrs->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL); + thePrs->SetBarOrientation((RBvert->isChecked())? VISU::ColoredPrs3d::VERTICAL : VISU::ColoredPrs3d::HORIZONTAL); thePrs->SetIsActiveLocalScalarBar(myRBLocal->isChecked()); thePrs->SetIsDispGlobalScalarBar(myCBDisplayed->isChecked()); thePrs->SetNbColors(ColorSpin->value()); diff --git a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx index 892c3051..6fcd97ef 100644 --- a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx +++ b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx @@ -950,7 +950,7 @@ int VisuGUI_ScalarBarPane::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs) { myScalarMap->SetScalarMode(myModeCombo->currentItem()); myScalarMap->SetPosition(XSpin->value(), YSpin->value()); myScalarMap->SetSize(WidthSpin->value(), HeightSpin->value()); - myScalarMap->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL); + myScalarMap->SetBarOrientation((RBvert->isChecked())? VISU::ColoredPrs3d::VERTICAL : VISU::ColoredPrs3d::HORIZONTAL); if(isLogarithmic()) myScalarMap->SetScaling(VISU::LOGARITHMIC); else diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.hh b/src/VISU_I/VISU_ColoredPrs3dCache_i.hh index 8017b59b..56ab4a22 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.hh @@ -240,9 +240,6 @@ namespace VISU void RemoveHolder(VISU::ColoredPrs3dHolder_i* theHolder); - TColoredPrs3dHolderMap - GetHolderMap() { return myHolderMap; } - public: static const std::string myComment; diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 72a0c0ed..13246cfc 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -633,7 +633,7 @@ VISU::ColoredPrs3d_i //---------------------------------------------------------------------------- void VISU::ColoredPrs3d_i -::SetBarOrientation(VISU::ScalarMap::Orientation theOrientation) +::SetBarOrientation(VISU::ColoredPrs3d::Orientation theOrientation) { if(myOrientation != theOrientation){ myOrientation = theOrientation; @@ -642,7 +642,7 @@ VISU::ColoredPrs3d_i } //---------------------------------------------------------------------------- -VISU::ScalarMap::Orientation +VISU::ColoredPrs3d::Orientation VISU::ColoredPrs3d_i ::GetBarOrientation() { @@ -1043,26 +1043,26 @@ VISU::ColoredPrs3d_i // Orientation int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0); if(anOrientation == 1) - SetBarOrientation(VISU::ScalarMap::HORIZONTAL); + SetBarOrientation(VISU::ColoredPrs3d::HORIZONTAL); else - SetBarOrientation(VISU::ScalarMap::VERTICAL); + SetBarOrientation(VISU::ColoredPrs3d::VERTICAL); // Scalar Bar origin QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" ); - vtkFloatingPointType aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2; + vtkFloatingPointType aXorigin = (myOrientation == VISU::ColoredPrs3d::VERTICAL) ? 0.01 : 0.2; aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin); myPosition[0] = aXorigin; - vtkFloatingPointType aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012; + vtkFloatingPointType aYorigin = (myOrientation == VISU::ColoredPrs3d::VERTICAL) ? 0.1 : 0.012; aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin); myPosition[1] = aYorigin; // Scalar Bar size - myWidth = (myOrientation == VISU::ScalarMap::VERTICAL)? 0.1 : 0.6; + myWidth = (myOrientation == VISU::ColoredPrs3d::VERTICAL)? 0.1 : 0.6; myWidth = aResourceMgr->doubleValue("VISU", propertyName + "width", myWidth); - myHeight = (myOrientation == VISU::ScalarMap::VERTICAL)? 0.8:0.12; + myHeight = (myOrientation == VISU::ColoredPrs3d::VERTICAL)? 0.8:0.12; myHeight = aResourceMgr->doubleValue("VISU", propertyName + "height", myHeight); // scalar bar default position @@ -1071,7 +1071,7 @@ VISU::ColoredPrs3d_i if (anIsArrangeBar){ aPlace = aResourceMgr->integerValue("VISU", "scalar_bar_position_num",0); } - if(myOrientation == VISU::ScalarMap::HORIZONTAL){ + if(myOrientation == VISU::ColoredPrs3d::HORIZONTAL){ myPosition[1] += myHeight*(aPlace-1); } else { myPosition[0] += myWidth*(aPlace-1); @@ -1174,7 +1174,7 @@ VISU::ColoredPrs3d_i SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt()); SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt()); - SetBarOrientation((VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt()); + SetBarOrientation((VISU::ColoredPrs3d::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt()); SetTitle(VISU::Storable::FindValue(theMap,"myTitle").latin1()); myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt(); diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index 30e68db6..de53ef4d 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -169,10 +169,10 @@ namespace VISU virtual void - SetBarOrientation(VISU::ScalarMap::Orientation theOrientation); + SetBarOrientation(VISU::ColoredPrs3d::Orientation theOrientation); virtual - VISU::ScalarMap::Orientation + VISU::ColoredPrs3d::Orientation GetBarOrientation(); virtual @@ -479,7 +479,7 @@ namespace VISU std::string myScalarBarTitle; int myNumberOfLabels; - VISU::ScalarMap::Orientation myOrientation; + VISU::ColoredPrs3d::Orientation myOrientation; vtkFloatingPointType myPosition[2], myWidth, myHeight; //Font management diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index 688ec994..d40749fd 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -122,7 +122,7 @@ namespace VISU } - //=========================================================================== + //--------------------------------------------------------------------------- typedef void (*TDumpToPython)(SALOMEDS::Study_ptr theStudy, CORBA::Boolean theIsPublished, CORBA::Boolean& theIsValidScript, @@ -146,87 +146,142 @@ namespace VISU 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<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<GetCMeshName()<<"'"<< - ","<GetCFieldName()<<"'"<< - ","<GetTimeStampNumber()<< - ")"<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<GetCMeshName()<<"'"<< + ", "<GetCFieldName()<<"'"<< + ", "<GetTimeStampNumber()<< + ")"<Object map + theStr<GetName(); - theStr<GetName(); + theStr<GetScalarMode()<<")"<GetPosX()<<","<GetPosY()<<")"<GetWidth()<<","<GetHeight()<<")"<GetPosX()<<", "<GetPosY()<<")"<GetWidth()<<", "<GetHeight()<<")"<GetNbColors()<<")"<GetLabels()<<")"<GetTitle()<<"')"<GetBarOrientation()){ + case ColoredPrs3d::HORIZONTAL: + aParam = "VISU.ColoredPrs3d.HORIZONTAL"; + break; + case ColoredPrs3d::VERTICAL: + aParam = "VISU.ColoredPrs3d.VERTICAL"; + break; + } + theStr<GetScalarMode()<<")"<GetScaling()){ @@ -238,17 +293,7 @@ namespace VISU break; } theStr<GetMin()<<","<GetMax()<<")"<GetBarOrientation()){ - case ScalarMap::HORIZONTAL: - aParam = "VISU.ScalarMap.HORIZONTAL"; - break; - case ScalarMap::VERTICAL: - aParam = "VISU.ScalarMap.VERTICAL"; - break; - } - theStr<GetMin()<<", "<GetMax()<<")"<GetGroupNames(); VISU::ScalarMap_i::TGroupNames::const_iterator anIter = aGroupNames.begin(); @@ -259,27 +304,316 @@ namespace VISU 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<GetScale()<<")"<IsColored()<<")"<GetColor(); theStr<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<GetSource(); + if(!CORBA::is_nil(aPrs3d)){ + if(Prs3d_i* aServant3d = dynamic_cast(GetServant(aPrs3d).in())){ + SALOMEDS::SObject_var aSObject = aServant3d->GetSObject(); + CORBA::String_var anID = aSObject->GetID(); + std::string anArg = theEntry2NameMap[anID.in()]; + theStr<GetIntegrationStep()<<", "<< + theServant->GetPropagationTime()<<", "<< + theServant->GetStepLength()<<", "<< + "aPrs3d"<<", "<< + theServant->GetUsedPoints()<<", "<< + aParam<< + ")"<GetMin()<<", "<GetMax()<<")"<GetScale()<<")"<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<GetLineWidth()<<")"<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<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<GetNbSurfaces()<<")"<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<GetRotateX()<<", "<GetRotateY()<<")"<GetDisplacement()<<")"<GetNbPlanes(); + theStr<IsDefault(anId)) + theStr<GetPlanePosition(anId)<<")"<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<GetRotateX()<<", "<GetRotateY()<<")"<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<GetRotateX2()<<", "<GetRotateY2()<<")"<GetDisplacement()<<")"<GetDisplacement2()<<")"<IsDefault()) + theStr<GetBasePlanePosition()<<")"<IsUseAbsoluteLength(); + theStr<GetNbLines(); + theStr<IsDefaultPosition(anId)) + theStr<GetLinePosition(anId)<<")"<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<GetRotateX()<<", "<GetRotateY()<<")"<GetPlanePosition()<<", "<IsPositionRelative()<<")"<GetScaleFactor()<<")"<GetIsContourPrs()<<")"<GetNbOfContours()<<")"< void TableAttrToPython(SALOMEDS::Study_ptr theStudy, @@ -331,7 +665,7 @@ namespace VISU theStr<GetName()<<"\")"<IsFieldsDone()<<","<< + aServant->IsFieldsDone()<<", "<< aServant->IsMinMaxDone()<<")"<< endl; @@ -647,19 +981,19 @@ namespace VISU if(aSubMeshName == "") theStr<GetCMeshName()<<"'"<< - ","<GetCMeshName()<<"'"<< + ", "<GetCMeshName()<<"'"<< - ","<GetCMeshName()<<"'"<< + ", "<GetCMeshName()<<"'"<< - ",'"<GetCMeshName()<<"'"<< + ", '"<GetCellColor(); theStr<GetNodeColor(); theStr<GetLinkColor(); theStr<GetPresentationType()){ @@ -728,218 +1062,57 @@ namespace VISU break; case VISU::TSCALARMAP: if(ScalarMap_i* aServant = dynamic_cast(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<(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<(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<GetSource(); - if(!CORBA::is_nil(aPrs3d)){ - if(Prs3d_i* aServant3d = dynamic_cast(GetServant(aPrs3d).in())){ - SALOMEDS::SObject_var aSObject = aServant3d->GetSObject(); - CORBA::String_var anID = aSObject->GetID(); - std::string anArg = theEntry2NameMap[anID.in()]; - theStr<GetIntegrationStep()<<","<< - aServant->GetPropagationTime()<<","<< - aServant->GetStepLength()<<","<< - "aPrs3d"<<","<< - aServant->GetUsedPoints()<<","<< - aParam<< - ")"<(GetServant(anObj).in())){ - thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnDeformedShapeOnField",theArgumentName,thePrefix); - - theStr<GetMin()<<","<GetMax()<<")"<GetScale()<<")"<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<(GetServant(anObj).in())){ - thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"VectorsOnField",theArgumentName,thePrefix); - - theStr<GetLineWidth()<<")"<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<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<(GetServant(anObj).in())){ - thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"IsoSurfacesOnField",theArgumentName,thePrefix); - theStr<GetNbSurfaces()<<")"<(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<GetRotateX()<<","<GetRotateY()<<")"<GetDisplacement()<<")"<GetNbPlanes(); - theStr<IsDefault(anId)) - theStr<GetPlanePosition(anId)<<")"<(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<GetRotateX()<<","<GetRotateY()<<")"<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<GetRotateX2()<<","<GetRotateY2()<<")"<GetDisplacement()<<")"<GetDisplacement2()<<")"<IsDefault()) - theStr<GetBasePlanePosition()<<")"<IsUseAbsoluteLength(); - theStr<GetNbLines(); - theStr<IsDefaultPosition(anId)) - theStr<GetLinePosition(anId)<<")"<(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<GetRotateX()<<","<GetRotateY()<<")"<GetPlanePosition()<<","<IsPositionRelative()<<")"<GetScaleFactor()<<")"<GetIsContourPrs()<<")"<GetNbOfContours()<<")"<(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<GetHRow()<< // H row - ","<GetVRow(); // V row + ", "<GetHRow()<< // H row + ", "<GetVRow(); // V row if( withZ ) - theStr << "," << aServant->GetZRow(); // Z row + theStr << ", " << aServant->GetZRow(); // Z row - theStr << ",'"<GetTitle()<<"'"; // title + theStr << ", '"<GetTitle()<<"'"; // title SALOMEDS::Color aColor = aServant->GetColor(); theStr << ",SALOMEDS.Color("<< - aColor.R<<","<GetMarker()){ @@ -1013,7 +1175,7 @@ namespace VISU case Curve::CROSS: aParam = "VISU.Curve.CROSS"; break; case Curve::XCROSS: aParam = "VISU.Curve.XCROSS"; break; } - theStr<<","<GetLine()){ case Curve::VOIDLINE: aParam = "VISU.Curve.VOIDLINE"; break; @@ -1023,7 +1185,7 @@ namespace VISU case Curve::DASHDOTLINE: aParam = "VISU.Curve.DASHDOTLINE"; break; case Curve::DASHDOTDOTLINE: aParam = "VISU.Curve.DASHDOTDOTLINE"; break; } - theStr<<","<GetLineWidth()<<")"<GetLineWidth()<<")"<(GetServant(anObj).in())){ - theStr<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<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(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<myMeshName<<"', "<< + anEntity<<", '"<< + anInput->myFieldName<<"', "<< + anInput->myTimeStampNumber<<")"<< + endl; + + if(Prs3d_i* aPrs3d = dynamic_cast(GetServant(aDevice).in())){ + std::string aComment = aPrs3d->GetComment(); + theStr<GetName(); + theStr<GetType()){ + case VISU::TSCALARMAP: + if(ScalarMap_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = ScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TDEFORMEDSHAPE: + if(DeformedShape_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = DeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TSTREAMLINES: + if(StreamLines_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = StreamLinesToPython(aSObject, aServant, theStr, theEntry2NameMap, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TSCALARMAPONDEFORMEDSHAPE: + if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = ScalarMapOnDeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TVECTORS: + if(Vectors_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = VectorsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TISOSURFACES: + if(IsoSurfaces_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = IsoSurfacesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TCUTPLANES: + if(CutPlanes_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = CutPlanesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TCUTLINES: + if(CutLines_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = CutLinesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TPLOT3D: + if (Plot3D_i* aServant = dynamic_cast(aPrs3d)) { + aPrefix = Plot3DToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + case VISU::TGAUSSPOINTS: + if(GaussPoints_i* aServant = dynamic_cast(aPrs3d)){ + aPrefix = ColoredPrs3dToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix); + break; + } + } + theStr<myMeshName<<"',"<myFieldName<<"',"<myTimeStampNumber<<")"<GetComment(); - theStr<GetName(); - theStr<NewChildIterator(aSObject); for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){ @@ -1331,7 +1558,7 @@ namespace VISU } } - //=========================================================================== + //--------------------------------------------------------------------------- void DumpAnimationsToPython(SALOMEDS::Study_ptr theStudy, CORBA::Boolean theIsPublished, @@ -1391,7 +1618,7 @@ namespace VISU value = refObj->GetName(); QString path(theStudy->GetObjectPath(father)); //The following code requierd as a field name can contain '/' character - theStr<GetName(); if(!value.isEmpty()) theStr<