[vtkusers] How can I connect a vtkPolydata object with vtkExtractPolyDataGeometry?

BoShi chinaren.vtk at gmail.com
Wed Jun 7 10:35:24 EDT 2006


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);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060607/1b9b6d2a/attachment.htm>


More information about the vtkusers mailing list