Commit 8f84f387 authored by Will Schroeder's avatar Will Schroeder Committed by Kitware Robot

Merge topic 'EdgeConnected-SortedRegions'

53d8d0ef Added feature to sort output regions by area
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Roxana Bujack's avatarRoxana Bujack <bujack@lanl.gov>
Merge-request: !7686
parents b0cb0b15 53d8d0ef
Pipeline #216551 failed with stages
5f60a602614bea27fa648aa6b5dcd7dbd83d1f68857c608b1d3a8cc016c6f3cd99bc42447ace0c0970a1ce608125e66f67e0e251f22a65357769bdbdbb09fe18
5cb91bd88e9d444e8933210b23b7304da5445d08081755353554f0f41a07cb3512695d997b9d29055d680838ca9942285ab70901ca07d3479188f41212bef751
f6bcbca9b789f61a2df470277a019f40377de0efb0fd5181d92278adb55a3d20fc3a86912d2aa0dbe49a19731df02de3d63c79c885fbfbb8661a9dd095e9bf4b
57ab624eb8559ded31d97410889671ff85db91ef565f60e7aa337ca31ac1a67ee7f5ef65db383f49f8e7ba8783436a9c821aa6ed8cceb4c68a78019a3463d187
9c9d27d9ee2a156682404a80516f3c6b3edf97ad4d22e849d376843cf29a4b184763bc36f588d119c8e9b8b9458867ab334a5cd70e84782944275125433f82bd
......@@ -47,6 +47,7 @@ vtk_add_test_python(
TestPolyDataEdgeConnectivityFilter.py
TestPolyDataEdgeConnectivityFilter2.py
TestPolyDataEdgeConnectivityFilter3.py
TestPolyDataEdgeConnectivityFilter4.py
TestPolyDataPlaneClipper.py
TestPolyDataPlaneClipper2.py
TestPolyDataPlaneCutter.py
......
......@@ -61,7 +61,6 @@ tessMapper.SetInputConnection(conn.GetOutputPort())
tessMapper.ScalarVisibilityOn()
tessMapper.SetScalarModeToUseCellData()
tessMapper.SetScalarRange(0,conn.GetNumberOfExtractedRegions()-1)
tessMapper.SetScalarRange(0,5)
print("Num cells: ",conn.GetOutput().GetNumberOfCells())
print("Num regions: ",conn.GetNumberOfExtractedRegions())
......
......@@ -27,9 +27,9 @@ cs.Update()
# Create barrier edges
edges = vtk.vtkCellArray()
edge = [57,58]
edge = [68,69]
edges.InsertNextCell(2,edge)
edge = [58,59]
edge = [69,70]
edges.InsertNextCell(2,edge)
bedges = vtk.vtkPolyData()
......@@ -46,17 +46,21 @@ conn.BarrierEdgesOn()
conn.GrowLargeRegionsOff()
conn.SetExtractionModeToLargestRegion()
conn.SetExtractionModeToAllRegions()
#conn.SetExtractionModeToLargeRegions()
#conn.SetLargeRegionThreshold(0.075)
conn.ColorRegionsOn()
conn.CellRegionAreasOn()
conn.Update()
tessMapper = vtk.vtkPolyDataMapper()
tessMapper.SetInputConnection(conn.GetOutputPort())
#tessMapper.SetInputConnection(cs.GetOutputPort())
tessMapper.ScalarVisibilityOn()
tessMapper.SetScalarModeToUseCellData()
tessMapper.SetScalarRange(0,conn.GetNumberOfExtractedRegions()-1)
tessMapper.SetScalarRange(0,2) # Color just the top two regions
print("Num cells: ",conn.GetOutput().GetNumberOfCells())
print("Num regions: ",conn.GetNumberOfExtractedRegions())
print("Total area: ",conn.GetTotalArea())
tessActor = vtk.vtkActor()
tessActor.SetMapper(tessMapper)
......@@ -64,10 +68,21 @@ tessActor.GetProperty().SetColor(1,1,1)
tessActor.GetProperty().EdgeVisibilityOn()
tessActor.GetProperty().SetEdgeColor(0,0,0)
# For debugging
planeMapper = vtk.vtkPolyDataMapper()
planeMapper.SetInputConnection(cs.GetOutputPort())
planeMapper.ScalarVisibilityOn()
planeMapper.SetScalarModeToUseCellData()
planeMapper.SetScalarRange(cs.GetOutput().GetCellData().GetScalars().GetRange())
planeActor = vtk.vtkActor()
planeActor.SetMapper(planeMapper)
#planeActor.GetProperty().SetRepresentationToWireframe()
# Define graphics objects
ren1 = vtk.vtkRenderer()
ren1.SetBackground(0,0,0)
ren1.AddActor(tessActor)
#ren1.AddActor(planeActor)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
......
#!/usr/bin/env python
import sys
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Test the vtkPolyDataEdgeConnectivityFilter, in particular
# barrier edges combined with sorted regions.
# Construct a bounding array of points to improve the
# tessellation process.
plane = vtk.vtkPlaneSource()
plane.SetResolution(10,10)
plane.SetOrigin(-5,-5,0)
plane.SetPoint1(5,-5,0)
plane.SetPoint2(-5,5,0)
# Remove interior points
pedges = vtk.vtkFeatureEdges()
pedges.SetInputConnection(plane.GetOutputPort())
pedges.ExtractAllEdgeTypesOff()
pedges.BoundaryEdgesOn()
pedges.Update()
# Create some points in concentric circles.
disk = vtk.vtkDiskSource()
disk.SetInnerRadius(0.5)
disk.SetOuterRadius(1.0)
disk.SetRadialResolution(1)
disk.SetCircumferentialResolution(32)
disk.Update()
# Create some points in concentric circles.
disk2 = vtk.vtkDiskSource()
disk2.SetInnerRadius(2.0)
disk2.SetOuterRadius(3.5)
disk2.SetRadialResolution(1)
disk2.SetCircumferentialResolution(64)
disk2.Update()
# Append plane points and disk points.
append = vtk.vtkAppendPolyData()
append.AddInputData(pedges.GetOutput())
append.AddInputData(disk.GetOutput())
append.AddInputData(disk2.GetOutput())
append.Update()
# Tessellate
tess = vtk.vtkDelaunay2D()
tess.SetInputConnection(append.GetOutputPort())
tess.Update()
# Color via connected regions
conn = vtk.vtkPolyDataEdgeConnectivityFilter()
conn.SetInputConnection(tess.GetOutputPort());
conn.BarrierEdgesOn()
conn.GrowSmallRegionsOn()
conn.SetBarrierEdgeLength(0.0,0.35)
conn.SetExtractionModeToAllRegions()
conn.SetLargeRegionThreshold(0.25)
conn.ColorRegionsOn()
conn.CellRegionAreasOn()
conn.Update()
tessMapper = vtk.vtkPolyDataMapper()
tessMapper.SetInputConnection(conn.GetOutputPort())
tessMapper.ScalarVisibilityOn()
tessMapper.SetScalarModeToUseCellData()
tessMapper.SetScalarRange(0,2)
print("Num cells: ",conn.GetOutput().GetNumberOfCells())
print("Num regions: ",conn.GetNumberOfExtractedRegions())
tessActor = vtk.vtkActor()
tessActor.SetMapper(tessMapper)
tessActor.GetProperty().SetColor(1,1,1)
tessActor.GetProperty().SetEdgeColor(0,0,0)
# Define graphics objects
ren1 = vtk.vtkRenderer()
ren1.SetBackground(0,0,0)
ren1.AddActor(tessActor)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.Initialize()
iren.Start()
......@@ -34,7 +34,7 @@
#include "vtkStreamingDemandDrivenPipeline.h"
#include <algorithm> // for fill_n
#include <memory> //for unique_ptr
#include <numeric> //for iota
vtkStandardNewMacro(vtkPolyDataEdgeConnectivityFilter);
......@@ -74,6 +74,7 @@ vtkPolyDataEdgeConnectivityFilter::vtkPolyDataEdgeConnectivityFilter()
this->LargeRegionThreshold = 0.10;
this->ColorRegions = 1;
this->CellRegionAreas = 0;
this->OutputPointsPrecision = DEFAULT_PRECISION;
......@@ -107,6 +108,79 @@ vtkPolyData* vtkPolyDataEdgeConnectivityFilter::GetSource()
return vtkPolyData::SafeDownCast(this->GetExecutive()->GetInputData(1, 0));
}
//------------------------------------------------------------------------------
// Sort regions by ascending area. Also update the largest region id.
void vtkPolyDataEdgeConnectivityFilter::SortRegionsByArea()
{
// Setup the initial map
std::vector<vtkIdType> areaSort(this->NumberOfRegions);
std::iota(areaSort.begin(), areaSort.end(), 0);
// Now sort by area to produce a sorted list of regions.
std::vector<double>& regAreas = this->RegionAreas;
sort(areaSort.begin(), areaSort.end(),
[&](const vtkIdType& a, const vtkIdType& b) -> bool { return (regAreas[a] > regAreas[b]); });
// Create a region map that maps old region ids into new region ids.
std::vector<vtkIdType> regMap(this->NumberOfRegions);
for (auto i = 0; i < this->NumberOfRegions; ++i)
{
vtkIdType regId = areaSort[i];
regMap[regId] = i;
}
// Need to update the related region arrays. Copy the new information into
// temporary arrays, and then swap them with the "global" arrays.
// Update region ids associated with cells.
std::vector<vtkIdType> regionIds(this->RegionIds.size());
for (std::size_t i = 0; i < regionIds.size(); ++i)
{
regionIds[i] = regMap[this->RegionIds[i]];
}
// Update region classification and areas
std::vector<char> regionClassification(this->NumberOfRegions);
for (auto i = 0; i < this->NumberOfRegions; ++i)
{
regionClassification[i] = this->RegionClassification[areaSort[i]];
}
// Update the area of each region
std::vector<double> regionAreas(this->NumberOfRegions);
for (auto i = 0; i < this->NumberOfRegions; ++i)
{
regionAreas[i] = this->RegionAreas[areaSort[i]];
}
// Update the size of each region.
vtkNew<vtkIdTypeArray> regionSizes;
regionSizes->SetNumberOfTuples(this->RegionSizes->GetNumberOfTuples());
for (auto i = 0; i < this->NumberOfRegions; ++i)
{
regionSizes->SetTuple1(i, this->RegionSizes->GetValue(areaSort[i]));
}
// Okay replace global arrays with the local, renumbered arrays.
this->RegionIds.swap(regionIds);
this->RegionClassification.swap(regionClassification);
this->RegionAreas.swap(regionAreas);
this->RegionSizes = regionSizes;
}
//------------------------------------------------------------------------------
// Determine the number of non-zero-area regions. This is assumed to take place
// after the region sort by area occurs. Whether an region is non-zero is determined
// by a threshold against the total area.
vtkIdType vtkPolyDataEdgeConnectivityFilter::FindNumberOfExtractedRegions()
{
vtkIdType regionNum = 0, numSizes = this->RegionSizes->GetNumberOfTuples();
while (regionNum < numSizes && this->RegionSizes->GetValue(regionNum) > 0)
{
regionNum++;
}
return regionNum;
}
//------------------------------------------------------------------------------
int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(request),
vtkInformationVector** inputVector, vtkInformationVector* outputVector)
......@@ -203,7 +277,7 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
// Initialize. Keep track of points and cells visited, and the region ids
// of the cells.
this->RegionIds.reserve(numCells);
this->RegionIds.resize(numCells);
std::fill_n(this->RegionIds.begin(), numCells, (-1));
this->PointMap.reserve(numPts);
......@@ -236,6 +310,7 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
this->NumberOfPoints = 0;
this->NumberOfRegions = 0;
this->NumberOfExtractedRegions = 0;
maxCellsInRegion = 0;
this->CellIds = vtkSmartPointer<vtkIdList>::New();
......@@ -332,19 +407,15 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
vtkDebugMacro(<< "Identified " << this->NumberOfRegions << " region(s)");
// Optionally, assimilate small regions into bigger regions.
if (this->ExtractionMode == VTK_EXTRACT_LARGE_REGIONS || this->RegionGrowing == LargeRegions ||
this->RegionGrowing == SmallRegions)
// Sort regions based on their area.
this->TotalArea = this->ComputeRegionAreas();
if (this->RegionGrowing == LargeRegions)
{
this->ComputeRegionAreas();
if (this->RegionGrowing == LargeRegions)
{
this->GrowLargeRegions();
}
else if (this->RegionGrowing == SmallRegions)
{
this->GrowSmallRegions();
}
this->GrowLargeRegions();
}
else if (this->RegionGrowing == SmallRegions)
{
this->GrowSmallRegions();
}
// Now that points and cells have been marked, traverse these lists pulling
......@@ -363,6 +434,25 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
}
}
// if producing region areas, create the appropriate cell data
vtkSmartPointer<vtkFloatArray> regionAreas;
if (this->CellRegionAreas)
{
regionAreas = vtkSmartPointer<vtkFloatArray>::New();
regionAreas->SetName("CellRegionArea");
regionAreas->Allocate(numCells);
outputCD->AddArray(regionAreas);
}
// Remap the region ids so that region 0 is the largest region
// (by area), and so on. This requires also updating additional information
// such as RegionAreas, RegionSizes, and RegionClassification.
this->SortRegionsByArea();
largestRegionId = 0; // due to sort
// After the sort, update the number of non-zero-area regions.
this->NumberOfExtractedRegions = this->FindNumberOfExtractedRegions();
// if coloring regions; send down new scalar data
vtkSmartPointer<vtkIdTypeArray> cellRegionIds;
if (this->ColorRegions)
......@@ -374,7 +464,7 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
outputCD->SetActiveAttribute(idx, vtkDataSetAttributes::SCALARS);
}
// Set up
// Prepare to produce output
output->SetPoints(newPts);
if ((n = input->GetPolys()->GetNumberOfCells()) > 0)
{
......@@ -405,6 +495,10 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
{
cellRegionIds->InsertValue(newCellId, this->RegionIds[cellId]);
}
if (regionAreas != nullptr)
{
regionAreas->InsertValue(newCellId, this->RegionAreas[this->RegionIds[cellId]]);
}
}
}
}
......@@ -438,6 +532,10 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
{
cellRegionIds->InsertValue(newCellId, this->RegionIds[cellId]);
}
if (regionAreas != nullptr)
{
regionAreas->InsertValue(newCellId, this->RegionAreas[this->RegionIds[cellId]]);
}
}
}
}
......@@ -461,6 +559,10 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
{
cellRegionIds->InsertValue(newCellId, this->RegionIds[cellId]);
}
if (regionAreas != nullptr)
{
regionAreas->InsertValue(newCellId, this->RegionAreas[this->RegionIds[cellId]]);
}
}
}
}
......@@ -484,6 +586,10 @@ int vtkPolyDataEdgeConnectivityFilter::RequestData(vtkInformation* vtkNotUsed(re
{
cellRegionIds->InsertValue(newCellId, this->RegionIds[cellId]);
}
if (regionAreas != nullptr)
{
regionAreas->InsertValue(newCellId, this->RegionAreas[this->RegionIds[cellId]]);
}
}
}
}
......@@ -625,13 +731,6 @@ void vtkPolyDataEdgeConnectivityFilter::TraverseAndMark()
} // while wave is not empty
}
//------------------------------------------------------------------------------
// Obtain the number of connected regions.
int vtkPolyDataEdgeConnectivityFilter::GetNumberOfExtractedRegions()
{
return this->RegionSizes->GetMaxId() + 1;
}
//------------------------------------------------------------------------------
// Initialize list of point ids/cell ids used to seed regions.
void vtkPolyDataEdgeConnectivityFilter::InitializeSeedList()
......@@ -709,18 +808,14 @@ int vtkPolyDataEdgeConnectivityFilter::FillInputPortInformation(int port, vtkInf
//------------------------------------------------------------------------------
double vtkPolyDataEdgeConnectivityFilter::ComputeRegionAreas()
{
// Computer the area of each cell, and the total mesh area.
// Compute the area of each cell, and the total mesh area.
// Also accumulate the area of each region.
double totalArea = 0.0;
const vtkIdType numCells = this->Mesh->GetPolys()->GetNumberOfCells();
this->CellAreas.reserve(numCells);
this->RegionAreas.reserve(this->NumberOfRegions);
std::fill_n(this->RegionAreas.begin(), this->NumberOfRegions, 0.0);
this->RegionClassification.reserve(this->NumberOfRegions);
std::fill_n(this->RegionClassification.begin(), this->NumberOfRegions, SmallRegion);
this->CellAreas.resize(numCells, 0);
this->RegionAreas.resize(this->NumberOfRegions, 0.0);
this->RegionClassification.resize(this->NumberOfRegions, SmallRegion);
// Traverse polygons and compute area
double area, normal[3];
......@@ -754,6 +849,29 @@ double vtkPolyDataEdgeConnectivityFilter::ComputeRegionAreas()
return totalArea;
}
//------------------------------------------------------------------------------
// This method supports region growing. Basically it takes a neighboring cell
// that is initially assigned to one region, and assigns it to a new
// region. This also updates the region counts (i.e., number of cells) and
// the region areas.
void vtkPolyDataEdgeConnectivityFilter::ExchangeRegions(
vtkIdType regionId, vtkIdType neiId, vtkIdType neiRegionId)
{
// Exchange region counts
vtkIdType regionSize = this->RegionSizes->GetValue(regionId);
vtkIdType neiRegionSize = this->RegionSizes->GetValue(neiRegionId);
this->RegionSizes->SetValue(regionId, (regionSize + 1));
this->RegionSizes->SetValue(neiRegionId, (neiRegionSize - 1));
// Exchange area contributions
double neiArea = this->CellAreas[neiId];
this->RegionAreas[regionId] += neiArea;
this->RegionAreas[neiRegionId] -= neiArea;
// Finally exchange region assignments
this->RegionIds[neiId] = regionId;
}
//------------------------------------------------------------------------------
// Loop over cells, those in small regions are assigned to larger regions if they
// are "close" enough. This is iterative.
......@@ -803,7 +921,7 @@ void vtkPolyDataEdgeConnectivityFilter::GrowLargeRegions()
if (largeRegId >= 0)
{
somethingChanged = true;
this->RegionIds[cellId] = largeRegId;
this->ExchangeRegions(largeRegId, cellId, regId);
}
} // if in small region, or no region
} // for all candidates
......@@ -843,7 +961,7 @@ void vtkPolyDataEdgeConnectivityFilter::GrowSmallRegions()
for (auto i = 0; i < numIds; i++)
{
vtkIdType currentCellId = this->Wave[i];
vtkIdType currentRegionId = this->RegionIds[cellId];
vtkIdType currentRegionId = this->RegionIds[currentCellId];
// Check all edge neighbors
const vtkIdType* pts;
......@@ -859,15 +977,13 @@ void vtkPolyDataEdgeConnectivityFilter::GrowSmallRegions()
for (auto k = 0; k < numNeis; ++k)
{
vtkIdType neiId = this->CellNeighbors->GetId(k);
regId = this->RegionIds[neiId];
if (regId >= 0 && this->RegionClassification[regId] == SmallRegion &&
vtkIdType neiRegId = this->RegionIds[neiId];
if (neiRegId >= 0 && this->RegionClassification[neiRegId] == SmallRegion &&
smallVisited[neiId] == 0)
{
this->ExchangeRegions(currentRegionId, neiId, neiRegId);
this->Wave2.push_back(neiId);
this->RegionIds[neiId] = currentRegionId; // Now part of a new region
smallVisited[neiId] = 1;
vtkIdType regionSize = this->RegionSizes->GetValue(regId);
this->RegionSizes->SetValue(regId, (regionSize - 1));
} // if cell not yet visited
} // for all edge neighbors
} // for all edges of this cell
......@@ -977,6 +1093,7 @@ void vtkPolyDataEdgeConnectivityFilter::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "Large Region Threshold: " << this->LargeRegionThreshold << "\n";
os << indent << "Color Regions: " << (this->ColorRegions ? "On\n" : "Off\n");
os << indent << "Cell Region Areas: " << (this->CellRegionAreas ? "On\n" : "Off\n");
os << indent << "Output Points Precision: " << this->OutputPointsPrecision << "\n";
}
......@@ -31,7 +31,7 @@
* region(s) are to be extracted and output.
*
* The filter works in one of seven ways: 1) extract the largest (in terms of
* number of polygons) edge-connected region in the dataset; 2) extract
* total surface area) edge-connected region in the dataset; 2) extract
* specified regions; 3) extract all regions containing user-specified
* point ids; 4) extract all regions containing user-specified cell ids; 5)
* extract the region closest to a user-specified point; 6) extract all
......@@ -51,6 +51,11 @@
* added to the output cell attribute data by enabling ColorRegions.
*
* @warning
* If more than one output region is produced, regions are sorted based on
* their surface area. Thus region# 0 is the largest, followed by the next
* largest and so on.
*
* @warning
* To be clear: if scalar connectivity is enabled, this filter segments data
* based on *cell* attribute data based on edge-connected meshes. The similar
* vtkPolyDataConnectivityFilter segments based on point attribute data and
......@@ -288,20 +293,38 @@ public:
//@}
/**
* Obtain the number of connected regions found.
* Obtain the number of connected regions found. This returns valid
* information only after the filter has successfully executed.
*/
int GetNumberOfExtractedRegions() { return this->NumberOfExtractedRegions; }
/**
* Obtain the total area of all regions combined.
*/
int GetNumberOfExtractedRegions();
double GetTotalArea() { return this->TotalArea; }
//@{
/**
* Turn on/off the coloring of edge-connected regions. If enabled, then
* an array named "RegionId" is added to the output cell data.
* a array named "RegionId" is added to the output cell data. The array
* contains, for each cell, the id with which the cell is associated.
*/
vtkSetMacro(ColorRegions, vtkTypeBool);
vtkGetMacro(ColorRegions, vtkTypeBool);
vtkBooleanMacro(ColorRegions, vtkTypeBool);
//@}
//@{
/**
* Turn on/off the creation of a cell array that, for each cell, contains
* the area of the region to which the cell is associated. If enabled, then
* an array named "CellRegionArea" is added to the output cell data.
*/
vtkSetMacro(CellRegionAreas, vtkTypeBool);
vtkGetMacro(CellRegionAreas, vtkTypeBool);
vtkBooleanMacro(CellRegionAreas, vtkTypeBool);
//@}
//@{
/**
* Set/get the desired precision for the output types. See the documentation
......@@ -323,7 +346,9 @@ protected:
int FillInputPortInformation(int, vtkInformation*) override;
// Filter data members
vtkTypeBool ColorRegions; // boolean turns on/off scalar gen for separate regions
vtkTypeBool ColorRegions; // boolean turns on/off scalar generation for separate regions
vtkTypeBool CellRegionAreas; // for each cell, the area of the region the cell is associated with
int ExtractionMode; // how to extract regions
vtkTypeBool BarrierEdges; // enable barrier edges
double BarrierEdgeLength[2]; // edges of length within this range are barrier edges
......@@ -347,9 +372,13 @@ protected:
double LargeRegionThreshold;
int CurrentGrowPass; // region growing is a multiple-pass process
double ComputeRegionAreas();
void ExchangeRegions(vtkIdType currentRegionId, vtkIdType neiId, vtkIdType neiRegId);
void GrowLargeRegions();
void GrowSmallRegions();
int AssimilateCell(vtkIdType cellId, vtkIdType npts, const vtkIdType* pts);
void SortRegionsByArea();
vtkIdType FindNumberOfExtractedRegions();
double TotalArea; // the total area of the input mesh
std::vector<double> CellAreas; // the area of each polygonal cell
std::vector<double> RegionAreas; // the total area of each region
......@@ -359,6 +388,7 @@ protected:
std::vector<vtkIdType> RegionIds;
std::vector<vtkIdType> PointMap;
vtkIdType NumberOfRegions;
vtkIdType NumberOfExtractedRegions;
vtkIdType NumberOfPoints;
vtkIdType NumCellsInRegion;
vtkSmartPointer<vtkDataArray> InScalars;
......