- # Copyright (C) 2012-2015 CEA/DEN, EDF R&D
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE
++# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
- # Copyright (C) 2012-2015 CEA/DEN, EDF R&D
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE
++# Copyright (C) 2012-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
--- /dev/null
++// Copyright (C) 2016 CEA/DEN, EDF R&D
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the GNU Lesser General Public
++// License as published by the Free Software Foundation; either
++// version 2.1 of the License, or (at your option) any later version.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++//
++// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
++
+#include "MEDPresentationContour.hxx"
+
+void
+MEDPresentationContour::internalGeneratePipeline()
+{
+ PyGILState_STATE _gil_state = PyGILState_Ensure();
+
+ std::string cmd = std::string("import pvsimple as pvs;");
+ cmd += getRenderViewCommand(_params.viewMode); // define __view1
+
+ cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+ cmd += std::string("__isovolume1 = pvs.IsoVolume(Input=__obj1);");
+ cmd += std::string("__disp1 = pvs.Show(__isovolume1, __view1);");
+ cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+ cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+ cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+ cmd += std::string("pvs.Render();");
+
+ //std::cerr << "Python command:" << std::endl;
+ //std::cerr << cmd << std::endl;
+ PyRun_SimpleString(cmd.c_str());
+ // Retrieve Python object for internal storage:
+ PyObject* obj = getPythonObjectFromMain("__isovolume1");
+ PyObject* disp = getPythonObjectFromMain("__disp1");
+ pushInternal(obj, disp);
+
+ PyGILState_Release(_gil_state);
+}
--- /dev/null
+// Copyright (C) 2016 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
+
+#ifndef SRC_MEDCALC_CMP_MEDPRESENTATION_CONTOUR_HXX_
+#define SRC_MEDCALC_CMP_MEDPRESENTATION_CONTOUR_HXX_
+
+#include "MEDCALC.hxx"
+#include "MEDPresentation.hxx"
+
+class MEDCALC_EXPORT MEDPresentationContour : public MEDPresentation
+{
+public:
+ MEDPresentationContour(const MEDCALC::ContourParameters& params) :
+ MEDPresentation(params.fieldHandlerId, "MEDPresentationContour"), _params(params)
+ {}
+ virtual ~MEDPresentationContour() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ MEDCALC::ContourParameters _params;
+};
+
+#endif
--- /dev/null
++// Copyright (C) 2016 CEA/DEN, EDF R&D
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the GNU Lesser General Public
++// License as published by the Free Software Foundation; either
++// version 2.1 of the License, or (at your option) any later version.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++//
++// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
++
+#include "MEDPresentationDeflectionShape.hxx"
+
+void
+MEDPresentationDeflectionShape::internalGeneratePipeline()
+{
+ PyGILState_STATE _gil_state = PyGILState_Ensure();
+
+ std::string cmd = std::string("import pvsimple as pvs;");
+ cmd += getRenderViewCommand(_params.viewMode); // define __view1
+
+ cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+ cmd += std::string("__warpByVector1 = pvs.WarpByVector(Input=__obj1);");
+ cmd += std::string("__disp1 = pvs.Show(__warpByVector1, __view1);");
+ cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+ cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+ cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+ cmd += std::string("pvs.Render();");
+
+ //std::cerr << "Python command:" << std::endl;
+ //std::cerr << cmd << std::endl;
+ PyRun_SimpleString(cmd.c_str());
+ // Retrieve Python object for internal storage:
+ PyObject* obj = getPythonObjectFromMain("__warpByVector1");
+ PyObject* disp = getPythonObjectFromMain("__disp1");
+ pushInternal(obj, disp);
+
+ PyGILState_Release(_gil_state);
+}
--- /dev/null
+// Copyright (C) 2016 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
+
+#ifndef SRC_MEDCALC_CMP_MEDPRESENTATION_DEFLECTIONSHAPE_HXX_
+#define SRC_MEDCALC_CMP_MEDPRESENTATION_DEFLECTIONSHAPE_HXX_
+
+#include "MEDCALC.hxx"
+#include "MEDPresentation.hxx"
+
+class MEDCALC_EXPORT MEDPresentationDeflectionShape : public MEDPresentation
+{
+public:
+ MEDPresentationDeflectionShape(const MEDCALC::DeflectionShapeParameters& params) :
+ MEDPresentation(params.fieldHandlerId, "MEDPresentationDeflectionShape"), _params(params)
+ {}
+ virtual ~MEDPresentationDeflectionShape() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ MEDCALC::DeflectionShapeParameters _params;
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2011-2016 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
+
+#ifndef SRC_MEDCALC_CMP_MEDPRESENTATION_EXCEPTION_HXX_
+#define SRC_MEDCALC_CMP_MEDPRESENTATION_EXCEPTION_HXX_
+
+#include "MEDCALC.hxx"
+#include <iostream>
+#include <sstream>
+#include <exception>
+
+class MEDCALC_EXPORT MEDPresentationException
+ : public std::exception
+{
+public:
+
+ MEDPresentationException(const char* msg) {
+ std::ostringstream oss;
+ oss << "Error: " << msg;
+ this->_msg = oss.str();
+ }
+
+ virtual ~MEDPresentationException() throw() {}
+
+ virtual const char* what() const throw() {
+ return this->_msg.c_str();
+ }
+
+private:
+
+ std::string _msg;
+
+};
+
+#endif /* SRC_MEDCALC_CMP_MEDPRESENTATION_EXCEPTION_HXX_ */
--- /dev/null
++// Copyright (C) 2016 CEA/DEN, EDF R&D
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the GNU Lesser General Public
++// License as published by the Free Software Foundation; either
++// version 2.1 of the License, or (at your option) any later version.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++//
++// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
++
+#include "MEDPresentationPointSprite.hxx"
+
+void
+MEDPresentationPointSprite::internalGeneratePipeline()
+{
+ PyGILState_STATE _gil_state = PyGILState_Ensure();
+
+ std::string cmd = std::string("import pvsimple as pvs;");
+ cmd += getRenderViewCommand(_params.viewMode); // define __view1
+
+ cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+ cmd += std::string("__disp1 = pvs.Show(__obj1, __view1);");
+ cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+ cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+ cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+ cmd += std::string("__disp1.SetRepresentationType('Point Sprite');");
+ cmd += std::string("pvs.Render();");
+
+ //std::cerr << "Python command:" << std::endl;
+ //std::cerr << cmd << std::endl;
+ PyRun_SimpleString(cmd.c_str());
+ // Retrieve Python object for internal storage:
+ PyObject* obj = getPythonObjectFromMain("__obj1");
+ PyObject* disp = getPythonObjectFromMain("__disp1");
+ pushInternal(obj, disp);
+
+ PyGILState_Release(_gil_state);
+}
--- /dev/null
+// Copyright (C) 2016 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
+
+#ifndef SRC_MEDCALC_CMP_MEDPRESENTATION_POINTSPRITE_HXX_
+#define SRC_MEDCALC_CMP_MEDPRESENTATION_POINTSPRITE_HXX_
+
+#include "MEDCALC.hxx"
+#include "MEDPresentation.hxx"
+
+class MEDCALC_EXPORT MEDPresentationPointSprite : public MEDPresentation
+{
+public:
+ MEDPresentationPointSprite(const MEDCALC::PointSpriteParameters& params) :
+ MEDPresentation(params.fieldHandlerId, "MEDPresentationPointSprite"), _params(params)
+ {}
+ virtual ~MEDPresentationPointSprite() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ MEDCALC::PointSpriteParameters _params;
+};
+
+#endif
--- /dev/null
++// Copyright (C) 2016 CEA/DEN, EDF R&D
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the GNU Lesser General Public
++// License as published by the Free Software Foundation; either
++// version 2.1 of the License, or (at your option) any later version.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++//
++// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
++
+#include "MEDPresentationScalarMap.hxx"
+
+void
+MEDPresentationScalarMap::internalGeneratePipeline()
+{
+ PyGILState_STATE _gil_state = PyGILState_Ensure();
+
+ std::string cmd = std::string("import pvsimple as pvs;");
+ cmd += getRenderViewCommand(_params.viewMode); // define __view1
+
+ cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+ cmd += std::string("__disp1 = pvs.Show(__obj1, __view1);");
+ cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+ cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+ cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+ cmd += std::string("__lut = pvs.GetColorTransferFunction('")+_fieldName+std::string("');");
+ cmd += std::string("__lut.ApplyPreset('")+getColorMapCommand(_params.colorMap)+std::string("',True);");
+ cmd += std::string("pvs.Render();");
+
+ //std::cerr << "Python command:" << std::endl;
+ //std::cerr << cmd << std::endl;
+ PyRun_SimpleString(cmd.c_str());
+ // Retrieve Python object for internal storage:
+ PyObject* obj = getPythonObjectFromMain("__obj1");
+ PyObject* disp = getPythonObjectFromMain("__disp1");
+ pushInternal(obj, disp);
+
+ PyGILState_Release(_gil_state);
+}
--- /dev/null
+// Copyright (C) 2016 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
+
+#ifndef SRC_MEDCALC_CMP_MEDPRESENTATION_SCALARMAP_HXX_
+#define SRC_MEDCALC_CMP_MEDPRESENTATION_SCALARMAP_HXX_
+
+#include "MEDCALC.hxx"
+#include "MEDPresentation.hxx"
+
+class MEDCALC_EXPORT MEDPresentationScalarMap : public MEDPresentation
+{
+public:
+ MEDPresentationScalarMap(const MEDCALC::ScalarMapParameters& params) :
+ MEDPresentation(params.fieldHandlerId, "MEDPresentationScalarMap"), _params(params)
+ {}
+ virtual ~MEDPresentationScalarMap() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ MEDCALC::ScalarMapParameters _params;
+};
+
+#endif
--- /dev/null
++// Copyright (C) 2016 CEA/DEN, EDF R&D
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the GNU Lesser General Public
++// License as published by the Free Software Foundation; either
++// version 2.1 of the License, or (at your option) any later version.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++//
++// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
++
+#include "MEDPresentationSlices.hxx"
+
+void
+MEDPresentationSlices::internalGeneratePipeline()
+{
+ PyGILState_STATE _gil_state = PyGILState_Ensure();
+
+ std::string cmd = std::string("import pvsimple as pvs;");
+ cmd += getRenderViewCommand(_params.viewMode); // define __view1
+
+ cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+ cmd += std::string("__slice1 = pvs.Slice(Input=__obj1);");
+ cmd += std::string("__disp1 = pvs.Show(__slice1, __view1);");
+ cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+ cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+ cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+ cmd += std::string("pvs.Render();");
+
+ //std::cerr << "Python command:" << std::endl;
+ //std::cerr << cmd << std::endl;
+ PyRun_SimpleString(cmd.c_str());
+ // Retrieve Python object for internal storage:
+ PyObject* obj = getPythonObjectFromMain("__slice1");
+ PyObject* disp = getPythonObjectFromMain("__disp1");
+ pushInternal(obj, disp);
+
+ PyGILState_Release(_gil_state);
+}
--- /dev/null
+// Copyright (C) 2016 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
+
+#ifndef SRC_MEDCALC_CMP_MEDPRESENTATION_SLICES_HXX_
+#define SRC_MEDCALC_CMP_MEDPRESENTATION_SLICES_HXX_
+
+#include "MEDCALC.hxx"
+#include "MEDPresentation.hxx"
+
+class MEDCALC_EXPORT MEDPresentationSlices : public MEDPresentation
+{
+public:
+ MEDPresentationSlices(const MEDCALC::SlicesParameters& params) :
+ MEDPresentation(params.fieldHandlerId, "MEDPresentationSlices"), _params(params)
+ {}
+ virtual ~MEDPresentationSlices() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ MEDCALC::SlicesParameters _params;
+};
+
+#endif
--- /dev/null
++// Copyright (C) 2016 CEA/DEN, EDF R&D
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the GNU Lesser General Public
++// License as published by the Free Software Foundation; either
++// version 2.1 of the License, or (at your option) any later version.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++//
++// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
++
+#include "MEDPresentationVectorField.hxx"
+
+void
+MEDPresentationVectorField::internalGeneratePipeline()
+{
+ PyGILState_STATE _gil_state = PyGILState_Ensure();
+
+ std::string cmd = std::string("import pvsimple as pvs;");
+ cmd += getRenderViewCommand(_params.viewMode); // define __view1
+
+ cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + _fileName + std::string("');");
+ cmd += std::string("__disp1 = pvs.Show(__obj1, __view1);");
+ cmd += std::string("pvs.ColorBy(__disp1, ('") + _fieldType + std::string("', '") + _fieldName + std::string("'));");
+ cmd += std::string("__disp1.SetScalarBarVisibility(__view1, True);");
+ cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+ cmd += std::string("__disp1.SetRepresentationType('3D Glyphs');");
+ cmd += std::string("pvs.Render();");
+
+ //std::cerr << "Python command:" << std::endl;
+ //std::cerr << cmd << std::endl;
+ PyRun_SimpleString(cmd.c_str());
+ // Retrieve Python object for internal storage:
+ PyObject* obj = getPythonObjectFromMain("__obj1");
+ PyObject* disp = getPythonObjectFromMain("__disp1");
+ pushInternal(obj, disp);
+
+ PyGILState_Release(_gil_state);
+}
--- /dev/null
+// Copyright (C) 2016 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
+
+#ifndef SRC_MEDCALC_CMP_MEDPRESENTATION_VECTORFIELD_HXX_
+#define SRC_MEDCALC_CMP_MEDPRESENTATION_VECTORFIELD_HXX_
+
+#include "MEDCALC.hxx"
+#include "MEDPresentation.hxx"
+
+class MEDCALC_EXPORT MEDPresentationVectorField : public MEDPresentation
+{
+public:
+ MEDPresentationVectorField(const MEDCALC::VectorFieldParameters& params) :
+ MEDPresentation(params.fieldHandlerId, "MEDPresentationVectorField"), _params(params)
+ {}
+ virtual ~MEDPresentationVectorField() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ MEDCALC::VectorFieldParameters _params;
+};
+
+#endif
--- /dev/null
++// Copyright (C) 2016 CEA/DEN, EDF R&D
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the GNU Lesser General Public
++// License as published by the Free Software Foundation; either
++// version 2.1 of the License, or (at your option) any later version.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++//
++// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
++
+#include "WidgetPresentationParameters.hxx"
+
+WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent)
+ : QWidget(parent)
+{
+ ui.setupUi(this); // To be done first
+}
+
+MEDCALC::MEDPresentationViewMode
+WidgetPresentationParameters::getViewMode() {
+ QString viewMode = this->ui.comboBoxViewMode->currentText();
+ if (viewMode == tr("LAB_VIEW_MODE_REPLACE")) {
+ return MEDCALC::VIEW_MODE_REPLACE;
+ }
+ else if (viewMode == tr("LAB_VIEW_MODE_OVERLAP")) {
+ return MEDCALC::VIEW_MODE_OVERLAP;
+ }
+ else if (viewMode == tr("LAB_VIEW_MODE_NEW_LAYOUT")) {
+ return MEDCALC::VIEW_MODE_NEW_LAYOUT;
+ }
+ else if (viewMode == tr("LAB_VIEW_MODE_SPLIT_VIEW")) {
+ return MEDCALC::VIEW_MODE_SPLIT_VIEW;
+ }
+}
+
+std::string
+WidgetPresentationParameters::getField()
+{
+ return this->ui.comboBoxField->currentText().toStdString();
+}
+
+std::string
+WidgetPresentationParameters::getScalarBarRange()
+{
+ return this->ui.comboBoxScalarBarRange->currentText().toStdString();
+}
+
+double
+WidgetPresentationParameters::getScalarBarTimestep()
+{
+ return this->ui.doubleSpinBoxTimeStep->value();
+}
+
+double
+WidgetPresentationParameters::getScalarBarMinVal()
+{
+ return this->ui.doubleSpinBoxMinVal->value();
+}
+
+double
+WidgetPresentationParameters::getScalarBarMaxVal()
+{
+ return this->ui.doubleSpinBoxMaxVal->value();
+}
+
+MEDCALC::MEDPresentationColorMap
+WidgetPresentationParameters::getColorMap()
+{
+ QString colorMap = this->ui.comboBoxColorMap->currentText();
+ if (colorMap == tr("LAB_BLUE_TO_RED")) {
+ return MEDCALC::COLOR_MAP_BLUE_TO_RED_RAINBOW;
+ }
+ else if (colorMap == tr("LAB_COOL_TO_WARM")) {
+ return MEDCALC::COLOR_MAP_COOL_TO_WARM;
+ }
+}
--- /dev/null
++// Copyright (C) 2016 CEA/DEN, EDF R&D
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the GNU Lesser General Public
++// License as published by the Free Software Foundation; either
++// version 2.1 of the License, or (at your option) any later version.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++//
++// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
++//
++
+#ifndef WIDGET_PRESENTATION_PARAMETERS_HXX
+#define WIDGET_PRESENTATION_PARAMETERS_HXX
+
+#include "MEDCALCGUIdialogs.hxx"
+
+#include "ui_WidgetPresentationParameters.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(MEDPresentationManager)
+
+class WidgetPresentationParameters : public QWidget
+{
+public:
+ WidgetPresentationParameters(QWidget* parent = 0);
+
+ MEDCALC::MEDPresentationViewMode getViewMode();
+ std::string getField();
+ std::string getScalarBarRange();
+ double getScalarBarTimestep();
+ double getScalarBarMinVal();
+ double getScalarBarMaxVal();
+ MEDCALC::MEDPresentationColorMap getColorMap();
+
+ private:
+ Ui_WidgetPresentationParameters ui; // instance of the class defined in ui_WidgetPresentationParameters.h
+};
+
+
+#endif