-// Copyright (C) 2005-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2005-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
MEDPresentationViewMode viewMode;
};
+ // A contour is an isoline in 2D and an isosurface in 3D
+ struct ContourParameters {
+ long fieldHandlerId;
+ MEDPresentationViewMode viewMode;
+ };
+
+ struct VectorFieldParameters {
+ long fieldHandlerId;
+ MEDPresentationViewMode viewMode;
+ };
+
+ struct SlicesParameters {
+ long fieldHandlerId;
+ MEDPresentationViewMode viewMode;
+ };
+
+ struct DeflectionShapeParameters {
+ long fieldHandlerId;
+ MEDPresentationViewMode viewMode;
+ };
+
+ struct PointSpriteParameters {
+ long fieldHandlerId;
+ MEDPresentationViewMode viewMode;
+ };
+
interface MEDPresentationManager : SALOME::GenericObj
{
long makeScalarMap(in ScalarMapParameters params);
+ long makeContour(in ContourParameters params);
+ long makeVectorField(in VectorFieldParameters params);
+ long makeSlices(in SlicesParameters params);
+ long makeDeflectionShape(in DeflectionShapeParameters params);
+ long makePointSprite(in PointSpriteParameters params);
+
void setPresentationProperty(in long presId, in string propName, in string propValue);
string getPresentationProperty(in long presId, in string propName);
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D
+# 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
MEDCalculator_i.cxx
MEDPresentationManager_i.cxx
MEDPresentation.cxx
+ # presentations
+ MEDPresentationScalarMap.cxx
+ MEDPresentationContour.cxx
+ MEDPresentationVectorField.cxx
+ MEDPresentationSlices.cxx
+ MEDPresentationDeflectionShape.cxx
+ MEDPresentationPointSprite.cxx
)
SET(MEDFactoryEngine_SOURCES
-// Copyright (C) 2011-2015 CEA/DEN, EDF R&D
+// 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
return "";
}
}
-
-
-void MEDPresentationScalarMap::internalGeneratePipeline()
-{
- MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
-
- MEDCALC::MeshHandler* meshHandler = dataManager->getMesh(_fieldHandler->meshid);
- MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
-
- std::string fileName(dataSHandler->uri);
- std::string fieldName(_fieldHandler->fieldname);
- std::string fieldType = getFieldTypeString();
-
- std::cout << "Generating pipeline for SCALAR MAP:" <<std::endl;
- std::cout << "\tfileName: " << fileName << std::endl;
- std::cout << "\tfiedName: " << fieldName << std::endl;
- if (fileName.substr(0, 7) != std::string("file://"))
- {
- std::cerr << "\tData source is not a file! Can not proceed." << std::endl;
- return;
- }
-
- fileName = fileName.substr(7, fileName.size());
- std::cout << "\tfileName: " << fileName << std::endl;
-
- PyGILState_STATE _gil_state = PyGILState_Ensure();
-
- PyRun_SimpleString("print 'hello world'");
- std::string cmd = std::string(
- "import pvsimple as pvs;"
- "__obj1 = pvs.MEDReader(FileName='") + fileName + std::string("');"
- "__disp1 = pvs.Show(__obj1);"
- "pvs.ColorBy(__disp1, ('") + fieldType + std::string("', '") + fieldName + std::string("'));"
- "pvs.GetActiveViewOrCreate('RenderView').ResetCamera()");
-
- 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);
-}
\ No newline at end of file
-// Copyright (C) 2011-2015 CEA/DEN, EDF R&D
+// 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
std::map<std::string, std::string> _properties;
};
-class MEDCALC_EXPORT MEDPresentationScalarMap : public MEDPresentation
-{
-public:
- MEDPresentationScalarMap(MEDCALC::FieldHandler* fieldHdl, bool wireframe) :
- MEDPresentation(fieldHdl, "MEDPresentationScalarMap"),
- _isWireframe(wireframe)
- {}
- virtual ~MEDPresentationScalarMap() {}
-
-protected:
- virtual void internalGeneratePipeline();
-
-private:
- bool _isWireframe;
-};
-
#endif /* SRC_MEDCALC_CMP_MEDPRESENTATION_HXX_ */
--- /dev/null
+#include "MEDPresentationContour.hxx"
+#include "MEDFactoryClient.hxx"
+
+void
+MEDPresentationContour::internalGeneratePipeline()
+{
+}
--- /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(MEDCALC::FieldHandler* fieldHdl, bool wireframe) :
+ MEDPresentation(fieldHdl, "MEDPresentationContour"),
+ _isWireframe(wireframe)
+ {}
+ virtual ~MEDPresentationContour() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ bool _isWireframe;
+};
+
+#endif
--- /dev/null
+#include "MEDPresentationDeflectionShape.hxx"
+#include "MEDFactoryClient.hxx"
+
+void
+MEDPresentationDeflectionShape::internalGeneratePipeline()
+{
+}
--- /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(MEDCALC::FieldHandler* fieldHdl, bool wireframe) :
+ MEDPresentation(fieldHdl, "MEDPresentationDeflectionShape"),
+ _isWireframe(wireframe)
+ {}
+ virtual ~MEDPresentationDeflectionShape() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ bool _isWireframe;
+};
+
+#endif
-// Copyright (C) 2011-2015 CEA/DEN, EDF R&D
+// 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
#include "MEDPresentationManager_i.hxx"
#include "MEDFactoryClient.hxx"
#include "MEDPresentation.hxx"
+#include "MEDPresentationScalarMap.hxx"
+#include "MEDPresentationContour.hxx"
+#include "MEDPresentationVectorField.hxx"
+#include "MEDPresentationSlices.hxx"
+#include "MEDPresentationDeflectionShape.hxx"
+#include "MEDPresentationPointSprite.hxx"
MEDPresentationManager_i* MEDPresentationManager_i::_instance = NULL;
// Create a new presentation instance
TypeID newID = MEDPresentationManager_i::GenerateID();
- MEDPresentationScalarMap * scalarMap = new MEDPresentationScalarMap(fieldHandler, true); // on stack or on heap?? stack for now
- _presentations.insert( std::pair<TypeID, MEDPresentation *>(newID, scalarMap) );
+ MEDPresentationScalarMap * presentation = new MEDPresentationScalarMap(fieldHandler, true); // on stack or on heap?? stack for now
+ _presentations.insert( std::pair<TypeID, MEDPresentation *>(newID, presentation) );
- scalarMap->generatePipeline();
+ presentation->generatePipeline();
+
+ return newID;
+}
+
+TypeID
+MEDPresentationManager_i::makeContour(const MEDCALC::ContourParameters& params)
+{
+ MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
+
+ TypeID fieldHandlerId = params.fieldHandlerId;
+ MEDCALC::MEDPresentationViewMode viewMode = params.viewMode;
+
+ MEDCALC::FieldHandler* fieldHandler = dataManager->getFieldHandler(fieldHandlerId);
+ MEDCALC::MeshHandler* meshHandler = dataManager->getMesh(fieldHandler->meshid);
+ MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
+
+ std::cout << "\tfieldHandlerId: " << fieldHandlerId << std::endl;
+ std::cout << "\tviewMode: " << viewMode << std::endl;
+ std::cout << "\tfileName: " << dataSHandler->uri << std::endl;
+ std::cout << "\tfiedName: " << fieldHandler->fieldname << std::endl;
+
+ // Create a new presentation instance
+ TypeID newID = MEDPresentationManager_i::GenerateID();
+ MEDPresentationContour * presentation = new MEDPresentationContour(fieldHandler, true); // on stack or on heap?? stack for now
+ _presentations.insert( std::pair<TypeID, MEDPresentation *>(newID, presentation) );
+
+ presentation->generatePipeline();
+
+ return newID;
+}
+
+TypeID
+MEDPresentationManager_i::makeVectorField(const MEDCALC::VectorFieldParameters& params)
+{
+ MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
+
+ TypeID fieldHandlerId = params.fieldHandlerId;
+ MEDCALC::MEDPresentationViewMode viewMode = params.viewMode;
+
+ MEDCALC::FieldHandler* fieldHandler = dataManager->getFieldHandler(fieldHandlerId);
+ MEDCALC::MeshHandler* meshHandler = dataManager->getMesh(fieldHandler->meshid);
+ MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
+
+ std::cout << "\tfieldHandlerId: " << fieldHandlerId << std::endl;
+ std::cout << "\tviewMode: " << viewMode << std::endl;
+ std::cout << "\tfileName: " << dataSHandler->uri << std::endl;
+ std::cout << "\tfiedName: " << fieldHandler->fieldname << std::endl;
+
+ // Create a new presentation instance
+ TypeID newID = MEDPresentationManager_i::GenerateID();
+ MEDPresentationVectorField * presentation = new MEDPresentationVectorField(fieldHandler, true); // on stack or on heap?? stack for now
+ _presentations.insert( std::pair<TypeID, MEDPresentation *>(newID, presentation) );
+
+ presentation->generatePipeline();
+
+ return newID;
+}
+
+TypeID
+MEDPresentationManager_i::makeSlices(const MEDCALC::SlicesParameters& params)
+{
+ MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
+
+ TypeID fieldHandlerId = params.fieldHandlerId;
+ MEDCALC::MEDPresentationViewMode viewMode = params.viewMode;
+
+ MEDCALC::FieldHandler* fieldHandler = dataManager->getFieldHandler(fieldHandlerId);
+ MEDCALC::MeshHandler* meshHandler = dataManager->getMesh(fieldHandler->meshid);
+ MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
+
+ std::cout << "\tfieldHandlerId: " << fieldHandlerId << std::endl;
+ std::cout << "\tviewMode: " << viewMode << std::endl;
+ std::cout << "\tfileName: " << dataSHandler->uri << std::endl;
+ std::cout << "\tfiedName: " << fieldHandler->fieldname << std::endl;
+
+ // Create a new presentation instance
+ TypeID newID = MEDPresentationManager_i::GenerateID();
+ MEDPresentationSlices * presentation = new MEDPresentationSlices(fieldHandler, true); // on stack or on heap?? stack for now
+ _presentations.insert( std::pair<TypeID, MEDPresentation *>(newID, presentation) );
+
+ presentation->generatePipeline();
+
+ return newID;
+}
+
+TypeID
+MEDPresentationManager_i::makeDeflectionShape(const MEDCALC::DeflectionShapeParameters& params)
+{
+ MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
+
+ TypeID fieldHandlerId = params.fieldHandlerId;
+ MEDCALC::MEDPresentationViewMode viewMode = params.viewMode;
+
+ MEDCALC::FieldHandler* fieldHandler = dataManager->getFieldHandler(fieldHandlerId);
+ MEDCALC::MeshHandler* meshHandler = dataManager->getMesh(fieldHandler->meshid);
+ MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
+
+ std::cout << "\tfieldHandlerId: " << fieldHandlerId << std::endl;
+ std::cout << "\tviewMode: " << viewMode << std::endl;
+ std::cout << "\tfileName: " << dataSHandler->uri << std::endl;
+ std::cout << "\tfiedName: " << fieldHandler->fieldname << std::endl;
+
+ // Create a new presentation instance
+ TypeID newID = MEDPresentationManager_i::GenerateID();
+ MEDPresentationDeflectionShape * presentation = new MEDPresentationDeflectionShape(fieldHandler, true); // on stack or on heap?? stack for now
+ _presentations.insert( std::pair<TypeID, MEDPresentation *>(newID, presentation) );
+
+ presentation->generatePipeline();
+
+ return newID;
+}
+
+TypeID
+MEDPresentationManager_i::makePointSprite(const MEDCALC::PointSpriteParameters& params)
+{
+ MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
+
+ TypeID fieldHandlerId = params.fieldHandlerId;
+ MEDCALC::MEDPresentationViewMode viewMode = params.viewMode;
+
+ MEDCALC::FieldHandler* fieldHandler = dataManager->getFieldHandler(fieldHandlerId);
+ MEDCALC::MeshHandler* meshHandler = dataManager->getMesh(fieldHandler->meshid);
+ MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
+
+ std::cout << "\tfieldHandlerId: " << fieldHandlerId << std::endl;
+ std::cout << "\tviewMode: " << viewMode << std::endl;
+ std::cout << "\tfileName: " << dataSHandler->uri << std::endl;
+ std::cout << "\tfiedName: " << fieldHandler->fieldname << std::endl;
+
+ // Create a new presentation instance
+ TypeID newID = MEDPresentationManager_i::GenerateID();
+ MEDPresentationPointSprite * presentation = new MEDPresentationPointSprite(fieldHandler, true); // on stack or on heap?? stack for now
+ _presentations.insert( std::pair<TypeID, MEDPresentation *>(newID, presentation) );
+
+ presentation->generatePipeline();
return newID;
}
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-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
static MEDPresentationManager_i* getInstance();
MEDCALC_EXPORT TypeID makeScalarMap(const MEDCALC::ScalarMapParameters&);
+ MEDCALC_EXPORT TypeID makeContour(const MEDCALC::ContourParameters&);
+ MEDCALC_EXPORT TypeID makeVectorField(const MEDCALC::VectorFieldParameters&);
+ MEDCALC_EXPORT TypeID makeSlices(const MEDCALC::SlicesParameters&);
+ MEDCALC_EXPORT TypeID makeDeflectionShape(const MEDCALC::DeflectionShapeParameters&);
+ MEDCALC_EXPORT TypeID makePointSprite(const MEDCALC::PointSpriteParameters&);
+
MEDCALC_EXPORT void setPresentationProperty(TypeID presentationID, const char * propName, const char * propValue);
MEDCALC_EXPORT char* getPresentationProperty(TypeID presentationID, const char* propName);
--- /dev/null
+#include "MEDPresentationPointSprite.hxx"
+#include "MEDFactoryClient.hxx"
+
+void
+MEDPresentationPointSprite::internalGeneratePipeline()
+{
+}
--- /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(MEDCALC::FieldHandler* fieldHdl, bool wireframe) :
+ MEDPresentation(fieldHdl, "MEDPresentationPointSprite"),
+ _isWireframe(wireframe)
+ {}
+ virtual ~MEDPresentationPointSprite() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ bool _isWireframe;
+};
+
+#endif
--- /dev/null
+#include "MEDPresentationScalarMap.hxx"
+#include "MEDFactoryClient.hxx"
+
+#include <iostream>
+
+void
+MEDPresentationScalarMap::internalGeneratePipeline()
+{
+ MEDCALC::MEDDataManager_ptr dataManager(MEDFactoryClient::getDataManager());
+
+ MEDCALC::MeshHandler* meshHandler = dataManager->getMesh(_fieldHandler->meshid);
+ MEDCALC::DatasourceHandler* dataSHandler = dataManager->getDatasourceHandlerFromID(meshHandler->sourceid);
+
+ std::string fileName(dataSHandler->uri);
+ std::string fieldName(_fieldHandler->fieldname);
+ std::string fieldType = getFieldTypeString();
+
+ std::cout << "Generating pipeline for SCALAR MAP:" <<std::endl;
+ std::cout << "\tfileName: " << fileName << std::endl;
+ std::cout << "\tfiedName: " << fieldName << std::endl;
+ if (fileName.substr(0, 7) != std::string("file://"))
+ {
+ std::cerr << "\tData source is not a file! Can not proceed." << std::endl;
+ return;
+ }
+
+ fileName = fileName.substr(7, fileName.size());
+ std::cout << "\tfileName: " << fileName << std::endl;
+
+ PyGILState_STATE _gil_state = PyGILState_Ensure();
+
+ std::string cmd = std::string("import pvsimple as pvs;");
+ cmd += std::string("__obj1 = pvs.MEDReader(FileName='") + fileName + std::string("');");
+ cmd += std::string("__disp1 = pvs.Show(__obj1);");
+ cmd += std::string("pvs.ColorBy(__disp1, ('") + fieldType + std::string("', '") + fieldName + std::string("'));");
+ cmd += std::string("pvs.GetActiveViewOrCreate('RenderView').ResetCamera();");
+ cmd += std::string("__disp1.RescaleTransferFunctionToDataRangeOverTime();");
+
+ //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(MEDCALC::FieldHandler* fieldHdl, bool wireframe) :
+ MEDPresentation(fieldHdl, "MEDPresentationScalarMap"),
+ _isWireframe(wireframe)
+ {}
+ virtual ~MEDPresentationScalarMap() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ bool _isWireframe;
+};
+
+#endif
--- /dev/null
+#include "MEDPresentationSlices.hxx"
+#include "MEDFactoryClient.hxx"
+
+void
+MEDPresentationSlices::internalGeneratePipeline()
+{
+}
--- /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(MEDCALC::FieldHandler* fieldHdl, bool wireframe) :
+ MEDPresentation(fieldHdl, "MEDPresentationSlices"),
+ _isWireframe(wireframe)
+ {}
+ virtual ~MEDPresentationSlices() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ bool _isWireframe;
+};
+
+#endif
--- /dev/null
+#include "MEDPresentationVectorField.hxx"
+#include "MEDFactoryClient.hxx"
+
+void
+MEDPresentationVectorField::internalGeneratePipeline()
+{
+}
--- /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(MEDCALC::FieldHandler* fieldHdl, bool wireframe) :
+ MEDPresentation(fieldHdl, "MEDPresentationVectorField"),
+ _isWireframe(wireframe)
+ {}
+ virtual ~MEDPresentationVectorField() {}
+
+protected:
+ virtual void internalGeneratePipeline();
+
+private:
+ bool _isWireframe;
+};
+
+#endif
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-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
actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualizeScalarMap()),icon);
_salomeModule->addActionInPopupMenu(actionId, tr("LAB_VISUALIZE"));
+ label = tr("LAB_VISUALIZE_CONTOUR");
+ icon = tr("ICO_DATASOURCE_VIEW");
+ actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualizeContour()),icon);
+ _salomeModule->addActionInPopupMenu(actionId, tr("LAB_VISUALIZE"));
+
+ label = tr("LAB_VISUALIZE_VECTORFIELD");
+ icon = tr("ICO_DATASOURCE_VIEW");
+ actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualizeVectorField()),icon);
+ _salomeModule->addActionInPopupMenu(actionId, tr("LAB_VISUALIZE"));
+
+ label = tr("LAB_VISUALIZE_SLICES");
+ icon = tr("ICO_DATASOURCE_VIEW");
+ actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualizeSlices()),icon);
+ _salomeModule->addActionInPopupMenu(actionId, tr("LAB_VISUALIZE"));
+
+ label = tr("LAB_VISUALIZE_DEFLECTIONSHAPE");
+ icon = tr("ICO_DATASOURCE_VIEW");
+ actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualizeDeflectionShape()),icon);
+ _salomeModule->addActionInPopupMenu(actionId, tr("LAB_VISUALIZE"));
+
+ label = tr("LAB_VISUALIZE_POINTSPRITE");
+ icon = tr("ICO_DATASOURCE_VIEW");
+ actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualizePointSprite()),icon);
+ _salomeModule->addActionInPopupMenu(actionId, tr("LAB_VISUALIZE"));
+
// Use in workspace
label = tr("LAB_USE_IN_WORKSPACE");
icon = tr("ICO_DATASOURCE_USE");
this->visualize(DatasourceEvent::EVENT_VIEW_OBJECT_SCALAR_MAP);
}
+void DatasourceController::OnVisualizeContour() {
+ this->visualize(DatasourceEvent::EVENT_VIEW_OBJECT_CONTOUR);
+}
+
+void DatasourceController::OnVisualizeVectorField() {
+ this->visualize(DatasourceEvent::EVENT_VIEW_OBJECT_VECTOR_FIELD);
+}
+
+void DatasourceController::OnVisualizeSlices() {
+ this->visualize(DatasourceEvent::EVENT_VIEW_OBJECT_SLICES);
+}
+
+void DatasourceController::OnVisualizeDeflectionShape() {
+ this->visualize(DatasourceEvent::EVENT_VIEW_OBJECT_DEFLECTION_SHAPE);
+}
+
+void DatasourceController::OnVisualizePointSprite() {
+ this->visualize(DatasourceEvent::EVENT_VIEW_OBJECT_POINT_SPRITE);
+}
+
void DatasourceController::OnUseInWorkspace() {
// We need a studyEditor updated on the active study
_studyEditor->updateActiveStudy();
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-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
EVENT_IMPORT_OBJECT, // Simply import the object in the workspace
EVENT_USE_OBJECT, // Import in the workspace AND define a proxy
// variable in the tui console to use it
+ // presentations
+ EVENT_VIEW_OBJECT_CONTOUR,
+ EVENT_VIEW_OBJECT_DEFLECTION_SHAPE,
+ EVENT_VIEW_OBJECT_POINT_SPRITE,
EVENT_VIEW_OBJECT_SCALAR_MAP,
+ EVENT_VIEW_OBJECT_SLICES,
+ EVENT_VIEW_OBJECT_VECTOR_FIELD,
// these ones forward actions to workspace (and then to python console)
EVENT_ADD_DATASOURCE,
EVENT_ADD_IMAGE_AS_DATASOURCE,
void OnAddImagesource();
void OnExpandField();
void OnVisualizeScalarMap();
+ void OnVisualizeContour();
+ void OnVisualizeVectorField();
+ void OnVisualizeSlices();
+ void OnVisualizeDeflectionShape();
+ void OnVisualizePointSprite();
void OnUseInWorkspace();
void OnChangeUnderlyingMesh();
void OnInterpolateField();
<name>DatasourceController</name>
<message>
<source>MEDPresentationScalarMap</source>
- <translation>Scalar Map</translation>
+ <translation>Scalar map</translation>
+ </message>
+ <message>
+ <source>MEDPresentationContour</source>
+ <translation>Contour</translation>
+ </message>
+ <message>
+ <source>MEDPresentationVectorField</source>
+ <translation>Vector field</translation>
+ </message>
+ <message>
+ <source>MEDPresentationSlices</source>
+ <translation>Slices</translation>
+ </message>
+ <message>
+ <source>MEDPresentationDeflectionShape</source>
+ <translation>Deflection shape</translation>
+ </message>
+ <message>
+ <source>MEDPresentationPointSprite</source>
+ <translation>Point sprite</translation>
</message>
<message>
<location filename="MEDCALC/gui/DatasourceController.cxx" line="45"/>
<source>LAB_VISUALIZE_SCALARMAP</source>
<translation>Scalar map</translation>
</message>
+ <message>
+ <source>LAB_VISUALIZE_CONTOUR</source>
+ <translation>Contour</translation>
+ </message>
+ <message>
+ <source>LAB_VISUALIZE_VECTORFIELD</source>
+ <translation>Vector field</translation>
+ </message>
+ <message>
+ <source>LAB_VISUALIZE_SLICES</source>
+ <translation>Slices</translation>
+ </message>
+ <message>
+ <source>LAB_VISUALIZE_DEFLECTIONSHAPE</source>
+ <translation>Deflection shape</translation>
+ </message>
+ <message>
+ <source>LAB_VISUALIZE_POINTSPRITE</source>
+ <translation>Point sprite</translation>
+ </message>
<message>
<location filename="MEDCALC/gui/DatasourceController.cxx" line="69"/>
<source>LAB_VISUALIZE</source>
<source>MEDPresentationScalarMap</source>
<translation>Carte scalaire</translation>
</message>
+ <message>
+ <source>MEDPresentationContour</source>
+ <translation>Contour</translation>
+ </message>
+ <message>
+ <source>MEDPresentationVectorField</source>
+ <translation>Champ de vecteurs</translation>
+ </message>
+ <message>
+ <source>MEDPresentationSlices</source>
+ <translation>Coupes</translation>
+ </message>
+ <message>
+ <source>MEDPresentationDeflectionShape</source>
+ <translation>Déformée</translation>
+ </message>
+ <message>
+ <source>MEDPresentationPointSprite</source>
+ <translation>Point Sprite</translation>
+ </message>
<message>
<location filename="MEDCALC/gui/DatasourceController.cxx" line="45"/>
<source>LAB_ADD_DATA_SOURCE</source>
<source>LAB_VISUALIZE_SCALARMAP</source>
<translation>Carte scalaire</translation>
</message>
+ <message>
+ <source>LAB_VISUALIZE_CONTOUR</source>
+ <translation>Contour</translation>
+ </message>
+ <message>
+ <source>LAB_VISUALIZE_VECTORFIELD</source>
+ <translation>Champ de vecteurs</translation>
+ </message>
+ <message>
+ <source>LAB_VISUALIZE_SLICES</source>
+ <translation>Coupes</translation>
+ </message>
+ <message>
+ <source>LAB_VISUALIZE_DEFLECTIONSHAPE</source>
+ <translation>Déformée</translation>
+ </message>
+ <message>
+ <source>LAB_VISUALIZE_POINTSPRITE</source>
+ <translation>Point sprite</translation>
+ </message>
<message>
<location filename="MEDCALC/gui/DatasourceController.cxx" line="69"/>
<source>LAB_VISUALIZE</source>
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-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
_consoleDriver->exec(commands);
}
+QString
+WorkspaceController::_getViewMode() {
+#define stringify( name ) # name
+
+ QString viewMode = stringify(MEDCALC::VIEW_MODE_NEW_LAYOUT); // :TODO: change this (get value from dedicated dialog)
+ viewMode.replace("::", ".");
+
+ return viewMode;
+}
+
/**
* This slot can process the event coming from the
* DatasourceController. The connection between the datasource signal
QCHARSTAR(event->objectalias));
}
else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_SCALAR_MAP ) {
- QStringList commands;
-
-#define stringify( name ) # name
- QString viewMode = stringify(MEDCALC::VIEW_MODE_NEW_LAYOUT); // :TODO: change this (get value from dedicated dialog)
- viewMode.replace("::", ".");
-
+ QString viewMode = _getViewMode();
MEDCALC::FieldHandler* fieldHandler = dataObject->getFieldHandler();
+ QStringList commands;
commands += QString("medcalc.MakeScalarMap(accessField(%1), %2)").arg(fieldHandler->id).arg(viewMode);
_consoleDriver->exec(commands);
}
+ else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_CONTOUR ) {
+ QString viewMode = _getViewMode();
+ MEDCALC::FieldHandler* fieldHandler = dataObject->getFieldHandler();
+ QStringList commands;
+ commands += QString("medcalc.MakeContour(accessField(%1), %2)").arg(fieldHandler->id).arg(viewMode);
+ _consoleDriver->exec(commands);
+ }
+ else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_VECTOR_FIELD ) {
+ QString viewMode = _getViewMode();
+ MEDCALC::FieldHandler* fieldHandler = dataObject->getFieldHandler();
+ QStringList commands;
+ commands += QString("medcalc.MakeVectorField(accessField(%1), %2)").arg(fieldHandler->id).arg(viewMode);
+ _consoleDriver->exec(commands);
+ }
+ else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_SLICES ) {
+ QString viewMode = _getViewMode();
+ MEDCALC::FieldHandler* fieldHandler = dataObject->getFieldHandler();
+ QStringList commands;
+ commands += QString("medcalc.MakeSlices(accessField(%1), %2)").arg(fieldHandler->id).arg(viewMode);
+ _consoleDriver->exec(commands);
+ }
+ else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_DEFLECTION_SHAPE ) {
+ QString viewMode = _getViewMode();
+ MEDCALC::FieldHandler* fieldHandler = dataObject->getFieldHandler();
+ QStringList commands;
+ commands += QString("medcalc.MakeDeflectionShape(accessField(%1), %2)").arg(fieldHandler->id).arg(viewMode);
+ _consoleDriver->exec(commands);
+ }
+ else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_POINT_SPRITE ) {
+ QString viewMode = _getViewMode();
+ MEDCALC::FieldHandler* fieldHandler = dataObject->getFieldHandler();
+ QStringList commands;
+ commands += QString("medcalc.MakePointSprite(accessField(%1), %2)").arg(fieldHandler->id).arg(viewMode);
+ _consoleDriver->exec(commands);
+ }
else if ( event->eventtype == DatasourceEvent::EVENT_ADD_DATASOURCE ) {
QStringList commands;
commands += QString("medcalc.LoadDataSource('%1')").arg(event->objectalias);
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-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
void _saveItemList(QStringList itemNameIdList);
void _removeItemList(QStringList itemNameIdList);
void _viewItemList(QStringList itemNameIdList);
+ QString _getViewMode();
private:
XmedConsoleDriver * _consoleDriver;
-# Copyright (C) 2015 CEA/DEN, EDF R&D
+# Copyright (C) 2015, 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
# Presentations
from medpresentation import MakeScalarMap
-from medpresentation import MakeIsoSurface
+from medpresentation import MakeContour
from medpresentation import MakeVectorField
from medpresentation import MakeSlices
from medpresentation import MakeDeflectionShape
-# Copyright (C) 2011-2015 CEA/DEN, EDF R&D
+# 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
notifyGui_addPresentation(proxy.id, presentation_id)
#
-def MakeIsoSurface():
+def MakeContour(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
print "Not implemented yet"
+ #params = MEDCALC.ContourParameters(proxy.id, viewMode)
+ #presentation_id = __manager.makeContour(params)
+ #notifyGui_addPresentation(proxy.id, presentation_id)
#
-def MakeVectorField():
+def MakeVectorField(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
print "Not implemented yet"
+ #params = MEDCALC.VectorFieldParameters(proxy.id, viewMode)
+ #presentation_id = __manager.makeVectorField(params)
+ #notifyGui_addPresentation(proxy.id, presentation_id)
#
-def MakeSlices():
+def MakeSlices(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
print "Not implemented yet"
+ #params = MEDCALC.SlicesParameters(proxy.id, viewMode)
+ #presentation_id = __manager.makeSlices(params)
+ #notifyGui_addPresentation(proxy.id, presentation_id)
#
-def MakeDeflectionShape():
+def MakeDeflectionShape(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
print "Not implemented yet"
+ #params = MEDCALC.DeflectionShapeParameters(proxy.id, viewMode)
+ #presentation_id = __manager.makeDeflectionShape(params)
+ #notifyGui_addPresentation(proxy.id, presentation_id)
#
-def MakePointSprite():
+def MakePointSprite(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
print "Not implemented yet"
+ #params = MEDCALC.PointSpriteParameters(proxy.id, viewMode)
+ #presentation_id = __manager.makePointSprite(params)
+ #notifyGui_addPresentation(proxy.id, presentation_id)
#