#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"
//===========================================================================
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()){
// 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;
+ theStr<<thePrefix<<theName<<".SetNbColors("<<theServant->GetNbColors()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetLabels("<<theServant->GetLabels()<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetTitle('"<<theServant->GetTitle()<<"')"<<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,
+ std::string thePrefix)
+ {
+ thePrefix = ColoredPrs3dToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+
+ std::string aParam;
switch(theServant->GetScaling()){
case LINEAR:
aParam = "VISU.LINEAR";
}
theStr<<thePrefix<<theName<<".SetBarOrientation("<<aParam<<")"<<endl;
- 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;
-
return 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<<".SetSourceRange("<<aServant->GetSourceRangeMin()<<","<<aServant->GetSourceRangeMax()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetScale("<<aServant->GetScale()<<")"<<endl;
+
+ std::string aParam;
+ VISU::Entity anEntity = aServant->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<<thePrefix<<aName<<".SetScalarField("<<
+ "'"<<aServant->GetScalarMeshName()<<"',"<<
+ "'"<<aServant->GetScalarFieldName()<<"',"<<
+ aServant->GetScalarIteration()<<","<<
+ aParam<<
+ ")"<<endl;
+
+ 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);
return;
case VISU::TPLOT3D:
if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(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()){
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);
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
case VISU::TCURVE:
if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
{
}
return;
case VISU::TTABLE:
- if(Table_i* aServant = dynamic_cast<Table_i*>(GetServant(anObj).in())){
+ if(dynamic_cast<Table_i*>(GetServant(anObj).in())){
SALOMEDS::GenericAttribute_var anAttr;
if(theSObject->FindAttribute(anAttr,"AttributeComment")){
using namespace SALOMEDS;