]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Merge from master to omu/insitu.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 11 Aug 2016 15:28:50 +0000 (17:28 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 11 Aug 2016 15:28:50 +0000 (17:28 +0200)
20 files changed:
CMakeLists.txt
adm_local/CMakeLists.txt [deleted file]
adm_local/cmake_files/CMakeLists.txt [deleted file]
adm_local/cmake_files/FindSalomePARAVIS.cmake [deleted file]
src/Plugins/MEDReader/IO/CMakeLists.txt
src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx
src/Plugins/ParaMEDCorba/CMakeLists.txt
test/VisuPrs/bugs/A5.py
test/VisuPrs/bugs/C5.py
test/standalone/CMakeLists.txt
test/standalone/gui/CMakeLists.txt
test/standalone/gui/PLMainWindow.cxx
test/standalone/gui/PLMainWindow.hxx
test/standalone/gui/PLViewTab.cxx
test/standalone/gui/PLViewTab.hxx
test/standalone/gui/PVViewer_GUIElements.cxx
test/standalone/gui/main.cpp
test/standalone/gui/ui/light_para.ui
test/standalone/gui/ui/view_tab.ui
test/standalone/gui/xml/ParaViewFilters.xml [new file with mode: 0644]

index c4667a0a61b6275fef0d80cb38a00d2ae8c50f85..53ae344e81cac7bb31a22946465d883012937662 100644 (file)
@@ -27,6 +27,9 @@ ENDIF(WIN32)
 
 # Ensure a proper linker behavior:
 CMAKE_POLICY(SET CMP0003 NEW)
+IF(WIN32)
+  CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib 
+ENDIF(WIN32)
 
 # Versioning
 # ===========
@@ -40,12 +43,21 @@ SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
 SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
+# Common CMake macros
+# ===================
+SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
+IF(EXISTS ${CONFIGURATION_ROOT_DIR})
+  LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
+  INCLUDE(SalomeMacros)
+ELSE()
+  MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
+ENDIF()
+
 # Find KERNEL
 # ===========
 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
 IF(EXISTS ${KERNEL_ROOT_DIR})
   LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
-  INCLUDE(SalomeMacros)
   FIND_PACKAGE(SalomeKERNEL REQUIRED)
   ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
   INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
@@ -58,8 +70,6 @@ ENDIF(EXISTS ${KERNEL_ROOT_DIR})
 INCLUDE(SalomeSetupPlatform)   # From KERNEL
 # Always build libraries as shared objects:
 SET(BUILD_SHARED_LIBS TRUE)
-# Local macros:
-LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
 
 # User options
 # ============
@@ -263,7 +273,6 @@ SALOME_ACCUMULATE_ENVIRONMENT(PV_PLUGIN_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/lib
 # Sources
 # ========
 ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(adm_local)
 ADD_SUBDIRECTORY(resources)
 
 IF(SALOME_BUILD_DOC)
diff --git a/adm_local/CMakeLists.txt b/adm_local/CMakeLists.txt
deleted file mode 100644 (file)
index 60e5233..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2010-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
-#
-
-ADD_SUBDIRECTORY(cmake_files)
diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt
deleted file mode 100644 (file)
index 106ae10..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2010-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
-#
-
-SET(_adm_data
-  FindSalomePARAVIS.cmake
-  )
-
-INSTALL(FILES ${_adm_data} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL})
diff --git a/adm_local/cmake_files/FindSalomePARAVIS.cmake b/adm_local/cmake_files/FindSalomePARAVIS.cmake
deleted file mode 100644 (file)
index ec6b6b9..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# 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
-# 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
-#
-
-# PARAVIS detection for Salome - this is typically called by dependent modules
-# (PARAVIS, etc ...)
-#
-# The detection is simpler than for other prerequisites.
-# See explanation in FindSalomeKERNEL.cmake.
-#
-
-IF(NOT SalomePARAVIS_FIND_QUIETLY)
-  MESSAGE(STATUS "Looking for Salome PARAVIS ...")
-ENDIF()
-
-SET(CMAKE_PREFIX_PATH "${PARAVIS_ROOT_DIR}")
-SALOME_FIND_PACKAGE(SalomePARAVIS SalomePARAVIS CONFIG)
-
-IF(NOT SalomePARAVIS_FIND_QUIETLY)
-  MESSAGE(STATUS "Found Salome PARAVIS: ${PARAVIS_ROOT_DIR}")
-ENDIF()
-
-FOREACH(_res ${SalomePARAVIS_EXTRA_ENV})
-  SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomePARAVIS_EXTRA_ENV_${_res}}")
-ENDFOREACH()
\ No newline at end of file
index 853c885c422e7a06710d1a7c7bde4c21ad4cd3e9..474cbcd2491c126ff0ed9803a5d000c573225c98 100644 (file)
@@ -39,6 +39,8 @@ FOREACH(class ${MEDReader_CLASSES})
     SET(MEDReader_HDRS ${MEDReader_HDRS} ${class}.h)
 ENDFOREACH(class)
 
+SET(MEDReader_HDRS ${MEDReader_HDRS} MEDFileFieldRepresentationTree.hxx MEDTimeReq.hxx MEDUtilities.hxx MEDLoaderForPV.h)
+  
 ADD_LIBRARY(MEDLoaderForPV SHARED MEDFileFieldRepresentationTree.cxx MEDTimeReq.cxx MEDUtilities.cxx vtkGenerateVectors.cxx)
 
 IF(HDF5_IS_PARALLEL)
index afa6ca1e2f7aa5be58f562969dcdc6eb733e3161..540464cea1af7563cc70845f33df3cae59767bfb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2010-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
@@ -42,6 +42,7 @@
 #include "vtkInformationQuadratureSchemeDefinitionVectorKey.h"
 #include "vtkInformationIntegerKey.h"
 #include "vtkInformation.h"
+#include "vtkDataArrayTemplate.h"
 #include "vtkIdTypeArray.h"
 #include "vtkDoubleArray.h"
 #include "vtkIntArray.h"
