16 #include <vtkPoints.h> 17 #include <vtkCellArray.h> 33 points->Allocate(transformMap_prMt.size());
35 TimedTransformMap::iterator mapIter = transformMap_prMt.begin();
36 while(mapIter != transformMap_prMt.end())
43 points->InsertNextPoint(p.begin());
49 std::vector<vtkIdType> ids(points->GetNumberOfPoints());
50 for (
unsigned i=0; i<ids.size(); ++i)
52 lines->InsertNextCell(ids.size(), &(*ids.begin()));
54 retval->SetPoints(points);
55 retval->SetLines(lines);
64 QString uid =
"tool_positions_mesh_%1";
65 QString name =
"Tool positions mesh %1";
66 MeshPtr mesh = dataManager->createSpecificData<
Mesh>(uid, name);
68 mesh->setColor(QColor(
"red"));
69 dataManager->insertData(mesh);
74 std::map<std::string, std::string> retval;
79 retval[
"Filename"] = mesh->getFilename().toStdString();
80 retval[
"Coordinate system"] = mesh->getCoordinateSystem().toString().toStdString();
81 retval[
"Name"] = mesh->getName().toStdString();
82 retval[
"Parent space"] = mesh->getParentSpace().toStdString();
83 retval[
"Space"] = mesh->getSpace().toStdString();
84 retval[
"Type"] = mesh->getType().toStdString();
85 retval[
"Uid"] = mesh->getUid().toStdString();
87 retval[
"Backface culling"] =
string_cast(mesh->getBackfaceCulling());
88 retval[
"Color"] = mesh->getColor().name().toStdString();
89 retval[
"Frontface culling"] =
string_cast(mesh->getFrontfaceCulling());
92 retval[
"Fiber bundle"] =
string_cast(mesh->isFiberBundle());
95 float actualMemorySizeKB = (float)mesh->getVtkPolyData()->GetActualMemorySize();
96 retval[
"Actual memory size"] =
string_cast(actualMemorySizeKB/(1024*1024))+
" GB, "+
string_cast(actualMemorySizeKB/1024)+
" MB, "+
string_cast(actualMemorySizeKB)+
" kB";
97 retval[
"Points"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfPoints());
98 retval[
"Lines"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfLines());
99 retval[
"Pieces"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfPieces());
100 retval[
"Polys"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfPolys());
101 retval[
"Strips"] =
string_cast(mesh->getVtkPolyData()->GetNumberOfStrips());
102 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
std::string matrixAsSingleLineString(cx::Transform3D transform)
QString timestampSecondsFormatNice()
vtkSmartPointer< vtkPoints > vtkPointsPtr
std::string string_cast(const T &val)
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)
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
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
Namespace for all CustusX production code.