[vtkusers] Polydata Get max values

Polly Pui polly_sukting at hotmail.com
Mon Apr 16 00:52:54 EDT 2018


Hi Andras,

Thank you for your reply. I could get the highest and lowest coordinates from what you have suggested.

I have another question here.

How can I locate the coordinates by giving a coloured point and visualize them?


...

vtkSmartPointer<vtkPolyData> point =
vtkSmartPointer<vtkPolyData>::New();

vtkSmartPointer<vtkPolyDataReader> reader =
vtkSmartPointer<vtkPolyDataReader>::New();
reader->SetFileName(argv[1]);
reader->Update();
point = reader->GetOutput();

double bounds[6];
point->GetBounds(bounds);

std::cout << "xmin: " << bounds[0] << " "
<< "xmax: " << bounds[1] << std::endl
<< "ymin: " << bounds[2] << " "
<< "ymax: " << bounds[3] << std::endl
<< "zmin: " << bounds[4] << " "
<< "zmax: " << bounds[5] << std::endl;

vtkSmartPointer<vtkPolyDataMapper> Mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
Mapper->SetInputConnection(reader->GetOutputPort());
Mapper->ScalarVisibilityOff();
Mapper->Update();

vtkSmartPointer<vtkActor> Actor = vtkSmartPointer<vtkActor>::New();
Actor->SetMapper(Mapper);
Actor->GetProperty()->SetPointSize(10);
Actor->GetProperty()->SetColor(1, 0, 1);


Thank you.

Regards,
Polly

________________________________
From: Andras Lasso <lasso at queensu.ca>
Sent: Saturday, April 14, 2018 2:52 AM
To: Polly Pui; vtkusers at vtk.org
Subject: RE: Polydata Get max values


You can use GetBounds method - https://www.vtk.org/doc/nightly/html/classvtkDataSet.html#a6a25018c1af03c2fc1068ea4a0221281

VTK: vtkDataSet Class Reference<https://www.vtk.org/doc/nightly/html/classvtkDataSet.html#a6a25018c1af03c2fc1068ea4a0221281>
www.vtk.org
abstract class to specify dataset behavior . vtkDataSet is an abstract class that specifies an interface for dataset objects. vtkDataSet also provides methods to provide information about the data, such as center, bounding box, and representative length.





Andras



From: vtkusers <vtkusers-bounces at vtk.org> On Behalf Of Polly Pui
Sent: Friday, April 13, 2018 1:56 PM
To: vtkusers at vtk.org
Subject: [vtkusers] Polydata Get max values



Hi,

Is there anyone can give me a hint on how to find the highest point (max value of z coordinate) or lowest point (min value of z coordinate) in a polydata?

I want to mark it with a colour circle to visualize as a keypoint.



Thank you so much.



Polly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180416/6f1e9b07/attachment.html>


More information about the vtkusers mailing list