@@ -51,7 +52,6 @@
 #include "vtkCellData.h"
 
 #include "vtkMutableDirectedGraph.h"
-#include "vtkDataArrayTemplate.h"
 
 using namespace MEDCoupling;
 
@@ -69,6 +69,8 @@ const char MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_NODE_NAME[]="Family
 
 const char MEDFileFieldRepresentationLeavesArrays::NUM_ID_NODE_NAME[]="NumIdNode";
 
+const char MEDFileFieldRepresentationLeavesArrays::GLOBAL_NODE_ID_NAME[]="GlobalNodeIds";// WARNING DO NOT CHANGE IT BEFORE HAVING CHECKED IN PV SOURCES !
+
 const char MEDFileFieldRepresentationTree::ROOT_OF_GRPS_IN_TREE[]="zeGrps";
 
 const char MEDFileFieldRepresentationTree::ROOT_OF_FAM_IDS_IN_TREE[]="zeFamIds";
@@ -176,6 +178,7 @@ vtkIdTypeArray *ELGACmp::createNew(const MEDCoupling::MEDFileFieldGlobsReal *glo
   _loc_names=locNames;
   _elgas=elgas;
   _defs.push_back(defs);
+  return elga;
 }
 
 void ELGACmp::appendELGAIfAny(vtkDataSet *ds) const
@@ -195,6 +198,49 @@ ELGACmp::~ELGACmp()
 
 //=
 
+template<class T>
+class MEDFileVTKTraits
+{
+public:
+  typedef void VtkType;
+  typedef void MCType;
+};
+
+template<>
+class MEDFileVTKTraits<int>
+{
+public:
+  typedef vtkIntArray VtkType;
+  typedef MEDCoupling::DataArrayInt MCType;
+};
+
+template<>
+class MEDFileVTKTraits<double>
+{
+public:
+  typedef vtkDoubleArray VtkType;
+  typedef MEDCoupling::DataArrayDouble MCType;
+};
+
+template<class T>
+void AssignDataPointerToVTK(typename MEDFileVTKTraits<T>::VtkType *vtkTab, typename MEDFileVTKTraits<T>::MCType *mcTab, bool noCpyNumNodes)
+{
+  if(noCpyNumNodes)
+    vtkTab->SetArray(mcTab->getPointer(),mcTab->getNbOfElems(),1,vtkDataArrayTemplate<T>::VTK_DATA_ARRAY_FREE);
+ else
+   { vtkTab->SetArray(mcTab->getPointer(),mcTab->getNbOfElems(),0,vtkDataArrayTemplate<T>::VTK_DATA_ARRAY_FREE); mcTab->accessToMemArray().setSpecificDeallocator(0); }
+}
+
+// here copy is always assumed.
+template<class VTKT, class MCT>
+void AssignDataPointerOther(VTKT *vtkTab, MCT *mcTab, int nbElems)
+{
+  vtkTab->SetVoidArray(reinterpret_cast<unsigned char *>(mcTab->getPointer()),nbElems,0,VTKT::VTK_DATA_ARRAY_FREE);
+  mcTab->accessToMemArray().setSpecificDeallocator(0);
+}
+
+//=
+
 MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays():_id(-1)
 {
 }
