Thank you, Andy! I will have a try. 2017-04-14 21:56 GMT+08:00 Andy Bauer <andy.ba...@kitware.com>:
> Hi, > > It is using the default settings for a vtkImageGrid which is to set the > spacing to 1 in each direction and the origin to (0,0,0). vtkImageData has > SetOrigin() and SetSpacing() methods. You can see the class documentation > at http://www.vtk.org/doc/nightly/html/classvtkImageData.html. > > Cheers, > Andy > > On Fri, Apr 14, 2017 at 7:54 AM, 刘楚高 <frank1985...@gmail.com> wrote: > >> hi, all >> >> In Catalyst example "Fortran90FullExample" -> "FECxxAdaptor.cxx"->" >> createcpimagedata_", the grid is new and has no coordinates. So, how to >> transfer the simulation grid coordinates to this vtkImageData grid? >> >> Thank you! >> >> extern "C" void createcpimagedata_(int* nxstart, int* nxend, int* nx, >> >> int* ny, int* nz) >> >> { >> >> if (!vtkCPPythonAdaptorAPI::GetCoProcessorData()) >> >> { >> >> vtkGenericWarningMacro("Unable to access CoProcessorData."); >> >> return; >> >> } >> >> >> // The simulation grid is a 3-dimensional topologically and >> geometrically >> >> // regular grid. In VTK/ParaView, this is considered an image data set. >> >> vtkSmartPointer<vtkImageData> grid = vtkSmartPointer<vtkImageData>: >> :New(); >> >> >> grid->SetExtent(*nxstart-1, *nxend-1, 0, *ny-1, 0, *nz-1); >> >> >> // Name should be consistent between here, Fortran and Python client >> script. >> >> vtkCPPythonAdaptorAPI::GetCoProcessorData()->GetInputDescriptionByName( >> "input")->SetGrid(grid); >> >> vtkCPPythonAdaptorAPI::GetCoProcessorData()->GetInputDescriptionByName( >> "input")->SetWholeExtent(0, *nx-1, 0, *ny-1, 0, *nz-1); >> >> } >> >> -- >> 中国空气动力研究与发展中心 计算空气动力研究所 >> Blog: http://blog.donews.com/frank777 >> MSN: frank1985...@hotmail.com >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the ParaView Wiki at: >> http://paraview.org/Wiki/ParaView >> >> Search the list archives at: http://markmail.org/search/?q=ParaView >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/paraview >> >> > -- 中国空气动力研究与发展中心 计算空气动力研究所 Blog: http://blog.donews.com/frank777 MSN: frank1985...@hotmail.com
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview