SET(dist_salomeres_DATA
pqAppIcon22.png
pqAppIcon16.png
- ParaViewFilters.xml
- ParaViewReaders.xml
- ParaViewSources.xml
- ParaViewWriters.xml
)
SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVISCatalog.xml.in)
+++ /dev/null
-<ParaViewFilters>
- <Category name="Cosmology" menu_label="Cosmology">
- <Proxy group="filters" name="HaloFinder" />
- </Category>
-
- <Category name="Common" menu_label="&Common" preserve_order="1"
- show_in_toolbar="1">
- <Proxy group="filters" name="Calculator" icon=":/pqWidgets/Icons/pqCalculator24.png"/>
- <Proxy group="filters" name="Contour" icon=":/pqWidgets/Icons/pqIsosurface24.png"/>
- <Proxy group="filters" name="Clip" icon=":/pqWidgets/Icons/pqClip24.png"/>
- <Proxy group="filters" name="Cut" icon=":/pqWidgets/Icons/pqSlice24.png"/>
- <Proxy group="filters" name="Threshold" icon=":/pqWidgets/Icons/pqThreshold24.png"/>
- <Proxy group="filters" name="ExtractGrid" icon=":/pqWidgets/Icons/pqExtractGrid24.png"/>
- <Proxy group="filters" name="Glyph" icon=":/pqWidgets/Icons/pqGlyph24.png"/>
- <Proxy group="filters" name="StreamTracer" icon=":/pqWidgets/Icons/pqStreamTracer24.png"/>
- <Proxy group="filters" name="WarpVector" icon=":/pqWidgets/Icons/pqWarp24.png"/>
- <Proxy group="filters" name="GroupDataSets" icon=":/pqWidgets/Icons/pqGroup24.png"/>
- <Proxy group="filters" name="ExtractHierarchicalLevel" icon=":/pqWidgets/Icons/pqGroupExtract24.png"/>
- </Category>
-
- <Category name="DataAnalysis" menu_label="&Data Analysis" show_in_toolbar="1" hide_for_tests="1">
- <Proxy group="filters" name="Calculator"
- icon=":/pqWidgets/Icons/pqCalculator24.png" omit_from_toolbar="1"/>
- <Proxy group="filters" name="ExtractSelection"
- icon=":/pqWidgets/Icons/pqExtractSelection24.png" />
- <Proxy group="filters" name="ExtractSelectionOverTime"
- icon=":/pqWidgets/Icons/pqPlotSelectionOverTime24.png" />
- <Proxy group="filters" name="ExtractHistogram"
- icon=":/pqWidgets/Icons/pqHistogram24.png" omit_from_toolbar="1"/>
- <Proxy group="filters" name="IntegrateAttributes" omit_from_toolbar="1"/>
- <Proxy group="filters" name="ExtractFieldDataOverTime"
- icon=":/pqWidgets/Icons/pqPlotGlobalOverTime24.png" />
- <Proxy group="filters" name="ProbeLine"
- icon=":/pqWidgets/Icons/pqPlotOverLine24.png" />
- <Proxy group="filters" name="ProbePoint"
- icon=":/pqWidgets/Icons/pqProbeLocation24.png" />
- <Proxy group="filters" name="PlotAttributes" omit_from_toolbar="1"/>
- <Proxy group="filters" name="PlotOnSortedLines" omit_from_toolbar="1"/>
- <Proxy group="filters" name="PlotOnIntersectionCurves" omit_from_toolbar="1"/>
- <Proxy group="filters" name="ProgrammableFilter"
- icon=":/pqWidgets/Icons/pqProgrammableFilter24.png" omit_from_toolbar="1"/>
- </Category>
-
- <Category name="Statistics" menu_label="&Statistics">
- <Proxy group="filters" name="ContingencyStatistics"/>
- <Proxy group="filters" name="DescriptiveStatistics"/>
- <Proxy group="filters" name="KMeans"/>
- <Proxy group="filters" name="MulticorrelativeStatistics"/>
- <Proxy group="filters" name="PCAStatistics"/>
- </Category>
-
- <Category name="Temporal" menu_label="&Temporal">
- <Proxy group="filters" name="ParticleTracer" />
- <Proxy group="filters" name="ParticlePath" />
- <Proxy group="filters" name="StreakLine" />
- <Proxy group="filters" name="TemporalCache" />
- <Proxy group="filters" name="TemporalInterpolator" />
- <Proxy group="filters" name="TemporalSnapToTimeStep" />
- <Proxy group="filters" name="TemporalShiftScale" />
- <Proxy group="filters" name="TemporalStatistics" />
- <Proxy group="filters" name="TimeToTextConvertor" />
- </Category>
-
- <Category name="Material Analysis" menu_label="&Material Analysis">
- <Proxy group="filters" name="MaterialInterfaceFilter" />
- <Proxy group="filters" name="IntersectFragments" />
- </Category>
-
- <Category name="CTH" menu_label="&CTH">
- <Proxy group="filters" name="CTHFragmentConnect"/>
- <Proxy group="filters" name="CTHFragmentIntersect"/>
- <Proxy group="filters" name="CTHPart" />
- <Proxy group="filters" name="NonOverlappingLevelIdScalars" />
- <Proxy group="filters" name="MaterialInterfaceFilter" />
- <Proxy group="filters" name="AMRDualClip" />
- <Proxy group="filters" name="AMRDualContour" />
- <Proxy group="filters" name="ExtractHierarchicalLevel" />
- <Proxy group="filters" name="ExtractHierarchicalDataSets" />
- </Category>
-
- <Category name="AMR" menu_label="&AMR">
- <Proxy group="filters" name="AMRDualMeshExtractor" />
- <Proxy group="filters" name="AMRResampleFilter" />
- <Proxy group="filters" name="AMRSlice" />
- <Proxy group="filters" name="AMRToMultiBlock" />
- <Proxy group="filters" name="AMRCutPlane" />
- <Proxy group="filters" name="OverlappingLevelIdScalars" />
- <Proxy group="filters" name="ExtractHierarchicalLevel" />
- <Proxy group="filters" name="ExtractHierarchicalDataSets" />
- </Category>
-
- <Proxy group="filters" name="ImageDataToAMR" />
- <Proxy group="filters" name="UniformGridPartitioner" />
- <Proxy group="filters" name="AnnotateGlobalData" />
- <Proxy group="filters" name="Append" />
- <Proxy group="filters" name="AppendAttributes" />
- <Proxy group="filters" name="AppendPolyData" />
- <Proxy group="filters" name="ArbitrarySourceGlyph" />
- <Proxy group="filters" name="ArbitrarySourceStreamTracer" />
- <Proxy group="filters" name="BlockIdScalars" />
- <Proxy group="filters" name="BrownianPoints" />
- <Proxy group="filters" name="Calculator" />
- <Proxy group="filters" name="CellCenters" />
- <Proxy group="filters" name="CellDataToPointData" />
- <Proxy group="filters" name="CellDerivatives"/>
- <Proxy group="filters" name="CleanPolyData" />
- <Proxy group="filters" name="CleanUnstructuredGrid" />
- <Proxy group="filters" name="CleanUnstructuredGridCells" />
- <Proxy group="filters" name="Clip" />
- <Proxy group="filters" name="ClipClosedSurface" />
- <Proxy group="filters" name="Contour" />
- <Proxy group="filters" name="Curvatures" />
- <Proxy group="filters" name="Cut" />
- <Proxy group="filters" name="CutEverything" />
- <Proxy group="filters" name="D3" />
- <Proxy group="filters" name="DataSetSurfaceFilter" />
- <Proxy group="filters" name="DataSetTriangleFilter" />
- <Proxy group="filters" name="DecimatePro" />
- <Proxy group="filters" name="Delaunay2D" />
- <Proxy group="filters" name="Delaunay3D" />
- <Proxy group="filters" name="ElevationFilter" />
- <Proxy group="filters" name="ExtractBlock" />
- <Proxy group="filters" name="ExtractEdges" />
- <Proxy group="filters" name="ExtractGeometry" />
- <Proxy group="filters" name="ExtractGrid" />
- <Proxy group="filters" name="ExtractHistogram" />
- <Proxy group="filters" name="ExtractSelection" />
- <Proxy group="filters" name="ExtractSelectionOverTime" />
- <Proxy group="filters" name="FeatureEdges" />
- <Proxy group="filters" name="FFTSelectionOverTime" />
- <Proxy group="filters" name="GaussianSplatter"/>
- <Proxy group="filters" name="GenerateIdScalars"/>
- <Proxy group="filters" name="Glyph" />
- <Proxy group="filters" name="Gradient" />
- <Proxy group="filters" name="GridConnectivity" />
- <Proxy group="filters" name="GroupDataSets" />
- <Proxy group="filters" name="ImageDataToAMR" />
- <Proxy group="filters" name="ImageDataToPointSet" />
- <Proxy group="filters" name="IntegrateAttributes" />
- <Proxy group="filters" name="IntegrateFlowThroughSurface" />
- <!-- <Proxy group="filters" name="LevelIdScalars" /> -->
- <Proxy group="filters" name="LinearExtrusionFilter" />
- <Proxy group="filters" name="LoopSubdivisionFilter" />
- <Proxy group="filters" name="MaskPoints" />
- <Proxy group="filters" name="Median" />
- <Proxy group="filters" name="MergeBlocks" />
- <Proxy group="filters" name="MeshQuality" />
- <Proxy group="filters" name="OctreeDepthLimit" />
- <Proxy group="filters" name="OctreeDepthScalars" />
- <Proxy group="filters" name="OutlineCornerFilter" />
- <Proxy group="filters" name="OutlineFilter" />
- <Proxy group="filters" name="ParticlePathLines" />
- <Proxy group="filters" name="ParticleTracer" />
- <Proxy group="filters" name="PassArrays" />
- <Proxy group="filters" name="PlotAttributes" />
- <Proxy group="filters" name="PlotOnIntersectionCurves" />
- <Proxy group="filters" name="PlotOnSortedLines" />
- <Proxy group="filters" name="PointDataToCellData" />
- <Proxy group="filters" name="PolyDataNormals" />
- <Proxy group="filters" name="Probe" />
- <Proxy group="filters" name="ProbeLine" />
- <Proxy group="filters" name="ProbePoint" />
- <Proxy group="filters" name="ProcessIdScalars" />
- <Proxy group="filters" name="ProgrammableFilter" />
- <Proxy group="filters" name="PVConnectivityFilter" />
- <Proxy group="filters" name="PythonCalculator" />
- <Proxy group="filters" name="PythonAnnotation" />
- <Proxy group="filters" name="PythonExtractSelection" />
- <Proxy group="filters" name="QuadraturePointInterpolator" />
- <Proxy group="filters" name="QuadraturePointsGenerator" />
- <Proxy group="filters" name="QuadraturePointStatistics" />
- <Proxy group="filters" name="QuadratureSchemeDictionaryGenerator" />
- <Proxy group="filters" name="QuadricClustering" />
- <Proxy group="filters" name="RectilinearGridConnectivity" />
- <Proxy group="filters" name="RectilinearGridToPointSet" />
- <Proxy group="filters" name="ReflectionFilter" />
- <Proxy group="filters" name="RibbonFilter" />
- <Proxy group="filters" name="RotationalExtrusionFilter" />
- <Proxy group="filters" name="ScatterPlot"/>
- <Proxy group="filters" name="ShrinkFilter" />
- <Proxy group="filters" name="SmoothPolyDataFilter" />
- <Proxy group="filters" name="StreamTracer" />
- <Proxy group="filters" name="Stripper" />
- <Proxy group="filters" name="StructuredGridOutlineFilter" />
- <Proxy group="filters" name="Subdivide" />
- <Proxy group="filters" name="SurfaceVectors" />
- <Proxy group="filters" name="TemporalCache" />
- <Proxy group="filters" name="TemporalInterpolator" />
- <Proxy group="filters" name="TemporalSnapToTimeStep" />
- <Proxy group="filters" name="TemporalShiftScale" />
- <Proxy group="filters" name="TemporalStatistics" />
- <Proxy group="filters" name="TessellatorFilter" />
- <Proxy group="filters" name="TextureMapToCylinder" />
- <Proxy group="filters" name="TextureMapToPlane" />
- <Proxy group="filters" name="TextureMapToSphere" />
- <Proxy group="filters" name="Threshold" />
- <Proxy group="filters" name="TimeToTextConvertor" />
- <Proxy group="filters" name="TransformFilter" />
- <Proxy group="filters" name="TriangleFilter" />
- <Proxy group="filters" name="TubeFilter" />
- <Proxy group="filters" name="UnstructuredGradient" />
- <Proxy group="filters" name="WarpScalar" />
- <Proxy group="filters" name="WarpVector" />
- <Proxy group="filters" name="YoungsMaterialInterface"/>
- <Proxy group="filters" name="NormalGlyphs" />
- <Proxy group="filters" name="TableToPolyData" />
- <Proxy group="filters" name="TableToStructuredGrid" />
- <Proxy group="filters" name="IsoVolume" />
-
- <Proxy group="filters" name="GenericClip" />
- <Proxy group="filters" name="GenericContour" />
- <Proxy group="filters" name="GenericCut" />
- <Proxy group="filters" name="GenericStreamTracer" />
- <Proxy group="filters" name="GenericGeometryFilter" />
-</ParaViewFilters>
+++ /dev/null
-<ParaViewReaders>
- <!--
- NOTE: Readers are tried in reverse order that they are present in this
- list i.e. if two readers can read the same extension, then the reader
- apperaring later will be tried first when reading the file.
- -->
- <ProxyManager type="reader" />
- <Proxy group="sources" name="LSDynaReader" />
- <Proxy group="sources" name="PVDReader" />
- <Proxy group="sources" name="XMLHierarchicalBoxDataReader" />
- <Proxy group="sources" name="XMLPolyDataReader"/>
- <Proxy group="sources" name="XMLUnstructuredGridReader" />
- <Proxy group="sources" name="XMLImageDataReader" />
- <Proxy group="sources" name="XMLStructuredGridReader" />
- <Proxy group="sources" name="XMLRectilinearGridReader" />
- <Proxy group="sources" name="XMLPPolyDataReader" />
- <Proxy group="sources" name="XMLPUnstructuredGridReader" />
- <Proxy group="sources" name="XMLPImageDataReader" />
- <Proxy group="sources" name="XMLPStructuredGridReader" />
- <Proxy group="sources" name="XMLPRectilinearGridReader" />
- <Proxy group="sources" name="XMLMultiBlockDataReader" />
- <Proxy group="sources" name="XMLUniformGridAMRReader" />
- <Proxy group="sources" name="LegacyVTKFileReader" />
- <Proxy group="sources" name="pvtkfile" />
- <Proxy group="sources" name="ensight" />
- <Proxy group="sources" name="ensightMS" />
- <Proxy group="sources" name="TecplotReader" />
- <Proxy group="sources" name="netCDFReader" />
- <Proxy group="sources" name="byureader" />
- <Proxy group="sources" name="objreader" />
- <Proxy group="sources" name="ProStarReader" />
- <Proxy group="sources" name="XdmfReader" />
- <Proxy group="sources" name="pdbreader" />
- <Proxy group="sources" name="xyzreader" />
- <Proxy group="sources" name="P3DReader" />
- <Proxy group="sources" name="spcthreader" />
- <Proxy group="sources" name="SPCTHRestartReader" />
- <Proxy group="sources" name="spcthhistoryreader" />
- <Proxy group="sources" name="DEMReader" />
- <Proxy group="sources" name="vrmlreader" />
- <Proxy group="sources" name="plyreader" />
- <Proxy group="sources" name="stlreader" />
- <Proxy group="sources" name="gaussiancubereader" />
- <Proxy group="sources" name="ImageReader" />
- <Proxy group="sources" name="popreader"/>
- <Proxy group="sources" name="AVSucdSeriesReader" />
- <Proxy group="sources" name="MetaImageReader" />
- <Proxy group="sources" name="NrrdReader" />
- <Proxy group="sources" name="FacetReader" />
- <Proxy group="sources" name="PNGSeriesReader" />
- <Proxy group="sources" name="JPEGSeriesReader" />
- <Proxy group="sources" name="TIFFSeriesReader" />
- <Proxy group="sources" name="PhastaReader" />
- <Proxy group="sources" name="EnzoReader" />
- <Proxy group="sources" name="FlashReader" />
- <Proxy group="sources" name="SESAMEReader" />
- <Proxy group="sources" name="CSVReader" />
- <Proxy group="sources" name="MFIXReader" />
- <Proxy group="sources" name="FLUENTReader" />
- <Proxy group="sources" name="OpenFOAMReader" />
- <Proxy group="sources" name="CosmoReader" />
- <Proxy group="sources" name="SiloReader"/>
- <Proxy group="sources" name="ExodusIIReader" />
- <Proxy group="sources" name="ExodusRestartReader" />
- <Proxy group="sources" name="SLACReader" />
- <Proxy group="sources" name="SLACParticleReader" />
- <Proxy group="sources" name="ParticleReader" />
- <Proxy group="sources" name="VPICReader" />
- <Proxy group="sources" name="WindBladeReader" />
- <Proxy group="sources" name="NetCDFCAMReader" />
- <Proxy group="sources" name="NetCDFPOPReader" />
- <Proxy group="sources" name="UnstructuredPOPReader" />
- <Proxy group="sources" name="PNetCDFPOPReader" />
- <Proxy group="sources" name="MPASReader" />
- <Proxy group="sources" name="EnzoParticlesReader" />
- <Proxy group="sources" name="FlashParticlesReader" />
- <Proxy group="sources" name="CMLMoleculeReader"/>
-</ParaViewReaders>
+++ /dev/null
-<ParaViewSources>
- <Proxy group="sources" name="GlyphSource2D" />
- <Proxy group="sources" name="VectorText" />
- <Proxy group="sources" name="TimeToTextConvertorSource" />
- <Proxy group="sources" name="ArrowSource" />
- <Proxy group="sources" name="Axes" />
- <Proxy group="sources" name="CubeSource" />
- <Proxy group="sources" name="ConeSource" />
- <Proxy group="sources" name="CylinderSource" />
- <Proxy group="sources" name="DataObjectGenerator" />
- <Proxy group="sources" name="DiskSource" />
- <Proxy group="sources" name="HierarchicalFractal" />
- <Proxy group="sources" name="HyperTreeGridSource" />
- <Proxy group="sources" name="LineSource" />
- <Proxy group="sources" name="ImageMandelbrotSource" />
- <Proxy group="sources" name="OctreeFractal" />
- <Proxy group="sources" name="OutlineSource" />
- <Proxy group="sources" name="PlaneSource" />
- <Proxy group="sources" name="PointSource" />
- <Proxy group="sources" name="ProgrammableSource" />
- <Proxy group="sources" name="SphereSource" />
- <Proxy group="sources" name="SplineSource" />
- <Proxy group="sources" name="SuperquadricSource" />
- <Proxy group="sources" name="TextSource" />
- <Proxy group="sources" name="TimeSource" />
- <Proxy group="sources" name="Ruler" />
- <Proxy group="sources" name="RTAnalyticSource" />
- <Proxy group="sources" name="AMRGaussianPulseSource" />
-</ParaViewSources>
+++ /dev/null
-<ParaViewWriters>
- <ProxyManager type="writer" />
- <Proxy group="writers" name="XMLPVDWriter" />
- <Proxy group="writers" name="XMLHyperOctreeWriter" />
- <Proxy group="writers" name="XMLPolyDataWriter" />
- <Proxy group="writers" name="XMLUnstructuredGridWriter" />
- <Proxy group="writers" name="XMLStructuredGridWriter" />
- <Proxy group="writers" name="XMLRectilinearGridWriter" />
- <Proxy group="writers" name="XMLImageDataWriter" />
- <Proxy group="writers" name="XMLPPolyDataWriter" />
- <Proxy group="writers" name="XMLPUnstructuredGridWriter" />
- <Proxy group="writers" name="XMLPStructuredGridWriter" />
- <Proxy group="writers" name="XMLPRectilinearGridWriter"/>
- <Proxy group="writers" name="XMLPImageDataWriter" />
- <Proxy group="writers" name="XMLMultiBlockDataWriter" />
- <Proxy group="writers" name="XMLUniformGridAMRWriter" />
- <Proxy group="writers" name="DataSetWriter" />
- <Proxy group="writers" name="PDataSetWriter" />
- <Proxy group="writers" name="PPLYWriter" />
- <Proxy group="writers" name="PSTLWriter" />
- <Proxy group="writers" name="MetaImageWriter" />
- <Proxy group="writers" name="PNGWriter" />
- <Proxy group="writers" name="XdmfWriter"/>
- <Proxy group="writers" name="ExodusIIWriter" />
- <Proxy group="writers" name="EnSightWriter" />
- <Proxy group="writers" name="CSVWriter" />
- <Proxy group="writers" name="DataSetCSVWriter" />
-</ParaViewWriters>
#from SALOME_utilities import MESSAGE
def MESSAGE(m):
- os.system("echo \"%s\" >> /tmp/paravis_log.txt" % m)
+ pass
+ #os.system("echo \"%s\" >> /tmp/paravis_log.txt" % m)
class PARAVIS_Impl:
""" The core implementation (non CORBA, or Study related).
# header files / to be processed by moc
SET(_moc_HEADERS
PVGUI_Module.h
-# PVGUI_ViewManager.h
-# PVGUI_ViewModel.h
-# PVGUI_ViewWindow.h
+ PVGUI_DataModel.h
PVGUI_ParaViewSettingsPane.h
)
PVGUI_Module_widgets.cxx
PVGUI_Tools.cxx
PVGUI_ParaViewSettingsPane.cxx
+ PVGUI_DataModel.cxx
)
IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
--- /dev/null
+// Copyright (C) 2010-2014 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
+//
+// Author : Adrien Bruneton (CEA)
+//
+
+#include "PVGUI_DataModel.h"
+#include "PVGUI_Module.h"
+
+#include <iostream>
+#include <QFile>
+#include <QTextStream>
+
+PVGUI_DataModel::PVGUI_DataModel( PVGUI_Module* theModule ):
+ LightApp_DataModel(theModule)
+{}
+
+PVGUI_DataModel::~PVGUI_DataModel()
+{}
+
+bool PVGUI_DataModel::dumpPython( const QString& path, CAM_Study* std,
+ bool multiFile, QStringList& listOfFiles)
+{
+ QString tmpFile("/tmp/kikou.py");
+ listOfFiles.push_back(tmpFile);
+ QFile file(tmpFile);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return false;
+
+ //MESSAGE("[PARAVIS] dumpPython()")
+ PVGUI_Module * mod = (PVGUI_Module *) getModule();
+ QString trace(mod->getTraceString());
+
+ if (multiFile)
+ {
+ QStringList abuffer;
+ abuffer.push_back(QString("def RebuildData( theStudy ):"));
+ QStringList lst(trace.split("\n"));
+ foreach(QString elem, lst)
+ {
+ QString s = " " + elem;
+ abuffer.push_back(s);
+ }
+ abuffer.push_back(QString(" pass"));
+ trace = abuffer.join("\n");
+ }
+ QTextStream out(&file);
+ out << trace.toStdString().c_str() << "\n";
+ out.flush();
+ file.close();
+
+ std::cout << "@@@@@ wrote :\n" <<trace.toStdString().c_str()<< "\n";
+ return true;
+}
+
--- /dev/null
+// Copyright (C) 2010-2014 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
+//
+// Author : Adrien Bruneton (CEA)
+//
+
+#ifndef PVGUIDATAMODEL_H_
+#define PVGUIDATAMODEL_H_
+
+#include <LightApp_DataModel.h>
+
+#include <QObject>
+#include <QString>
+#include <QStringList>
+
+class PVGUI_Module;
+class CAM_Study;
+
+class PVGUI_DataModel: public LightApp_DataModel
+{
+ Q_OBJECT
+
+public:
+ PVGUI_DataModel( PVGUI_Module* theModule );
+ virtual ~PVGUI_DataModel();
+
+ virtual bool dumpPython( const QString&, CAM_Study*, bool, QStringList& );
+
+};
+
+#endif /* PVGUIDATAMODEL_H_ */
//
// File : PVGUI_Module.cxx
+#define PARAVIS_MODULE_NAME "PARAVIS"
+
#include <Standard_math.hxx> // E.A. must be included before Python.h to fix compilation on windows
#ifdef HAVE_FINITE
#undef HAVE_FINITE // VSR: avoid compilation warning on Linux : "HAVE_FINITE" redefined
#include "PVGUI_ParaViewSettingsPane.h"
#include "PVViewer_GUIElements.h"
#include "PVViewer_EngineWrapper.h"
+#include "PVGUI_DataModel.h"
// SALOME Includes
+#include <utilities.h>
#include <SUIT_DataBrowser.h>
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_NameDlg.h>
-#include <SalomeApp_Application.h>
+#include <LightApp_Application.h>
+#include <SalomeApp_Application.h> // should ultimately be a LightApp only
#include <SalomeApp_Study.h>
#include <SALOME_ListIO.hxx>
#include <SALOMEDS_Tool.hxx>
// TO REMOVE:
#include <PyInterp_Interp.h>
+#include <PVViewer_EngineWrapper.h>
+
//----------------------------------------------------------------------------
PVGUI_Module* ParavisModule = 0;
SALOME module wrapping ParaView GUI.
*/
-_PTR(SComponent)
-ClientFindOrCreateParavisComponent(_PTR(Study) theStudyDocument)
-{
- _PTR(SComponent) aSComponent = theStudyDocument->FindComponent("PARAVIS");
- if (!aSComponent) {
- _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
- aStudyBuilder->NewCommand();
- int aLocked = theStudyDocument->GetProperties()->IsLocked();
- if (aLocked) theStudyDocument->GetProperties()->SetLocked(false);
- aSComponent = aStudyBuilder->NewComponent("PARAVIS");
- _PTR(GenericAttribute) anAttr =
- aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName");
- _PTR(AttributeName) aName (anAttr);
-
- ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
- CORBA::ORB_var anORB = init( qApp->argc(), qApp->argv() );
-
- SALOME_NamingService *NamingService = new SALOME_NamingService( anORB );
- CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog");
- SALOME_ModuleCatalog::ModuleCatalog_var Catalogue =
- SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
- SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "PARAVIS" );
- if (!Comp->_is_nil()) {
- aName->SetValue(Comp->componentusername());
- }
-
- anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap");
- _PTR(AttributePixMap) aPixmap (anAttr);
- aPixmap->SetPixMap( "pqAppIcon16.png" );
-
- // Create Attribute parameters for future using
- anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeParameter");
-
- aStudyBuilder->DefineComponentInstance(aSComponent, PVGUI_Module::GetCPPEngine()->GetIOR());
- if (aLocked) theStudyDocument->GetProperties()->SetLocked(true);
- aStudyBuilder->CommitCommand();
- }
- return aSComponent;
-}
+//_PTR(SComponent)
+//ClientFindOrCreateParavisComponent(_PTR(Study) theStudyDocument)
+//{
+// _PTR(SComponent) aSComponent = theStudyDocument->FindComponent("PARAVIS");
+// if (!aSComponent) {
+// _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+// aStudyBuilder->NewCommand();
+// int aLocked = theStudyDocument->GetProperties()->IsLocked();
+// if (aLocked) theStudyDocument->GetProperties()->SetLocked(false);
+// aSComponent = aStudyBuilder->NewComponent("PARAVIS");
+// _PTR(GenericAttribute) anAttr =
+// aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName");
+// _PTR(AttributeName) aName (anAttr);
+//
+// ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+// CORBA::ORB_var anORB = init( qApp->argc(), qApp->argv() );
+//
+// SALOME_NamingService *NamingService = new SALOME_NamingService( anORB );
+// CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog");
+// SALOME_ModuleCatalog::ModuleCatalog_var Catalogue =
+// SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
+// SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "PARAVIS" );
+// if (!Comp->_is_nil()) {
+// aName->SetValue(Comp->componentusername());
+// }
+//
+// anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap");
+// _PTR(AttributePixMap) aPixmap (anAttr);
+// aPixmap->SetPixMap( "pqAppIcon16.png" );
+//
+// // Create Attribute parameters for future using
+// anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeParameter");
+//
+// aStudyBuilder->DefineComponentInstance(aSComponent, PVGUI_Module::GetCPPEngine()->GetIOR());
+// if (aLocked) theStudyDocument->GetProperties()->SetLocked(true);
+// aStudyBuilder->CommitCommand();
+// }
+// return aSComponent;
+//}
/*!
Clean up function; used to stop ParaView progress events when
\brief Constructor. Sets the default name for the module.
*/
PVGUI_Module::PVGUI_Module()
- : SalomeApp_Module( "PARAVIS" ),
+ : SalomeApp_Module( PARAVIS_MODULE_NAME ),
mySelectionControlsTb( -1 ),
mySourcesMenuId( -1 ),
myFiltersMenuId( -1 ),
delete myInitTimer;
}
-PARAVIS_ORB::PARAVIS_Gen_var PVGUI_Module::GetCPPEngine()
+PVViewer_EngineWrapper * PVGUI_Module::GetEngine()
{
- // initialize PARAVIS module engine (load, if necessary)
- if ( CORBA::is_nil( MyEngine ) ) {
- Engines::EngineComponent_var comp =
- SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "PARAVIS" );
- MyEngine = PARAVIS_ORB::PARAVIS_Gen::_narrow( comp );
- }
- return MyEngine;
+ return PVViewer_EngineWrapper::GetInstance();
}
+/*!
+ \brief Create data model.
+ \return module specific data model
+*/
+CAM_DataModel* PVGUI_Module::createDataModel()
+{
+ return new PVGUI_DataModel( this );
+}
+
pqPVApplicationCore * PVGUI_Module::GetPVApplication()
{
return PVViewer_ViewManager::GetPVApplication();
*/
void PVGUI_Module::initialize( CAM_Application* app )
{
- SalomeApp_Module::initialize( app );
+ LightApp_Module::initialize( app );
// Create ParaViS actions
createActions();
}
*/
- SalomeApp_Application* anApp = getApp();
+ LightApp_Application* anApp = getApp();
SUIT_Desktop* aDesktop = anApp->desktop();
// Initialize ParaView client and associated behaviors
// and connect to externally launched pvserver
- PVViewer_ViewManager::ParaviewInitApp(aDesktop);
+ PVViewer_ViewManager::ParaviewInitApp(aDesktop, anApp->logWindow());
myGuiElements = PVViewer_GUIElements::GetInstance(aDesktop);
// Remember current state of desktop toolbars
updateMacros();
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
- bool isStop = aResourceMgr->booleanValue( "PARAVIS", "stop_trace", false );
+ bool isStop = aResourceMgr->booleanValue( PARAVIS_MODULE_NAME, "stop_trace", false );
if(!isStop)
{
// Start a timer to schedule asap:
*/
void PVGUI_Module::showView( bool toShow )
{
- SalomeApp_Application* anApp = getApp();
+ LightApp_Application* anApp = getApp();
PVViewer_ViewManager* viewMgr =
dynamic_cast<PVViewer_ViewManager*>( anApp->getViewManager( PVViewer_Viewer::Type(), false ) );
if ( !viewMgr ) {
- viewMgr = new PVViewer_ViewManager( anApp->activeStudy(), anApp->desktop() );
+ viewMgr = new PVViewer_ViewManager( anApp->activeStudy(), anApp->desktop(), anApp->logWindow() );
anApp->addViewManager( viewMgr );
connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
anApp, SLOT( onCloseView( SUIT_ViewManager* ) ) );
storeCommonWindowsState();
- bool isDone = SalomeApp_Module::activateModule( study );
+ bool isDone = LightApp_Module::activateModule( study );
if ( !isDone ) return false;
showView( true );
if ( myRecentMenuId != -1 ) menuMgr()->show(myRecentMenuId);
- ClientFindOrCreateParavisComponent(PARAVIS::GetCStudy(this));
+ //ClientFindOrCreateParavisComponent(PARAVIS::GetCStudy(this));
return isDone;
}
restoreCommonWindowsState();
- return SalomeApp_Module::deactivateModule( study );
+ return LightApp_Module::deactivateModule( study );
}
{
clearParaviewState();
- SalomeApp_Module::studyClosed(study);
+ LightApp_Module::studyClosed(study);
}
/*!
if(!studyDS) {
return;
}
-
- _PTR(SComponent) paravisComp =
- studyDS->FindComponent(GetCPPEngine()->ComponentDataType());
+
+ _PTR(SComponent) paravisComp =
+ studyDS->FindComponent(PARAVIS_MODULE_NAME);
if(!paravisComp) {
return;
}
}
/*!
- \brief Returns IOR of current engine
+\brief Returns IOR of current engine
*/
QString PVGUI_Module::engineIOR() const
{
- CORBA::String_var anIOR = GetCPPEngine()->GetIOR();
- return QString(anIOR.in());
+// CORBA::String_var anIOR = GetCPPEngine()->GetIOR();
+// return QString(anIOR.in());
+ return QString("");
}
/*!
{
// Paraview settings tab
int aParaViewSettingsTab = addPreference( tr( "TIT_PVIEWSETTINGS" ) );
- int aPanel = addPreference(QString(), aParaViewSettingsTab, LightApp_Preferences::UserDefined, "PARAVIS", "");
+ int aPanel = addPreference(QString(), aParaViewSettingsTab, LightApp_Preferences::UserDefined, PARAVIS_MODULE_NAME, "");
setPreferenceProperty(aPanel, "content", (qint64)(new PVGUI_ParaViewSettingsPane()));
// Paravis settings tab
int aParaVisSettingsTab = addPreference( tr( "TIT_PVISSETTINGS" ) );
- addPreference( tr( "PREF_STOP_TRACE" ), aParaVisSettingsTab, LightApp_Preferences::Bool, "PARAVIS", "stop_trace");
+ addPreference( tr( "PREF_STOP_TRACE" ), aParaVisSettingsTab, LightApp_Preferences::Bool, PARAVIS_MODULE_NAME, "stop_trace");
- addPreference( tr( "PREF_NO_EXT_PVSERVER" ), aParaVisSettingsTab, LightApp_Preferences::Bool, "PARAVIS", "no_ext_pv_server");
+ addPreference( tr( "PREF_NO_EXT_PVSERVER" ), aParaVisSettingsTab, LightApp_Preferences::Bool, PARAVIS_MODULE_NAME, "no_ext_pv_server");
int aSaveType = addPreference(tr( "PREF_SAVE_TYPE_LBL" ), aParaVisSettingsTab,
LightApp_Preferences::Selector,
- "PARAVIS", "savestate_type");
+ PARAVIS_MODULE_NAME, "savestate_type");
QList<QVariant> aIndices;
QStringList aStrings;
aIndices<<0<<1<<2;
*/
void PVGUI_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
{
- SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
-
+ LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
+
// Check if we are in Object Browser
SUIT_DataBrowser* ob = getApp()->objectBrowser();
bool isOBClient = (ob && theClient == ob->popupClientType());
aSelectionMgr->selectedObjects(aListIO);
if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) {
QString entry = QString(aListIO.First()->getEntry());
-
+
// Get active study
- SalomeApp_Study* activeStudy =
+ SalomeApp_Study* activeStudy =
dynamic_cast<SalomeApp_Study*>(getApp()->activeStudy());
if(!activeStudy) {
return;
}
- // Get SALOMEDS client study
+ // Get SALOMEDS client study
_PTR(Study) studyDS = activeStudy->studyDS();
if(!studyDS) {
return;
}
- QString paravisDataType(GetCPPEngine()->ComponentDataType());
- if(activeStudy && activeStudy->isComponent(entry) &&
+ QString paravisDataType(PARAVIS_MODULE_NAME);
+ if(activeStudy && activeStudy->isComponent(entry) &&
activeStudy->componentDataType(entry) == paravisDataType) {
// ParaViS module object
theMenu->addSeparator();
}
else {
// Try to get state object
- _PTR(SObject) stateSObj =
+ _PTR(SObject) stateSObj =
studyDS->FindObjectID(entry.toLatin1().constData());
if (!stateSObj) {
return;
}
-
+
// Check local id
_PTR(GenericAttribute) anAttr;
if (!stateSObj->FindAttribute(anAttr, "AttributeLocalID")) {
}
_PTR(AttributeLocalID) anID(anAttr);
-
+
if (anID->Value() == PVSTATEID) {
// Paraview state object
theMenu->addSeparator();
if(!studyDS) {
return;
}
-
+
_PTR(SComponent) paravisComp =
- studyDS->FindComponent(GetCPPEngine()->ComponentDataType());
+ studyDS->FindComponent(PARAVIS_MODULE_NAME);
if(!paravisComp) {
return;
}
void PVGUI_Module::onPushTraceTimer()
{
-// MESSAGE("onPushTraceTimer(): Pushing trace to engine...");
- GetCPPEngine()->PutPythonTraceStringToEngine(getTraceString().toStdString().c_str());
+ //MESSAGE("onPushTraceTimer(): Pushing trace to engine...");
+ GetEngine()->PutPythonTraceStringToEngine(getTraceString().toStdString().c_str());
}
/*!
class pqDataRepresentation;
class pqRepresentation;
class PVViewer_GUIElements;
+class PVViewer_EngineWrapper;
class PVGUI_Module : public SalomeApp_Module
{
virtual void initialize( CAM_Application* );
virtual void windows( QMap<int, int>& ) const;
- virtual QString engineIOR() const;
+ virtual QString engineIOR() const; // to be removed when becoming Light
void openFile(const char* theName);
void executeScript(const char *script);
virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
- // Get the unwrapped version of the engine - compare with PVViewer_EngineWrapper.
- inline static PARAVIS_ORB::PARAVIS_Gen_var GetCPPEngine();
+ inline static PVViewer_EngineWrapper * GetEngine();
inline static pqPVApplicationCore * GetPVApplication();
+ virtual CAM_DataModel* createDataModel();
+
public slots:
//void onImportFromVisu(QString theEntry);
#include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
-#include <SalomeApp_Application.h>
+#include <SalomeApp_Application.h> // should ultimately be a LightApp only
#include <LightApp_Application.h>
#include <QAction>
QMenu* PVGUI_Module::getMenu( const int id )
{
QMenu* res = 0;
- SalomeApp_Application* anApp = getApp();
+ //SalomeApp_Application* anApp = getApp();
+ LightApp_Application* anApp = getApp();
SUIT_Desktop* desk = anApp->desktop();
if ( desk ){
QtxActionMenuMgr* menuMgr = desk->menuMgr();
#include <QtxActionToolMgr.h>
#include <LightApp_Application.h>
-#include <SalomeApp_Application.h>
+#include <SalomeApp_Application.h> // // should ultimately be a LightApp only
#include <SUIT_Desktop.h>
#include <QApplication>
desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
+ desk->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
// Pipeline
QDockWidget* pipelineBrowserDock = new QDockWidget( tr( "TTL_PIPELINE_BROWSER" ), desk );
QWidget* informationWidgetFrame = new QWidget(informationDock);
informationWidgetFrame->setObjectName("informationWidgetFrame");
-
+
QVBoxLayout* verticalLayout_2 = new QVBoxLayout(informationWidgetFrame);
verticalLayout_2->setSpacing(0);
verticalLayout_2->setContentsMargins(0, 0, 0, 0);
myDockWidgets[informationDock] = true;
- desk->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
+
desk->tabifyDockWidget(informationDock, propertiesDock);
desk->tabifyDockWidget(propertiesDock, pipelineBrowserDock);
//propertiesDock->raise();
aProgress->setEnabled(true);
// Set up the dock window corners to give the vertical docks more room.
- desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
- desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
+// desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
+// desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
// Setup the default dock configuration ...
statisticsViewDock->hide();
// restoreCommonWindowsState() method, and at the moment of the ParaVis activation we call
// this method.
+ //LightApp_Application* anApp = getApp();
SalomeApp_Application* anApp = getApp();
if(!anApp)
return;
- int begin = SalomeApp_Application::WT_ObjectBrowser;
- int end = SalomeApp_Application::WT_NoteBook;
+// int begin = SalomeApp_Application::WT_ObjectBrowser;
+// int end = SalomeApp_Application::WT_NoteBook;
+ int begin = LightApp_Application::WT_ObjectBrowser;
+ int end = LightApp_Application::WT_User;
for( int i = begin; i <= end; i++ ) {
QWidget* wg = anApp->getWindow(i);
if(wg) {
*/
void PVGUI_Module::restoreCommonWindowsState() {
SalomeApp_Application* anApp = getApp();
+// LightApp_Application* anApp = getApp();
if(!anApp)
return;
DockWindowMap::const_iterator it = myCommonMap.begin();