@@ -273,7 +319,6 @@ bool MEDFileFieldRepresentationLeavesArrays::setStatus(bool status) const
 
 void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshStruct *mst, vtkDataSet *ds) const
 {
-  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   const int VTK_DATA_ARRAY_DELETE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_DELETE;
   tr->setNumberOfTS((operator->())->getNumberOfTS());
   tr->initIterator();
@@ -331,14 +376,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr,
           vtkd->SetNumberOfComponents(vd->getNumberOfComponents());
           for(int i=0;i<vd->getNumberOfComponents();i++)
             vtkd->SetComponentName(i,vd->getInfoOnComponent(i).c_str());
-          if(postProcessedArr!=crudeArr)
-            {
-              vtkd->SetArray(vd->getPointer(),vd->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); vd->accessToMemArray().setSpecificDeallocator(0);
-            }
-          else
-            {
-              vtkd->SetArray(vd->getPointer(),vd->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-            }
+          AssignDataPointerToVTK<double>(vtkd,vd,postProcessedArr==crudeArr);
           std::string name(tr->buildName(f1ts->getName()));
           vtkd->SetName(name.c_str());
           att->AddArray(vtkd);
@@ -383,7 +421,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr,
                   vtkQuadratureSchemeDefinition *def(vtkQuadratureSchemeDefinition::New());
                   double *shape(new double[nbGaussPt*nbGaussPt]);
                   std::size_t dummy;
-                  const double *gsCoords(MEDCouplingFieldDiscretizationGaussNE::GetLocsFromGeometricType(ct,dummy));
+                  const double *gsCoords(MEDCouplingFieldDiscretizationGaussNE::GetRefCoordsFromGeometricType(ct,dummy));//GetLocsFromGeometricType
                   const double *refCoords(MEDCouplingFieldDiscretizationGaussNE::GetRefCoordsFromGeometricType(ct,dummy));
                   const double *weights(MEDCouplingFieldDiscretizationGaussNE::GetWeightArrayFromGeometricType(ct,dummy));
                   std::vector<double> gsCoords2(gsCoords,gsCoords+nbGaussPt*dim),refCoords2(refCoords,refCoords+nbGaussPt*dim);
@@ -411,14 +449,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr,
           vtkd->SetNumberOfComponents(vi->getNumberOfComponents());
           for(int i=0;i<vi->getNumberOfComponents();i++)
             vtkd->SetComponentName(i,vi->getVarOnComponent(i).c_str());
-          if(postProcessedArr!=crudeArr)
-            {
-              vtkd->SetArray(vi->getPointer(),vi->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); vi->accessToMemArray().setSpecificDeallocator(0);
-            }
-          else
-            {
-              vtkd->SetArray(vi->getPointer(),vi->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-            }
+          AssignDataPointerToVTK<int>(vtkd,vi,postProcessedArr==crudeArr);
           std::string name(tr->buildName(f1ts->getName()));
           vtkd->SetName(name.c_str());
           att->AddArray(vtkd);
@@ -632,7 +663,6 @@ void MEDFileFieldRepresentationLeaves::appendFields(const MEDTimeReq *tr, const
 
 vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationUnstructured(MEDUMeshMultiLev *mm) const
 {
-  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   DataArrayDouble *coordsMC(0);
   DataArrayByte *typesMC(0);
   DataArrayInt *cellLocationsMC(0),*cellsMC(0),*faceLocationsMC(0),*facesMC(0);
@@ -644,20 +674,20 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt
   int nbOfCells(typesSafe->getNbOfElems());
   vtkUnstructuredGrid *ret(vtkUnstructuredGrid::New());
   vtkUnsignedCharArray *cellTypes(vtkUnsignedCharArray::New());
-  cellTypes->SetArray(reinterpret_cast<unsigned char *>(typesSafe->getPointer()),nbOfCells,0,VTK_DATA_ARRAY_FREE); typesSafe->accessToMemArray().setSpecificDeallocator(0);
+  AssignDataPointerOther<vtkUnsignedCharArray,DataArrayByte>(cellTypes,typesSafe,nbOfCells);
   vtkIdTypeArray *cellLocations(vtkIdTypeArray::New());
-  cellLocations->SetVoidArray(cellLocationsSafe->getPointer(),nbOfCells,0,VTK_DATA_ARRAY_FREE); cellLocationsSafe->accessToMemArray().setSpecificDeallocator(0);
+  AssignDataPointerOther<vtkIdTypeArray,DataArrayInt>(cellLocations,cellLocationsSafe,nbOfCells);
   vtkCellArray *cells(vtkCellArray::New());
   vtkIdTypeArray *cells2(vtkIdTypeArray::New());
-  cells2->SetVoidArray(cellsSafe->getPointer(),cellsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); cellsSafe->accessToMemArray().setSpecificDeallocator(0);
+  AssignDataPointerOther<vtkIdTypeArray,DataArrayInt>(cells2,cellsSafe,cellsSafe->getNbOfElems());
   cells->SetCells(nbOfCells,cells2);
   cells2->Delete();
   if(faceLocationsMC!=0 && facesMC!=0)
     {
       vtkIdTypeArray *faces(vtkIdTypeArray::New());
-      faces->SetVoidArray(facesSafe->getPointer(),facesSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); facesSafe->accessToMemArray().setSpecificDeallocator(0);
+      AssignDataPointerOther<vtkIdTypeArray,DataArrayInt>(faces,facesSafe,facesSafe->getNbOfElems());
       vtkIdTypeArray *faceLocations(vtkIdTypeArray::New());
-      faceLocations->SetVoidArray(faceLocationsSafe->getPointer(),faceLocationsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); faceLocationsSafe->accessToMemArray().setSpecificDeallocator(0);
+      AssignDataPointerOther<vtkIdTypeArray,DataArrayInt>(faceLocations,faceLocationsSafe,faceLocationsSafe->getNbOfElems());
       ret->SetCells(cellTypes,cellLocations,cells,faceLocations,faces);
       faceLocations->Delete();
       faces->Delete();
@@ -670,13 +700,7 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt
   vtkPoints *pts(vtkPoints::New());
   vtkDoubleArray *pts2(vtkDoubleArray::New());
   pts2->SetNumberOfComponents(3);
-  if(!statusOfCoords)
-    {
-      pts2->SetArray(coordsSafe->getPointer(),coordsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE);
-      coordsSafe->accessToMemArray().setSpecificDeallocator(0);
-    }
-  else
-    pts2->SetArray(coordsSafe->getPointer(),coordsSafe->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
+  AssignDataPointerToVTK<double>(pts2,coordsSafe,statusOfCoords);
   pts->SetData(pts2);
   pts2->Delete();
   ret->SetPoints(pts);
@@ -687,7 +711,6 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt
 
 vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCartesian(MEDCoupling::MEDCMeshMultiLev *mm) const
 {
-  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   bool isInternal;
   std::vector< DataArrayDouble * > arrs(mm->buildVTUArrays(isInternal));
   vtkDoubleArray *vtkTmp(0);
@@ -704,10 +727,7 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte
   ret->SetDimensions(sizePerAxe[0],sizePerAxe[1],sizePerAxe[2]);
   vtkTmp=vtkDoubleArray::New();
   vtkTmp->SetNumberOfComponents(1);
-  if(isInternal)
-    vtkTmp->SetArray(arrs[0]->getPointer(),arrs[0]->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-  else
-    { vtkTmp->SetArray(arrs[0]->getPointer(),arrs[0]->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); arrs[0]->accessToMemArray().setSpecificDeallocator(0); }
+  AssignDataPointerToVTK<double>(vtkTmp,arrs[0],isInternal);
   ret->SetXCoordinates(vtkTmp);
   vtkTmp->Delete();
   arrs[0]->decrRef();
@@ -715,10 +735,7 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte
     {
       vtkTmp=vtkDoubleArray::New();
       vtkTmp->SetNumberOfComponents(1);
-      if(isInternal)
-        vtkTmp->SetArray(arrs[1]->getPointer(),arrs[1]->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-      else
-        { vtkTmp->SetArray(arrs[1]->getPointer(),arrs[1]->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); arrs[1]->accessToMemArray().setSpecificDeallocator(0); }
+      AssignDataPointerToVTK<double>(vtkTmp,arrs[1],isInternal);
       ret->SetYCoordinates(vtkTmp);
       vtkTmp->Delete();
       arrs[1]->decrRef();
@@ -727,10 +744,7 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte
     {
       vtkTmp=vtkDoubleArray::New();
       vtkTmp->SetNumberOfComponents(1);
-      if(isInternal)
-        vtkTmp->SetArray(arrs[2]->getPointer(),arrs[2]->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-      else
-        { vtkTmp->SetArray(arrs[2]->getPointer(),arrs[2]->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); arrs[2]->accessToMemArray().setSpecificDeallocator(0); }
+      AssignDataPointerToVTK<double>(vtkTmp,arrs[2],isInternal);
       ret->SetZCoordinates(vtkTmp);
       vtkTmp->Delete();
       arrs[2]->decrRef();
@@ -740,7 +754,6 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte
 
 vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCurveLinear(MEDCoupling::MEDCurveLinearMeshMultiLev *mm) const
 {
-  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   int meshStr[3]={1,1,1};
   DataArrayDouble *coords(0);
   std::vector<int> nodeStrct;
@@ -759,17 +772,11 @@ vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInter
   vtkDoubleArray *da(vtkDoubleArray::New());
   da->SetNumberOfComponents(3);
   if(coords->getNumberOfComponents()==3)
-    {
-      if(isInternal)
-        da->SetArray(coords->getPointer(),coords->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);//VTK has not the ownership of double * because MEDLoader main struct has it !
-      else
-        { da->SetArray(coords->getPointer(),coords->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); coords->accessToMemArray().setSpecificDeallocator(0); }
-    }
+    AssignDataPointerToVTK<double>(da,coords,isInternal);//if isIntenal==True VTK has not the ownership of double * because MEDLoader main struct has it !
   else
     {
       MCAuto<DataArrayDouble> coords2(coords->changeNbOfComponents(3,0.));
-      da->SetArray(coords2->getPointer(),coords2->getNbOfElems(),0,VTK_DATA_ARRAY_FREE);//let VTK deal with double *
-      coords2->accessToMemArray().setSpecificDeallocator(0);
+      AssignDataPointerToVTK<double>(da,coords2,false);//let VTK deal with double *
     }
   coords->decrRef();
   vtkPoints *points=vtkPoints::New();
@@ -782,7 +789,6 @@ vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInter
  
 vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDFileMeshes *meshes) const
 {
-  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   vtkDataSet *ret(0);
   //_fsp->isDataSetSupportEqualToThePreviousOne(i,globs);
   MCAuto<MEDMeshMultiLev> mml(_fsp->buildFromScratchDataSetSupport(0,globs));//0=timestep Id. Make the hypothesis that support does not change 
@@ -827,10 +833,7 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio
       vtkIntArray *vtkTab(vtkIntArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_CELL_NAME);
-      if(noCpyFamCells)
-        vtkTab->SetArray(famCells->getPointer(),famCells->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-      else
-        { vtkTab->SetArray(famCells->getPointer(),famCells->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); famCells->accessToMemArray().setSpecificDeallocator(0); }
+      AssignDataPointerToVTK<int>(vtkTab,famCells,noCpyFamCells);
       ret->GetCellData()->AddArray(vtkTab);
       vtkTab->Delete();
       famCells->decrRef();
@@ -841,10 +844,7 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio
       vtkIntArray *vtkTab(vtkIntArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::NUM_ID_CELL_NAME);
-      if(noCpyNumCells)
-        vtkTab->SetArray(numCells->getPointer(),numCells->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-      else
-        { vtkTab->SetArray(numCells->getPointer(),numCells->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); numCells->accessToMemArray().setSpecificDeallocator(0); }
+      AssignDataPointerToVTK<int>(vtkTab,numCells,noCpyNumCells);
       ret->GetCellData()->AddArray(vtkTab);
       vtkTab->Delete();
       numCells->decrRef();
@@ -858,10 +858,7 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio
       vtkIntArray *vtkTab(vtkIntArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_NODE_NAME);
-      if(noCpyFamNodes)
-        vtkTab->SetArray(famNodes->getPointer(),famNodes->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-      else
-        { vtkTab->SetArray(famNodes->getPointer(),famNodes->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); famNodes->accessToMemArray().setSpecificDeallocator(0); }
+      AssignDataPointerToVTK<int>(vtkTab,famNodes,noCpyFamNodes);
       ret->GetPointData()->AddArray(vtkTab);
       vtkTab->Delete();
       famNodes->decrRef();
@@ -872,14 +869,23 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio
       vtkIntArray *vtkTab(vtkIntArray::New());
       vtkTab->SetNumberOfComponents(1);
       vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::NUM_ID_NODE_NAME);
-      if(noCpyNumNodes)
-        vtkTab->SetArray(numNodes->getPointer(),numNodes->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);
-      else
-        { vtkTab->SetArray(numNodes->getPointer(),numNodes->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); numNodes->accessToMemArray().setSpecificDeallocator(0); }
+      AssignDataPointerToVTK<int>(vtkTab,numNodes,noCpyNumNodes);
       ret->GetPointData()->AddArray(vtkTab);
       vtkTab->Delete();
       numNodes->decrRef();
     }
+  // Global Node Ids if any ! (In // mode)
+  DataArrayInt *gni(ptMML2->retrieveGlobalNodeIdsIfAny());
+  if(gni)
+    {
+      vtkIntArray *vtkTab(vtkIntArray::New());
+      vtkTab->SetNumberOfComponents(1);
+      vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::GLOBAL_NODE_ID_NAME);
+      AssignDataPointerToVTK<int>(vtkTab,gni,false);
+      ret->GetPointData()->AddArray(vtkTab);
+      vtkTab->Delete();
+      gni->decrRef();
+    }
   return ret;
 }
 
@@ -988,7 +994,7 @@ void MEDFileFieldRepresentationTree::feedSIL(vtkMutableDirectedGraph* sil, vtkId
         }
     }
 }
+
 std::string MEDFileFieldRepresentationTree::getActiveMeshName() const
 {
   int dummy0(0),dummy1(0),dummy2(0);
@@ -1102,26 +1108,29 @@ int MEDFileFieldRepresentationTree::getMaxNumberOfTimeSteps() const
 /*!
  * 
  */
-
-void MEDFileFieldRepresentationTree::loadInMemory(MEDFileFields *fields, MEDFileMeshes *meshes)
+void MEDFileFieldRepresentationTree::loadInMemory(MEDCoupling::MEDFileFields *fields, MEDCoupling::MEDFileMeshes *meshes)
 {
-  _ms=meshes;  meshes->incrRef();
-  _fields=fields; fields->incrRef();
-  if(!((MEDCoupling::MEDFileFields *)fields))
+  _fields=fields; _ms=meshes;
+  if(_fields.isNotNull())
+    _fields->incrRef();
+  if(_ms.isNotNull())
+    _ms->incrRef();
+  //
+  if(_fields.isNull())
     {
-      fields=BuildFieldFromMeshes(meshes);
+      _fields=BuildFieldFromMeshes(_ms);
     }
   else
     {
-      AppendFieldFromMeshes(meshes,fields);
+      AppendFieldFromMeshes(_ms,_fields);
     }
-  meshes->cartesianizeMe();
-  fields->removeFieldsWithoutAnyTimeStep();
-  std::vector<std::string> meshNames(meshes->getMeshesNames());
+  _ms->cartesianizeMe();
+  _fields->removeFieldsWithoutAnyTimeStep();
+  std::vector<std::string> meshNames(_ms->getMeshesNames());
   std::vector< MCAuto<MEDFileFields> > fields_per_mesh(meshNames.size());
   for(std::size_t i=0;i<meshNames.size();i++)
     {
-      fields_per_mesh[i]=fields->partOfThisLyingOnSpecifiedMeshName(meshNames[i].c_str());
+      fields_per_mesh[i]=_fields->partOfThisLyingOnSpecifiedMeshName(meshNames[i].c_str());
     }
   std::vector< MCAuto<MEDFileAnyTypeFieldMultiTS > > allFMTSLeavesToDisplaySafe;
   std::size_t k(0);
@@ -1196,7 +1205,7 @@ void MEDFileFieldRepresentationTree::loadInMemory(MEDFileFields *fields, MEDFile
           for(std::size_t k=0;k<splitByMeshName[j].size();k++)
             sbmn[k]=splitByMeshName[j][k];
           //getMeshWithName does not return a newly allocated object ! It is a true get* method !
-          std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > commonSupSplit(MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(sbmn,meshes->getMeshWithName(meshNamesLoc[j].c_str()),fsp));
+          std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > commonSupSplit(MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(sbmn,_ms->getMeshWithName(meshNamesLoc[j].c_str()),fsp));
           std::vector< std::vector< MCAuto<MEDFileAnyTypeFieldMultiTS> > > commonSupSplitSafe(commonSupSplit.size());
           this->_data_structure[i][j].resize(commonSupSplit.size());
           for(std::size_t k=0;k<commonSupSplit.size();k++)
@@ -1217,29 +1226,30 @@ void MEDFileFieldRepresentationTree::loadInMemory(MEDFileFields *fields, MEDFile
   this->computeFullNameInLeaves();
 }
 
-
 void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts)
 {
+  MCAuto<MEDFileMeshes> ms;
+  MCAuto<MEDFileFields> fields;
   if(isMEDOrSauv)
     {
       if((iPart==-1 && nbOfParts==-1) || (iPart==0 && nbOfParts==1))
         {
-          _ms=MEDFileMeshes::New(fileName);
-          _fields=MEDFileFields::New(fileName,false);//false is important to not read the values
+          ms=MEDFileMeshes::New(fileName);
+          fields=MEDFileFields::New(fileName,false);//false is important to not read the values
         }
       else
         {
 #ifdef MEDREADER_USE_MPI
-          _ms=ParaMEDFileMeshes::New(iPart,nbOfParts,fileName);
-          int nbMeshes(_ms->getNumberOfMeshes());
+          ms=ParaMEDFileMeshes::New(iPart,nbOfParts,fileName);
+          int nbMeshes(ms->getNumberOfMeshes());
           for(int i=0;i<nbMeshes;i++)
             {
-              MEDCoupling::MEDFileMesh *tmp(_ms->getMeshAtPos(i));
+              MEDCoupling::MEDFileMesh *tmp(ms->getMeshAtPos(i));
               MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast<MEDCoupling::MEDFileUMesh *>(tmp));
               if(tmp2)
                 MCAuto<DataArrayInt> tmp3(tmp2->zipCoords());
             }
-          _fields=MEDFileFields::LoadPartOf(fileName,false,_ms);//false is important to not read the values
+          fields=MEDFileFields::LoadPartOf(fileName,false,ms);//false is important to not read the values
 #else
           std::ostringstream oss; oss << "MEDFileFieldRepresentationTree::loadMainStructureOfFile : request for iPart/nbOfParts=" << iPart << "/" << nbOfParts << " whereas Plugin not compiled with MPI !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
@@ -1250,21 +1260,20 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam
     {
       MCAuto<MEDCoupling::SauvReader> sr(MEDCoupling::SauvReader::New(fileName));
       MCAuto<MEDCoupling::MEDFileData> mfd(sr->loadInMEDFileDS());
-      _ms=mfd->getMeshes(); _ms->incrRef();
-      int nbMeshes(_ms->getNumberOfMeshes());
+      ms=mfd->getMeshes(); ms->incrRef();
+      int nbMeshes(ms->getNumberOfMeshes());
       for(int i=0;i<nbMeshes;i++)
         {
-          MEDCoupling::MEDFileMesh *tmp(_ms->getMeshAtPos(i));
+          MEDCoupling::MEDFileMesh *tmp(ms->getMeshAtPos(i));
           MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast<MEDCoupling::MEDFileUMesh *>(tmp));
           if(tmp2)
             tmp2->forceComputationOfParts();
         }
-      _fields=mfd->getFields();
-      if((MEDCoupling::MEDFileFields *)_fields)
-        _fields->incrRef();
+      fields=mfd->getFields();
+      if(fields.isNotNull())
+        fields->incrRef();
     }
-  //
-  loadInMemory(_fields,_ms);
+  loadInMemory(fields,ms);
 }
 
 void MEDFileFieldRepresentationTree::removeEmptyLeaves()
index 1c0280fc9ab810d253d3c5bf4602718a34c2b9f3..2d61a70fdc8cd85f320a2f75d8b8f3a0c7dce84e 100644 (file)
 PROJECT( ParaMEDCorba )
 
   CMAKE_MINIMUM_REQUIRED( VERSION 2.8.7 )
+  IF(WIN32)
+    CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib 
+  ENDIF(WIN32)
+
   ## !!! This definition corrupts wrapping process
   #SET( LIBRARY_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin CACHE INTERNAL "Single place for output" )
   #SET( EXECUTABLE_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin  CACHE INTERNAL "Single place for output" )
index d5af545e25554573be684a66c391134a831a6a90..357194dc985775b4b1b078b59369733bb8704fd8 100644 (file)
@@ -34,9 +34,10 @@ data_file = datadir + "TimeStamps.med"
 
 tmp_dir = os.getenv("TmpDir")
 if tmp_dir == None:
-    tmp_dir = "/tmp"
+  import tempfile
+  tmp_dir = tempfile.mkdtemp()
 
-save_file = tmp_dir + "/TimeStamps_save.hdf"
+save_file = os.path.join(tmp_dir, "TimeStamps_save.hdf")
 print "Save to file ", save_file
 
 pvsimple.OpenDataFile(data_file)
index d1e47240dcbe7406217ed391eb89a815b76ca124..f48af7b65b6f60f05d83399628a1542b0a75a886 100644 (file)
@@ -144,7 +144,8 @@ theDuration = 20
 NbOfLoops = 4
 #thePath = os.getenv("TMP_DIR")
 thePrefix = "TestPngFromAnim"
-thePath = os.path.join("/tmp", thePrefix)
+import tempfile
+thePath = os.path.join(tempfile.mkdtemp(), thePrefix)
 thePath += ".png"
 
 displayMng = DisplayManager()
index 5c48d05b58961582a0e31cb4ee39f8ca2fe711a9..86bf9f6c9d60e937ffee2bdb370ed1c6e0b82098 100644 (file)
@@ -20,6 +20,9 @@
 
 PROJECT(LightPARAVIS)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
+IF(WIN32)
+  CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib 
+ENDIF(WIN32)
 SET(CMAKE_BUILD_TYPE "Debug")
 
 OPTION(LIGHTPARAVIS_WITH_GUI "Build GUI test app" ON)
index a4b18ca2bcc8717bc6a61239a2e7eb2b60b369e6..20f62f86b6ea89f62bc8fec0b0c33e7ce1c8623a 100644 (file)
@@ -57,8 +57,8 @@ SET(ui_resources
   
 GENERATE_QT_RESOURCE_FROM_FILES(
     "${ui_resources}"
-    "/LightPara/Configuration"
-    "${PROJECT_SOURCE_DIR}/gui/xml/ParaViewReaders.xml")
+    "LightPara/Configuration"
+    "${PROJECT_SOURCE_DIR}/gui/xml/ParaViewReaders.xml;${PROJECT_SOURCE_DIR}/gui/xml/ParaViewFilters.xml")
 
 QT_ADD_RESOURCES(rcs_sources
     ${ui_resources}
index e2754985e3480d210d590a4817643e9a8f94d318..40b4e9ba2948db8e711b8d89e7bbbf36d2199313 100644 (file)
@@ -50,7 +50,8 @@ PLMainWindow::PLMainWindow(QWidget *parent) :
   QMainWindow(parent),
   _pAppC(0),
   _simplePipeline(),
-  _autoApply(true)
+  _autoApply(true),
+  _filterMenu(0)
 {
   _mainWindow.setupUi(this);
   _autoApply = _mainWindow.actionAuto_apply->isChecked();
@@ -63,25 +64,23 @@ PLMainWindow::PLMainWindow(QWidget *parent) :
 void PLMainWindow::finishUISetup()
 {
   _pAppC = PVViewer_Core::GetPVApplication();
-  PVViewer_GUIElements * pvgui = PVViewer_GUIElements::GetInstance(this);
-  QWidget * wprop = pvgui->getPropertiesPanel();
-  QWidget * wpipe = pvgui->getPipelineBrowserWidget();
+  _pvgui = PVViewer_GUIElements::GetInstance(this);
+
+  QWidget * wprop = _pvgui->getPropertiesPanel();
+  QWidget * wpipe = _pvgui->getPipelineBrowserWidget();
   wprop->setParent(_mainWindow.propFrame);
   _mainWindow.verticalLayoutProp->addWidget(wprop);
   wpipe->setParent(_mainWindow.pipelineFrame);
   _mainWindow.verticalLayoutPipe->addWidget(wpipe);
 
-  PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(this);
-//  pvge->setToolBarVisible(false);
-
   // In this mockup, we play on the parent widget visibility (a QFrame), so show these:
-  pvge->getPipelineBrowserWidget()->show();
-  pvge->getPropertiesPanel()->show();
+  _pvgui->getPipelineBrowserWidget()->show();
+  _pvgui->getPropertiesPanel()->show();
   // and hide these:
   _mainWindow.propFrame->hide();
   _mainWindow.pipelineFrame->hide();
-//  pvge->setToolBarEnabled(false);
-//  pvge->setToolBarVisible(false);
+//  _pvgui->setToolBarEnabled(false);
+//  _pvgui->setToolBarVisible(false);
 
 }
 
@@ -110,6 +109,19 @@ void PLMainWindow::showPipeline(bool isChecked)
   isChecked ? _mainWindow.pipelineFrame->show() : _mainWindow.pipelineFrame->hide();
 }
 
+void PLMainWindow::onBuildFilterMenu()
+{
+  if(_filterMenu == 0)
+    {
+      _filterMenu = _pvgui->getFiltersMenu();
+//      _filterMenu = new QMenu();
+      _filterMenu->setTitle("Filters");
+      this->menuBar()->addMenu(_filterMenu);
+    }
+  else
+    QMessageBox::warning(this, "Warning", "Filter menu already added!");
+}
+
 void PLMainWindow::addTab()
 {
   int c = _mainWindow.tabWidget->count();
@@ -120,6 +132,7 @@ void PLMainWindow::addTab()
   // Connect buttons
   QObject::connect(newTab, SIGNAL(onInsertSingleView(PLViewTab *)), this, SLOT(insertSingleView(PLViewTab *)));
   QObject::connect(newTab, SIGNAL(onInsertMultiView(PLViewTab *)), this, SLOT(insertMultiView(PLViewTab *)));
+  QObject::connect(newTab, SIGNAL(onInsertSpreadsheetView(PLViewTab *)), this, SLOT(insertSpreadsheetView(PLViewTab *)));
 }
 
 void PLMainWindow::deleteTab()
@@ -202,6 +215,26 @@ void PLMainWindow::insertSingleView(PLViewTab * tab)
   pqActiveObjects::instance().setActiveView(pqview);
 }
 
+void PLMainWindow::insertSpreadsheetView(PLViewTab * tab)
+{
+  // Create a new view proxy on the server
+  pqObjectBuilder* builder = _pAppC->getObjectBuilder();
+  pqServer* active_serv = pqActiveObjects::instance().activeServer();
+
+  std::cout << "About to create spreadsheet view ..." << std::endl;
+  pqView * pqview = builder->createView(QString("SpreadSheetView"), active_serv);
+  std::cout << "Created: " << pqview << "!" << std::endl;
+
+  // Retrieve its widget and pass it to the Qt tab:
+  QWidget* viewWidget = pqview->widget();
+
+//  QWidget* viewWidget = new QPushButton("toto");
+  tab->hideAndReplace(viewWidget, pqview);
+
+  pqActiveObjects::instance().setActiveView(pqview);
+}
+
+
 void PLMainWindow::insertMultiView(PLViewTab * tab)
 {
   // Retrieve TabbedMultiView and see if it is already attached to someone:
@@ -221,7 +254,6 @@ void PLMainWindow::insertMultiView(PLViewTab * tab)
     }
 }
 
-
 void PLMainWindow::doShrink()
 {
   if(!_simplePipeline.isEmpty())
index 91bd85a4f9935cf00bde98b747c3f2eb76156c92..727361cebaa2a50082de279bed67c4b960d91d8a 100644 (file)
@@ -31,6 +31,7 @@ class pqServer;
 class pqProxy;
 
 class PLViewTab;
+class PVViewer_GUIElements;
 
 /** Main window of the application.
  */
@@ -73,18 +74,25 @@ private slots:
 
   void insertSingleView(PLViewTab *);
   void insertMultiView(PLViewTab *);
+  void insertSpreadsheetView(PLViewTab *);
 
   void currentTabChanged(int);
 
+  void onBuildFilterMenu();
+
 private:
   Ui::MainWindow _mainWindow;
 
+  PVViewer_GUIElements * _pvgui;
+
   pqPVApplicationCore * _pAppC;
   //pqServer * _activeServer;
   //pqPipelineSource * _activeSource;  // last pipeline element
   QStack<pqPipelineSource *> _simplePipeline;
 
   bool _autoApply;
+
+  QMenu * _filterMenu;
 };
 
 #endif /* PLVIEWWIDGET_H_ */
index 9411d513e21fcca6c53c2ff1a5e4e00d42f3a578..1840d446c97e5a46f17156d45fbf67b18eb89661 100644 (file)
@@ -28,6 +28,11 @@ _renderView(0)
   _viewTab.setupUi(this);
 }
 
+void PLViewTab::insertSpreadsheetView()
+{
+  emit onInsertSpreadsheetView(this);
+}
+
 void PLViewTab::insertSingleView()
 {
   emit onInsertSingleView(this);
index 6ff4dac99bfde3f5d4b14c35f301184297c32253..75248dfe9e567856439b47e1dbe0a2b4081dde1c 100644 (file)
@@ -42,11 +42,13 @@ public:
 private slots:
   void insertSingleView();
   void insertMultiView();
+  void insertSpreadsheetView();
   void viewDestroyed();
 
 signals:
   void onInsertSingleView(PLViewTab *);
   void onInsertMultiView(PLViewTab *);
+  void onInsertSpreadsheetView(PLViewTab *);
 
 private:
   Ui::ViewTab _viewTab;
index 7daff83c77b3b6ccbed90d40bdbe9976cc36824b..23ea93481aedd4ddd63ef77b2d71494ad6eef69d 100644 (file)
@@ -70,7 +70,7 @@ PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desk) :
   macrosMenu = new QMenu(0);
   pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu);
 
-  //myBuildToolbars(desk);
+//  myBuildToolbars(desk);
 }
 
 PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(QMainWindow* desk)
index bcb3f303ee2d7b68ae401b93415ee35664867992..c7e3d08e258a941c36bfe22c9b336d558a701b3f 100644 (file)
@@ -58,8 +58,8 @@ int main(int argc, char ** argv)
 
   //para_widget->updateActiveServer();
 
-  //std::cout << "Load config ..." << std::endl;
-  //PVViewer_Core::ParaviewLoadConfigurations(QString(":/LightPara/Configuration/"));
+  std::cout << "Load config ..." << std::endl;
+  PVViewer_Core::ParaviewLoadConfigurations(QString(":/LightPara/Configuration"));
 
   /* Inspired from ParaView source code:
    * leave time for the GUI to update itself before displaying the main window: */
index 47c38e3aa81af6a1bccddcb2af877a0e8cc608ae..2c0e833b6d6780c3cd871e67bc163b0dd0c56a78 100644 (file)
     <addaction name="actionAuto_apply"/>
     <addaction name="actionShow_prop_widget"/>
     <addaction name="actionShow_pipeline"/>
+    <addaction name="actionBuild_filter_menu"/>
    </widget>
    <addaction name="menuFile"/>
    <addaction name="menuSimple_actions"/>
     <string>Show pipeline</string>
    </property>
   </action>
+  <action name="actionBuild_filter_menu">
+   <property name="text">
+    <string>Build filter menu</string>
+   </property>
+  </action>
  </widget>
  <resources/>
  <connections>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>actionBuild_filter_menu</sender>
+   <signal>triggered()</signal>
+   <receiver>MainWindow</receiver>
+   <slot>onBuildFilterMenu()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>504</x>
+     <y>338</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <signal>changedCurrentFile(QString)</signal>
   <slot>showPipeline(bool)</slot>
   <slot>showProp(bool)</slot>
   <slot>currentTabChanged(int)</slot>
+  <slot>onBuildFilterMenu()</slot>
  </slots>
 </ui>
index 67cae6a8ae08a5335ca11e03f81bafbf6b1cb9e0..2d001bdd69a9f1cf0bd8ff532b9067ffc7e9071d 100644 (file)
         </property>
        </widget>
       </item>
+      <item>
+       <widget class="QPushButton" name="spreadsheetViewButton">
+        <property name="text">
+         <string>Spreadsheet view</string>
+        </property>
+       </widget>
+      </item>
       <item>
        <spacer name="verticalSpacer">
         <property name="orientation">
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>spreadsheetViewButton</sender>
+   <signal>clicked()</signal>
+   <receiver>ViewTab</receiver>
+   <slot>insertSpreadsheetView()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>89</x>
+     <y>286</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>274</x>
+     <y>309</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>insertMultiView()</slot>
   <slot>insertSingleView()</slot>
+  <slot>insertSpreadsheetView()</slot>
  </slots>
 </ui>
diff --git a/test/standalone/gui/xml/ParaViewFilters.xml b/test/standalone/gui/xml/ParaViewFilters.xml
new file mode 100644 (file)
index 0000000..d1da9c3
--- /dev/null
@@ -0,0 +1,247 @@
+<ParaViewFilters>
+  <Category name="Common" menu_label="&amp;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="CosmoTools" menu_label="&amp;CosmoTools" show_in_toolbar="0">
+    <Proxy group="filters" name="ANLHaloFinder" />
+    <Proxy group="filters" name="ANLSubhaloFinder" />
+    <Proxy group="filters" name="LANLHaloFinder" />
+    <Proxy group="filters" name="MinkowskiFilter" />
+    <Proxy group="filters" name="PMergeConnected" />
+  </Category>
+
+  <Category name="DataAnalysis" menu_label="&amp;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"/>
+    <Proxy group="filters" name="TransposeTable" omit_from_toolbar="1"/>
+    <Proxy group="filters" name="ComputeQuartiles"
+            icon=":/pqWidgets/Icons/pqBoxChart16.png" omit_from_toolbar="1"/>
+    <Proxy group="filters" name="ExtractBagPlots"
+            icon=":/pqWidgets/Icons/pqFunctionalBagChart16.png" omit_from_toolbar="1"/>
+    <Proxy group="filters" name="ExtractLocation" omit_from_toolbar="1" />
+  </Category>
+
+  <Category name="Statistics" menu_label="&amp;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="&amp;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="&amp;Material Analysis">
+    <Proxy group="filters" name="MaterialInterfaceFilter" />
+    <Proxy group="filters" name="IntersectFragments" />
+  </Category>
+
+  <Category name="CTH" menu_label="&amp;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="AMRConnectivity" />
+    <Proxy group="filters" name="AMRFragmentIntegration" />
+    <Proxy group="filters" name="AMRFragmentsFilter"/>
+    <Proxy group="filters" name="ExtractHierarchicalLevel" />
+    <Proxy group="filters" name="ExtractHierarchicalDataSets" />
+  </Category>
+
+  <Category name="AMR" menu_label="&amp;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>
+
+  <Category name="Quadrature Points" menu_label="&amp;Quadrature Points">
+    <Proxy group="filters" name="QuadraturePointInterpolator" />
+    <Proxy group="filters" name="QuadraturePointsGenerator" />
+    <Proxy group="filters" name="QuadraturePointStatistics" />
+    <Proxy group="filters" name="QuadratureSchemeDictionaryGenerator" />
+  </Category>
+
+  <Category name="Annotation" menu_label="Annotation">
+    <Proxy group="filters" name="AnnotateGlobalData" />
+    <Proxy group="filters" name="AnnotateAttributeData" />
+    <Proxy group="filters" name="PythonAnnotation" />
+    <Proxy group="filters" name="TimeToTextConvertor" />
+    <Proxy group="filters" name="DataSetRegionSurfaceFilter" />
+    <Proxy group="filters" name="EnvironmentAnnotation" />
+  </Category>
+
+  <Proxy group="filters" name="AddFieldArrays" />
+  <Proxy group="filters" name="ImageDataToAMR" />
+  <Proxy group="filters" name="UniformGridPartitioner" />
+  <Proxy group="filters" name="Append" />
+  <Proxy group="filters" name="AppendAttributes" />
+  <Proxy group="filters" name="AppendPolyData" />
+  <Proxy group="filters" name="AngularPeriodicFilter" />
+  <Proxy group="filters" name="ArbitrarySourceStreamTracer" />
+  <Proxy group="filters" name="BlockIdScalars" />
+  <Proxy group="filters" name="RandomAttributeGenerator" />
+  <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="DataSetRegionSurfaceFilter" />
+  <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="ExtractComponent" />
+  <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="GlyphWithCustomSource" />
+  <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="LegacyGlyph" />
+  <!--  <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="ImageResampling" />
+  <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="PythonExtractSelection" />
+
+  <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="TensorGlyph" />
+  <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="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" />
+  <Proxy group="filters" name="SliceAlongPolyLine" />
+</ParaViewFilters>