13 #include <QVBoxLayout>
27 #include "vtkPolyDataNormals.h"
42 BaseWidget(parent,
"active_mesh_widget",
"Mesh Properties")
44 this->setToolTip(
"Mesh properties");
47 activeMeshProperty->setValueName(
"Active Mesh");
49 QVBoxLayout* layout =
new QVBoxLayout(
this);
52 layout->addWidget(
new DataSelectWidget(services->view(), services->patient(),
this, activeMeshProperty));
60 TabbedWidget(parent,
"all_mesh_tabs_widget",
"Mesh Properties"),
63 this->setToolTip(
"Mesh properties");
65 this->
addTab(
new MeshInfoWidget(mesh, services->patient(), services->view(), services->file(),
this),
"Info");
81 InfoWidget(parent,
"mesh_info_widget",
"Mesh Properties"),
82 mPatientModelService(patientModelService),
83 mViewService(viewService),
84 mFileManagerService(fileManager),
85 mMeshSelector(meshSelector)
98 if (mMesh == mMeshSelector->getData())
103 disconnect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
106 mMesh = boost::dynamic_pointer_cast<Mesh>(mMeshSelector->getData());
110 mParentFrameAdapter->setData(mMesh);
111 mNameAdapter->setData(mMesh);
112 mUidAdapter->setData(mMesh);
116 connect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
118 mParentFrameAdapter->setData(mMesh);
119 mNameAdapter->setData(mMesh);
120 mUidAdapter->setData(mMesh);
130 DataPtr parent = mPatientModelService->getData(mMesh->getParentSpace());
133 mMesh->get_rMd_History()->setRegistration(parent->get_rMd());
134 report(
"Assigned rMd from volume [" + parent->getName() +
"] to surface [" + mMesh->getName() +
"]");
143 normals->SetInputData(mMesh->getVtkPolyData());
145 mMesh->setVtkPolyData(normals->GetOutput());
147 QString outputBasePath = mPatientModelService->getActivePatientFolder();
148 mMesh->save(outputBasePath, mFileManagerService);
159 QWidget::showEvent(event);
164 QWidget::closeEvent(event);
167 void MeshInfoWidget::addWidgets()
169 MeshPtr mesh = boost::dynamic_pointer_cast<Mesh>(mMeshSelector->getData());
171 QPushButton* importTransformButton =
new QPushButton(
"Import Transform from Parent",
this);
172 importTransformButton->setToolTip(
"Replace data transform with that of the parent data.");
175 QPushButton* addNormalsButton =
new QPushButton(
"Generate Normals",
this);
176 addNormalsButton->setToolTip(
"Generate surface normals and add to model.\nThis usually gives a smoother appearance.");
189 gridLayout->addWidget(importTransformButton, row++, 0, 1, 2);
190 gridLayout->addWidget(addNormalsButton, row++, 0, 1, 2);