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");
80 InfoWidget(parent,
"mesh_info_widget",
"Mesh Properties"),
81 mPatientModelService(patientModelService),
82 mViewService(viewService),
83 mMeshSelector(meshSelector)
96 if (mMesh == mMeshSelector->getData())
101 disconnect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
104 mMesh = boost::dynamic_pointer_cast<
Mesh>(mMeshSelector->getData());
108 mParentFrameAdapter->setData(mMesh);
109 mNameAdapter->setData(mMesh);
110 mUidAdapter->setData(mMesh);
114 connect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
116 mParentFrameAdapter->setData(mMesh);
117 mNameAdapter->setData(mMesh);
118 mUidAdapter->setData(mMesh);
128 DataPtr parent = mPatientModelService->getData(mMesh->getParentSpace());
131 mMesh->get_rMd_History()->setRegistration(parent->get_rMd());
132 report(
"Assigned rMd from volume [" + parent->getName() +
"] to surface [" + mMesh->getName() +
"]");
141 normals->SetInputData(mMesh->getVtkPolyData());
143 mMesh->setVtkPolyData(normals->GetOutput());
145 QString outputBasePath = mPatientModelService->getActivePatientFolder();
146 mMesh->save(outputBasePath);
157 QWidget::showEvent(event);
162 QWidget::closeEvent(event);
165 void MeshInfoWidget::addWidgets()
167 MeshPtr mesh = boost::dynamic_pointer_cast<
Mesh>(mMeshSelector->getData());
169 QPushButton* importTransformButton =
new QPushButton(
"Import Transform from Parent",
this);
170 importTransformButton->setToolTip(
"Replace data transform with that of the parent data.");
173 QPushButton* addNormalsButton =
new QPushButton(
"Generate Normals",
this);
174 addNormalsButton->setToolTip(
"Generate surface normals and add to model.\nThis usually gives a smoother appearance.");
187 gridLayout->addWidget(importTransformButton, row++, 0, 1, 2);
188 gridLayout->addWidget(addNormalsButton, row++, 0, 1, 2);
std::map< std::string, std::string > getDisplayFriendlyInfo(MeshPtr mesh)
static StringPropertyParentFramePtr New(PatientModelServicePtr patientModelService)
boost::shared_ptr< class VisServices > VisServicesPtr
static StringPropertyDataUidEditablePtr New()
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class SelectDataStringPropertyBase > SelectDataStringPropertyBasePtr
static StringPropertyDataNameEditablePtr New()
vtkSmartPointer< class vtkPolyDataNormals > vtkPolyDataNormalsPtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
void changed()
emit when the underlying data value is changed: The user interface will be updated.
static StringPropertyActiveDataPtr New(PatientModelServicePtr patientModelService, QString typeRegexp=".*")
boost::shared_ptr< class Mesh > MeshPtr
boost::shared_ptr< class StringPropertyActiveData > StringPropertyActiveDataPtr
Namespace for all CustusX production code.