[vtkusers] How to pass a triangle without its point set?

David Doria daviddoria+vtk at gmail.com
Sat Oct 31 09:27:06 EDT 2009


On Sat, Oct 24, 2009 at 12:47 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> vtkTriangle is a vtkCell. It only has 3 points and 3 point ids. The
> points and ids are created as construction. In your original example,
> how would expect triangle to know about the points you created.
>
> SetPoint and InsertPoint have different semantics. In this case,
> SetPoint is better, since range checking is not required.
>
> From the vtkPoints.h
>  // Description:
>  // Insert point into object. No range checking performed (fast!).
>  // Make sure you use SetNumberOfPoints() to allocate memory prior
>  // to using SetPoint().
>  void SetPoint(vtkIdType id, const float x[3]) { this->Data->SetTuple(id,x);};
>  void SetPoint(vtkIdType id, const double x[3]) { this->Data->SetTuple(id,x);};
>  void SetPoint(vtkIdType id, double x, double y, double z);
>
>  // Description:
>  // Insert point into object. Range checking performed and memory
>  // allocated as necessary.
>  void InsertPoint(vtkIdType id, const float x[3])
>    { this->Data->InsertTuple(id,x);};
>  void InsertPoint(vtkIdType id, const double x[3])
>    {this->Data->InsertTuple(id,x);};
>  void InsertPoint(vtkIdType id, double x, double y, double z);
>
> vtkPolyData has a large array of points that can be indexed.
> vtkTriangle is about working with an individual to do things like
> compute areas, normals, etc.
>
> Bill


Bill,

Would you mind reading the text at the top of these and making sure it
is clear/correct?

http://www.vtk.org/Wiki/Triangle_%28on_large_point_array%29
http://www.vtk.org/Wiki/Triangle_%28self_contained%29

Thanks,

David



More information about the vtkusers mailing list