Difference between revisions of "VTK/Examples/Cxx/PolyData/ClosedSurface"

From KitwarePublic
< VTK‎ | Examples‎ | Cxx
Jump to: navigation, search
 
Line 1: Line 1:
==ClosedSurface.cxx==
+
= '''See [https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ClosedSurface ClosedSurface] on the new [https://lorensen.github.io/VTKExamples/site/ VTKExamples website].''' =
<source lang="cpp">
 
#include <vtkSmartPointer.h>
 
#include <vtkSphereSource.h>
 
#include <vtkFeatureEdges.h>
 
 
 
int main(int, char *[])
 
{
 
  // Create a sphere
 
  vtkSmartPointer<vtkSphereSource> sphereSource =
 
    vtkSmartPointer<vtkSphereSource>::New();
 
  sphereSource->Update();
 
 
 
  vtkSmartPointer<vtkFeatureEdges> featureEdges =
 
    vtkSmartPointer<vtkFeatureEdges>::New();
 
  featureEdges->FeatureEdgesOff();
 
  featureEdges->BoundaryEdgesOn();
 
  featureEdges->NonManifoldEdgesOn();
 
  featureEdges->SetInputConnection(sphereSource->GetOutputPort());
 
  featureEdges->Update();
 
 
 
  int numberOfOpenEdges = featureEdges->GetOutput()->GetNumberOfCells();
 
 
 
  if(numberOfOpenEdges > 0)
 
    {
 
    std::cout << "Surface is not closed" << std::endl;
 
    }
 
  else
 
    {
 
    std::cout << "Surface is closed" << std::endl;
 
    }
 
   
 
  return EXIT_SUCCESS;
 
}
 
</source>
 
 
 
{{VTKCMakeLists|{{SUBPAGENAME}}}}
 
 
 
[[Category:VTKNoVizRequired]]
 

Latest revision as of 16:30, 9 September 2019

See ClosedSurface on the new VTKExamples website.