[vtk-developers] Class design for spline visualizations

Lin M majcjc at gmail.com
Tue Jun 30 15:19:26 EDT 2015


Yes, I can store it in PointData(), but
splineData->GetDimensions(numControlPointsPerAxis)
will not return the correct number of control points. It will return
{0,0,0} if we hold the control points in PointData(). Though we can also
hold a simple 1*3 array in vtkFieldData just like we store the length of
knot vectors.

On Tue, Jun 30, 2015 at 2:10 PM, David Thompson <david.thompson at kitware.com>
wrote:

> Hi Lin,
>
> > I didn't separate the homogenous coordinate with point coordinates but
> stored them all in a vtkDataArray with 4 components per tuple just as you
> suggest. In this way, vtkStructuredGrid cannot hold them as vtkPoints. The
> current API is like
> >
> > void vtkNURBSPatchAdaptor::GetPatchShape(vtkUnstructuredGrid* outputSp,
> vtkDataArray* ctrlPts, int* ctrlPtsNum)
> > the outputSp holds the surface mesh, ctrlPts and ctrlPtsNum hold
> information and data of nurbs control points, and the vtkSturcturedGrid
> only holds knot vectors and length.
>
> Actually, the vtkStructuredGrid can hold the control points as PointData()
> (as opposed to Point  coordinates). There is no constraint on the number of
> components per tuple. The idea is to access the control points and knot
> data like this:
>
>   vtkStructuredGrid* splineData;
>   vtkDataArray* controlPoints =
> splineData->GetPointData()->GetArrayByName("control polygon");
>   vtkDataArray* knotVector =
> splineData->GetFieldData()->GetArrayByName("knot vector");
>   int numControlPointsPerAxis[3];
>   splineData->GetDimensions(numControlPointsPerAxis);
>
> That way all of the spline data is grouped into one dataset; it's just
> that the splineData's vtkPoints would not hold the control points. We could
> also store additional information in the arrays of
> splineData->GetFieldData(). For example, flags indicating which axes (if
> any) were periodic could be stored in a separate field-data array since
> there is no constraint on the number of components or tuples of field-data
> arrays.
>
> Does that make sense?
>
>         David
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150630/0ae50bf5/attachment.html>


More information about the vtk-developers mailing list