So I upgraded to 5.6 to get vtkMatlabMexAdapter and....<br><br>The
following code from <a href="http://www.kitware.com/products/archive/kitware_quarterly1009.pdf" target="_blank">http://www.kitware.com/products/archive/kitware_quarterly1009.pdf</a><br>
<br>--snip--<br>void mexFunction(int nlhs,<br>mxArray *plhs[],<br>int
nrhs,<br>const mxArray *prhs[])<br>{<br>vtkDataArray* pointdata =
(vtkDataArray*)<br>vtkMatlabMexAdapter::<div id=":1pu" class="ii gt">mxArrayTovtkDataArray(prhs[0]);<br>vtkPoints*
points = vtkPoints::New();<br>
points->SetData(pointdata);<br>pointdata->Delete();<br>vtkPolyData*
pointCloud = vtkPolyData::New();<br>pointCloud->SetPoints(points);<br>points->Delete();<br>vtkDelaunay2D*
d2d = vtkDelaunay2D::New();<br>d2d->SetInput(pointCloud);<br>
}<br><br>--end snip-<br><br>uses vtkMatlabMexAdapter::mxArrayTovtkDataArray(prhs[0]);
as a static C++ call using the resolution operator::. Problem is I
get:<br><br>-snip-<br>1>..\..\..\..\..\..\..\..\source\Matlab\lib\dsaLib\visualization\vtk\showVolume3D\volume_render.cpp(117)
: error C2352: 'vtkMatlabMexAdapter::mxArrayTovtkDataArray' :
illegal call of non-static member function<br>
1> C:\Users\bdavis5\Documents\QS\QS-NIH\source\branches\trunk\build\Windows-6.0\install\include\vtk-5.6\vtkMatlabMexAdapter.h(84)
: see declaration of 'vtkMatlabMexAdapter::mxArrayTovtkDataArray'<br>1>..\..\..\..\..\..\..\..\source\Matlab\lib\dsaLib\visualization\vtk\showVolume3D\volume_render.cpp(307)
: error C2664: 'vtkDataSetAttributes::SetScalars' : cannot convert
parameter 1 from 'double *' to 'vtkDataArray *'<br>
-end snip-<br><br>because the vtkMatlabMexAdapter class does not have
mxArrayTovtkDataArray as a static class function. As seen from
vtkMatlabMexAdapter.h:<br><br>-snip-<br> // Description:<br> // Create
a vtkDataArray copy of a Matlab mxArray (Allocates memory by default)<br>
vtkDataArray* mxArrayTovtkDataArray(const mxArray* mxa, bool
ShallowCopy = false);<br>-end snip-<br><br>The following URL has an
example similar to kitware quarterly pdf.<br><a href="http://www.kitware.com/InfovisWiki/index.php/Matlab_Interface" target="_blank">http://www.kitware.com/InfovisWiki/index.php/Matlab_Interface</a><br>
<br>Curious on which it should be.... an object for which I should
create an instance? or static class function?</div><br>Brian<br>