37 #include <vtkPoints.h>
38 #include <vtkCellArray.h>
54 points->Allocate(transformMap_prMt.size());
56 TimedTransformMap::iterator mapIter = transformMap_prMt.begin();
57 while(mapIter != transformMap_prMt.end())
64 points->InsertNextPoint(p.begin());
70 std::vector<vtkIdType> ids(points->GetNumberOfPoints());
71 for (
unsigned i=0; i<ids.size(); ++i)
73 lines->InsertNextCell(ids.size(), &(*ids.begin()));
75 retval->SetPoints(points);
76 retval->SetLines(lines);
85 QString uid =
"tool_positions_mesh_%1";
86 QString name =
"Tool positions mesh %1";
87 MeshPtr mesh = dataManager->createSpecificData<
Mesh>(uid, name);
89 mesh->setColor(QColor(
"red"));
90 dataManager->insertData(mesh);
95 std::map<std::string, std::string> retval;
100 retval[
"Filename"] = mesh->getFilename().toStdString();
101 retval[
"Coordinate system"] = mesh->getCoordinateSystem().toString().toStdString();
102 retval[
"Name"] = mesh->getName().toStdString();
103 retval[
"Parent space"] = mesh->getParentSpace().toStdString();
104 retval[
"Space"] = mesh->getSpace().toStdString();
105 retval[
"Type"] = mesh->getType().toStdString();
106 retval[
"Uid"] = mesh->getUid().toStdString();
108 retval[
"Backface culling"] =
string_cast(mesh->getBackfaceCulling());
109 retval[
"Color"] = mesh->getColor().name().toStdString();
110 retval[
"Frontface culling"] =
string_cast(mesh->getFrontfaceCulling());
111 retval[
"Is wireframe"] =
string_cast(mesh->getIsWireframe());
113 retval[
"Fiber bundle"] =
string_cast(mesh->isFiberBundle());
116 float actualMemorySizeKB = (float)mesh->getVtkPolyData()->GetActualMemorySize();
117 retval[
"Actual memory size"] =
string_cast(actualMemorySizeKB/(1024*1024))+
" GB, "+
string_cast(actualMemorySizeKB/1024)+
" MB, "+
string_cast(actualMemorySizeKB)+
" kB";
118 retval[
"Points"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfPoints());
119 retval[
"Lines"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfLines());
120 retval[
"Pieces"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfPieces());
121 retval[
"Polys"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfPolys());
122 retval[
"Strips"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfStrips());
123 retval[
"Verts"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfVerts());
std::map< std::string, std::string > getDisplayFriendlyInfo(MeshPtr mesh)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
vtkSmartPointer< class vtkCellArray > vtkCellArrayPtr
QString timestampSecondsFormatNice()
std::string string_cast(const T &val)
vtkSmartPointer< class vtkPolyData > vtkPolyDataPtr
void setVtkPolyData(const vtkPolyDataPtr &polyData)
vtkPolyDataPtr polydataFromTransforms(TimedTransformMap transformMap_prMt, Transform3D rMpr)
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
void loadMeshFromToolTransforms(PatientModelServicePtr dataManager, TimedTransformMap transforms_prMt)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
boost::shared_ptr< class Mesh > MeshPtr
std::map< double, Transform3D > TimedTransformMap
vtkSmartPointer< class vtkPoints > vtkPointsPtr