[vtkusers] vtkPLYWriter and polydata

cerina cerine-baratelli at hotmail.fr
Mon Sep 17 04:33:18 EDT 2012


Hi all,
i divide my mesh to regions with the vtkOctree class, and now, i'm trying to
write each region in a ply File. I tried to use the vtkPLYWriter, but i get
2errors:
*error LNK1120: 1 unresolved externals*
*error LNK2019: unresolved external symbol "__declspec(dllimport) public:
static class vtkExtractSelection * __cdecl vtkExtractSelection::New(void)"
(__imp_?New at vtkExtractSelection@@SAPAV1 at XZ) referenced in function "public:
static class vtkSmartPointer<class vtkExtractSelection> __cdecl
vtkSmartPointer<class vtkExtractSelection>::New(void)"
(?New@?$vtkSmartPointer at VvtkExtractSelection@@@@SA?AV1@)*

i had this part of code:

// Assign all points to root node	
for (int i=0;i<this->Input->GetNumberOfPoints();i++)
PointsNode->SetValue(i,0);

int NumberOfSplitNodes;
int Level=0;
for(int h=0;h<8; h++)
{
.................. // subdividing the octree
}

for(int m=0; m<NumberOfSplitNodes; m++)
{ 
 vtkSmartPointer&lt;vtkIdTypeArray> ids = 
vtkSmartPointer<vtkIdTypeArray>::New(); 
ids->SetNumberOfComponents(1); 
for (int kk=0; kk<this->Input->GetNumberOfCells();kk++)
{
if(PointsNode->GetValue(kk)==m)
ids->InsertNextValue(kk); 
}
vtkSmartPointer<vtkSelectionNode> selectionNode = 
 vtkSmartPointer<vtkSelectionNode>::New(); 
 selectionNode->SetFieldType(vtkSelectionNode::CELL); 
 selectionNode->SetContentType(vtkSelectionNode::INDICES); 
 selectionNode->SetSelectionList(ids); 
vtkSmartPointer<vtkSelection> selection = 
vtkSmartPointer<vtkSelection>::New(); 
selection->AddNode(selectionNode); 
vtkSmartPointer<vtkExtractSelection> extractSelection = 
vtkSmartPointer<vtkExtractSelection>::New(); 

extractSelection->SetInputData(0, this->Input); 
extractSelection->SetInputData(1, selection); 

extractSelection->Update(); 

vtkSmartPointer<vtkUnstructuredGrid> selected = 
vtkSmartPointer<vtkUnstructuredGrid>::New(); 
selected->ShallowCopy(extractSelection->GetOutput()); 
vtkSmartPointer<vtkPolyData> newdata = 
vtkSmartPointer<vtkPolyData>::New(); 
vtkPoints* cellPoints = selected->GetPoints(); 
newdata->SetPoints(cellPoints); 
vtkPLYWriter *Writer=vtkPLYWriter::New();
	Writer->SetInput(newdata);
std::stringstream strfile;
strfile<<"Region"<<m&lt;&lt;&quot;.ply&quot;;
Writer->SetFileName(strfile.str().c_str());
Writer->Write();
}

Any help pleaaaaase, and thanks in advance

Cerina



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkPLYWriter-and-polydata-tp5716117.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list