Commit a634eb91 authored by Mathieu Westphal's avatar Mathieu Westphal

Adding a MergePoints option to slice filter

parent 59183e95
......@@ -6634,6 +6634,23 @@ array.
number_of_elements="1">
<BooleanDomain name="bool" />
<Documentation>This parameter controls whether to produce triangles in the output.</Documentation>
<Hints>
<PropertyWidgetDecorator type="ShowWidgetDecorator">
<Property name="PreserveInputCells" function="boolean_invert" />
</PropertyWidgetDecorator>
</Hints>
</IntVectorProperty>
<IntVectorProperty command="SetMergePoints"
default_values="1"
name="Merge duplicated points in the slice"
number_of_elements="1">
<BooleanDomain name="bool" />
<Documentation>This parameter controls whether to merge duplicated points in the slice.</Documentation>
<Hints>
<PropertyWidgetDecorator type="ShowWidgetDecorator">
<Property name="PreserveInputCells" function="boolean_invert" />
</PropertyWidgetDecorator>
</Hints>
</IntVectorProperty>
<DoubleVectorProperty animateable="1"
command="SetValue"
......@@ -6655,6 +6672,11 @@ array.
offset values. This can be used to create multiple slices with
different centers. Each entry represents a new slice with its center
shifted by the offset value.</Documentation>
<Hints>
<PropertyWidgetDecorator type="ShowWidgetDecorator">
<Property name="PreserveInputCells" function="boolean_invert" />
</PropertyWidgetDecorator>
</Hints>
</DoubleVectorProperty>
<Hints>
<Visibility replace_input="2" />
......
......@@ -20,7 +20,9 @@
#include "vtkExtractGeometry.h"
#include "vtkImplicitFunction.h"
#include "vtkInformation.h"
#include "vtkMergePoints.h"
#include "vtkNew.h"
#include "vtkNonMergingPointLocator.h"
#include "vtkObjectFactory.h"
#include "vtkSmartPointer.h"
......@@ -29,6 +31,8 @@ class vtkPVMetaSliceDataSet::vtkInternals
public:
vtkNew<vtkCutter> Cutter;
vtkNew<vtkExtractGeometry> ExtractCells;
vtkNew<vtkMergePoints> MergeLocator;
vtkNew<vtkNonMergingPointLocator> NonMergeLocator;
vtkInternals()
{
......@@ -103,3 +107,12 @@ void vtkPVMetaSliceDataSet::SetGenerateTriangles(int status)
this->Internal->Cutter->SetGenerateTriangles(status);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVMetaSliceDataSet::SetMergePoints(bool status)
{
this->Internal->Cutter->SetLocator(status
? static_cast<vtkPointLocator*>(this->Internal->MergeLocator.Get())
: this->Internal->NonMergeLocator.Get());
this->Modified();
}
......@@ -69,6 +69,11 @@ public:
*/
void SetGenerateTriangles(int status);
/**
* Expose method from vtkCutter
*/
void SetMergePoints(bool status);
protected:
vtkPVMetaSliceDataSet();
~vtkPVMetaSliceDataSet() override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment