1 #include "MEDPresentationPointSprite.hxx"
4 MEDPresentationPointSprite::internalGeneratePipeline()
6 PyGILState_STATE _gil_state = PyGILState_Ensure();
8 std::string cmd = std::string("import pvsimple as pvs;");
9 cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
10 cmd += std::string("__disp1 = pvs.Show(__obj1);");
11 cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
12 cmd += std::string("pvs.GetActiveViewOrCreate('RenderView').ResetCamera();");
13 cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
14 cmd += std::string("__disp1.SetRepresentationType('Point Sprite');");
16 //std::cerr << "Python command:" << std::endl;
17 //std::cerr << cmd << std::endl;
18 PyRun_SimpleString(cmd.c_str());
19 // Retrieve Python object for internal storage:
20 PyObject * obj = getPythonObjectFromMain("__obj1");
21 PyObject * disp = getPythonObjectFromMain("__disp1");
22 pushInternal(obj, disp);
24 PyGILState_Release(_gil_state);