Skip to content
Snippets Groups Projects
Commit df6c5b43 authored by Lars Bilke's avatar Lars Bilke
Browse files

Merge pull request #263 from rinkk/VTKPrismElementDisplay

Changes the node numberung for creation of VTK_WEDGE objects
parents 41239d2a b4b3e20a
No related branches found
No related tags found
No related merge requests found
......@@ -138,6 +138,13 @@ int VtkMeshSource::RequestData( vtkInformation* request,
int type(0);
const MeshLib::Element* elem (elems[i]);
materialIDs->InsertValue(i, elem->getValue());
vtkIdList* point_ids = vtkIdList::New();
const unsigned nElemNodes (elem->getNNodes());
point_ids->SetNumberOfIds(nElemNodes);
for (unsigned j = 0; j < nElemNodes; ++j)
point_ids->SetId(j, elem->getNode(j)->getID());
switch (elem->getGeomType())
{
case MeshElemType::LINE:
......@@ -157,6 +164,12 @@ int VtkMeshSource::RequestData( vtkInformation* request,
break;
case MeshElemType::PRISM:
type = 13;
for (unsigned i=0; i<3; ++i)
{
const unsigned prism_swap_id = point_ids->GetId(i);
point_ids->SetId(i, point_ids->GetId(i+3));
point_ids->SetId(i+3, prism_swap_id);
}
break;
case MeshElemType::PYRAMID:
type = 14;
......@@ -167,13 +180,6 @@ int VtkMeshSource::RequestData( vtkInformation* request,
return 0;
}
materialIDs->InsertValue(i, elem->getValue());
vtkIdList* point_ids = vtkIdList::New();
const unsigned nElemNodes (elem->getNNodes());
point_ids->SetNumberOfIds(nElemNodes);
for (unsigned j = 0; j < nElemNodes; ++j)
point_ids->SetId(j, elem->getNode(j)->getID());
output->InsertNextCell(type, point_ids);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment