From c419e3593040e98f6c6e177e77bca824e141cfab Mon Sep 17 00:00:00 2001 From: mgn Date: Fri, 21 Nov 2014 10:57:47 +0300 Subject: [PATCH] Added VTK_EXPORT macros to class. --- src/Plugins/DifferenceTimesteps/CMakeLists.txt | 4 ++-- .../DifferenceTimesteps.xml | 16 ++++++++++++++-- src/Plugins/DifferenceTimesteps/plugin.cmake | 3 +++ .../vtkDifferenceTimestepsFilter.cxx | 18 ++++++++++++++---- .../vtkDifferenceTimestepsFilter.h | 8 +++++--- 5 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 src/Plugins/DifferenceTimesteps/plugin.cmake diff --git a/src/Plugins/DifferenceTimesteps/CMakeLists.txt b/src/Plugins/DifferenceTimesteps/CMakeLists.txt index 0568f112..b3e47361 100644 --- a/src/Plugins/DifferenceTimesteps/CMakeLists.txt +++ b/src/Plugins/DifferenceTimesteps/CMakeLists.txt @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# Author : Maxim Glibin PROJECT(DifferenceTimesteps) @@ -31,7 +32,6 @@ ADD_PARAVIEW_PLUGIN(DifferenceTimesteps "1.0" GUI_RESOURCE_FILES DifferenceTimestepsGUI.xml ) -INSTALL( - TARGETS DifferenceTimesteps +INSTALL(TARGETS DifferenceTimesteps DESTINATION lib/paraview ) diff --git a/src/Plugins/DifferenceTimesteps/DifferenceTimesteps.xml b/src/Plugins/DifferenceTimesteps/DifferenceTimesteps.xml index 669b722b..e62195db 100644 --- a/src/Plugins/DifferenceTimesteps/DifferenceTimesteps.xml +++ b/src/Plugins/DifferenceTimesteps/DifferenceTimesteps.xml @@ -75,7 +75,7 @@ command="SetFirstTimeStepIndex" number_of_elements="1" default_values="0" - animateable="1" + animateable="0" information_property="RangeIndicesTimeStepsInfo"> @@ -113,12 +113,24 @@ command="SetArrayNamePrefix" number_of_elements="1" animateable="0" - default_values="diff_" > + default_values="diff_" + panel_visibility="advanced" > Prefix to a new array name. + + + + + + + + + + + diff --git a/src/Plugins/DifferenceTimesteps/plugin.cmake b/src/Plugins/DifferenceTimesteps/plugin.cmake new file mode 100644 index 00000000..686ebde6 --- /dev/null +++ b/src/Plugins/DifferenceTimesteps/plugin.cmake @@ -0,0 +1,3 @@ +pv_plugin(DifferenceTimesteps + DESCRIPTION "Compute difference between two time steps" + DEFAULT_ENABLED) diff --git a/src/Plugins/DifferenceTimesteps/vtkDifferenceTimestepsFilter.cxx b/src/Plugins/DifferenceTimesteps/vtkDifferenceTimestepsFilter.cxx index 9a8b3aa3..8cd7dafd 100644 --- a/src/Plugins/DifferenceTimesteps/vtkDifferenceTimestepsFilter.cxx +++ b/src/Plugins/DifferenceTimesteps/vtkDifferenceTimestepsFilter.cxx @@ -15,6 +15,8 @@ // 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 : Maxim Glibin #include "vtkDifferenceTimestepsFilter.h" @@ -213,7 +215,14 @@ int vtkDifferenceTimestepsFilter::RequestInformation( // Update range of indices of the time steps this->RangeIndicesTimeSteps[0] = 0; this->RangeIndicesTimeSteps[1] = this->NumberTimeSteps - 1; - + + /* + * RNV: Temporary commented: + * This piece of the code removes all time steps from the output object, + * but this leads to the strange side effect in the ParaView: time steps also disappears + * from the animation scene of the input (parent) object of this filter. + * Seems it is a bug of the ParaView, to be investigated ... + * // The output data of this filter has no time associated with it. // It is the result of computation difference between two time steps. // Unset the time steps @@ -223,7 +232,7 @@ int vtkDifferenceTimestepsFilter::RequestInformation( // Unset the time range if(anOutInfo->Has(vtkStreamingDemandDrivenPipeline::TIME_RANGE())) anOutInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE()); - + */ return 1; } @@ -416,12 +425,13 @@ vtkDataSet* vtkDifferenceTimestepsFilter::DifferenceDataSet(vtkDataSet* theInput anOutputArray = this->DifferenceDataArray(&anArrays[0], anArrays[0]->GetNumberOfTuples()); // Determine a field association - if (this->GetInputFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS) + int aTypeFieldAssociation = this->GetInputFieldAssociation(); + if (aTypeFieldAssociation == vtkDataObject::FIELD_ASSOCIATION_POINTS) { // For point data anOutput->GetPointData()->AddArray(anOutputArray); } - else if (this->GetInputFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_CELLS) + else if (aTypeFieldAssociation == vtkDataObject::FIELD_ASSOCIATION_CELLS) { // For cell data anOutput->GetCellData()->AddArray(anOutputArray); diff --git a/src/Plugins/DifferenceTimesteps/vtkDifferenceTimestepsFilter.h b/src/Plugins/DifferenceTimesteps/vtkDifferenceTimestepsFilter.h index df06db6f..12bbf63c 100644 --- a/src/Plugins/DifferenceTimesteps/vtkDifferenceTimestepsFilter.h +++ b/src/Plugins/DifferenceTimesteps/vtkDifferenceTimestepsFilter.h @@ -15,9 +15,11 @@ // 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 : Maxim Glibin -#ifndef __DifferenceTimestepsFilter_h -#define __DifferenceTimestepsFilter_h +#ifndef __DifferenceTimestepsFilter_h_ +#define __DifferenceTimestepsFilter_h_ #include @@ -143,4 +145,4 @@ private: bool VerifyArrays(vtkDataArray **theArrays, int theNumArrays); }; -#endif // __DifferenceTimestepsFilter_h +#endif // __DifferenceTimestepsFilter_h_ -- 2.39.2