Salome HOME
Fix point sprites representation to use point gaussian
[modules/med.git] / src / MEDCalc / cmp / MEDPresentation.cxx
index 5c25207320dc7a767179c470558a337edd3b52b4..2018c7aa24baf4a0747f501903427790cd4824e8 100644 (file)
@@ -322,7 +322,7 @@ MEDPresentation::createSource()
     {
       std::ostringstream oss, oss2;
       oss2 << "__srcObj" << GeneratePythonId();
-      oss << oss2.str() << " = pvs.GaussPoints(Input=" << _srcObjVar << ");";
+      oss << oss2.str() << " = pvs.ELGAfieldToPointGaussian(Input=" << _srcObjVar << ");";
       pushAndExecPyLine(oss.str()); oss.str("");
       // Now the source becomes the result of the CellDatatoPointData:
       _srcObjVar = oss2.str();
@@ -600,6 +600,12 @@ MEDPresentation::fillAvailableFieldComponents()
       throw KERNEL::createSalomeException("Unexpected Python error");
     }
   setIntProperty(MEDPresentation::PROP_NB_COMPONENTS, nbCompo);
+
+  // if the field is not a vector (2 or 3 components), select the first component of the tensor,
+  // like in WidgetPresentationParameters::setComponents
+  if (!(nbCompo > 1 && nbCompo <= 3))
+    _selectedComponentIndex = 0;
+
   for (long i = 0; i<nbCompo; i++)
     {
       std::ostringstream oss2;