From: apo Date: Thu, 30 Mar 2006 12:36:42 +0000 (+0000) Subject: Fix for Bug11792 X-Git-Tag: mergeto_OCC_debug_for_3_2_0b1_07Apr06~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bd5ff89bf624e49404017a1f519bb4b830b3d954;p=modules%2Fvisu.git Fix for Bug11792 "Scalar Map on Def. Shape" and "Gauss Points" presentations are not dump in *.py file (MKO also) --- diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index 29db6391..5101d1aa 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -39,6 +39,8 @@ #include "VISU_StreamLines_i.hh" #include "VISU_Plot3D_i.hh" #include "VISU_Table_i.hh" +#include "VISU_GaussPoints_i.hh" +#include "VISU_ScalarMapOnDeformedShape_i.hh" #include "utilities.h" @@ -141,13 +143,13 @@ namespace VISU{ //=========================================================================== 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, - std::string thePrefix) + 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) { std::string aParam; switch(theServant->GetEntity()){ @@ -185,6 +187,28 @@ namespace VISU{ // Set parameters theStr<GetScalarMode()<<")"<GetPosX()<<","<GetPosY()<<")"<GetWidth()<<","<GetHeight()<<")"<GetNbColors()<<")"<GetLabels()<<")"<GetTitle()<<"')"<GetScaling()){ case LINEAR: aParam = "VISU.LINEAR"; @@ -206,12 +230,6 @@ namespace VISU{ } theStr<GetPosX()<<","<GetPosY()<<")"<GetWidth()<<","<GetHeight()<<")"<GetNbColors()<<")"<GetLabels()<<")"<GetTitle()<<"')"<(GetServant(anObj).in())){ + thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnDeformedShapeOnField",theArgumentName,thePrefix); + + theStr<GetSourceRangeMin()<<","<GetSourceRangeMax()<<")"<GetScale()<<")"<GetScalarEEntity(); + 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; + } + + theStr<GetScalarMeshName()<<"',"<< + "'"<GetScalarFieldName()<<"',"<< + aServant->GetScalarIteration()<<","<< + aParam<< + ")"<(GetServant(anObj).in())){ thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"VectorsOnField",theArgumentName,thePrefix); @@ -855,8 +907,7 @@ namespace VISU{ return; case VISU::TPLOT3D: if (Plot3D_i* aServant = dynamic_cast(GetServant(anObj).in())) { - thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName, - "Plot3DOnField", theArgumentName, thePrefix); + thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName,"Plot3DOnField", theArgumentName, thePrefix); std::string aParam; switch(aServant->GetOrientationType()){ @@ -873,6 +924,12 @@ namespace VISU{ theStr<(GetServant(anObj).in())){ + thePrefix = ColoredPrs3dToPython(theSObject,aServant,theStr,aName,"GaussPointsOnField",theArgumentName,thePrefix); + theStr<(GetServant(anObj).in())) { @@ -912,7 +969,7 @@ namespace VISU{ } return; case VISU::TTABLE: - if(Table_i* aServant = dynamic_cast(GetServant(anObj).in())){ + if(dynamic_cast(GetServant(anObj).in())){ SALOMEDS::GenericAttribute_var anAttr; if(theSObject->FindAttribute(anAttr,"AttributeComment")){ using namespace SALOMEDS;