[vtkusers] How can I connect a vtkPolydata object with vtkExtractPolyDataGeometry?
BoShi
chinaren.vtk at gmail.com
Fri Jun 9 07:58:40 EDT 2006
I have posted this message twice,but I can't solve this problem till
now! And there is nobody give any advice, so I have to try it again.
Hi,
Can GetGetProducerPort of vtkPolydata work? My source code are as follows:
CVtkArchitectureDoc* pDoc = GetDocument();
double normalViewPlane[3];
pvtkRenderer->GetActiveCamera()->GetViewPlaneNormal(normalViewPlane);
vtkPolyData* polydata = pDoc->m_polyData;
m_ImplicitSelectionLoop->SetLoop(m_pointLoop);
m_ImplicitSelectionLoop->SetNormal(normalViewPlane);
m_extractPolyDataGemetry->SetInputConnection(polydata->GetProducerPort());
m_extractPolyDataGemetry->SetImplicitFunction(m_ImplicitSelectionLoop);
m_polyDataMapper->SetInputConnection(m_extractPolyDataGemetry->GetOutputPort());
....................................
But i can't see the clip result? Who can tell me why? I use the
following code to build
the vtkPolydata object:
for (int n=0;n<m_nPts;n++)
{
libraryFile.Read(p,24);
m_points->InsertPoint(n,p[0],p[1],p[2]);
}
m_polyData->SetPoints(m_points);
int* ptId = new int[m_nPts];
for (n=0;n<m_nPts;n++)
{
ptId[n]=n;
}
m_cellArray->InsertNextCell(m_nPts, ptId);
delete []ptId;
//构建拓扑结构
m_polyData->SetVerts(m_cellArray);
BoShi
More information about the vtkusers
mailing list