34 #include <QVBoxLayout> 48 #include "vtkPolyDataNormals.h" 63 BaseWidget(parent,
"active_mesh_widget",
"Mesh Properties")
65 this->setToolTip(
"Mesh properties");
68 activeMeshProperty->setValueName(
"Active Mesh");
70 QVBoxLayout* layout =
new QVBoxLayout(
this);
73 layout->addWidget(
new DataSelectWidget(services->view(), services->patient(),
this, activeMeshProperty));
81 TabbedWidget(parent,
"all_mesh_tabs_widget",
"Mesh Properties"),
84 this->setToolTip(
"Mesh properties");
101 InfoWidget(parent,
"mesh_info_widget",
"Mesh Properties"),
102 mPatientModelService(patientModelService),
103 mViewService(viewService),
104 mMeshSelector(meshSelector)
117 if (mMesh == mMeshSelector->getData())
122 disconnect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
125 mMesh = boost::dynamic_pointer_cast<
Mesh>(mMeshSelector->getData());
129 mParentFrameAdapter->setData(mMesh);
130 mNameAdapter->setData(mMesh);
131 mUidAdapter->setData(mMesh);
135 connect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
137 mParentFrameAdapter->setData(mMesh);
138 mNameAdapter->setData(mMesh);
139 mUidAdapter->setData(mMesh);
149 DataPtr parent = mPatientModelService->getData(mMesh->getParentSpace());
152 mMesh->get_rMd_History()->setRegistration(parent->get_rMd());
153 report(
"Assigned rMd from volume [" + parent->getName() +
"] to surface [" + mMesh->getName() +
"]");
162 normals->SetInputData(mMesh->getVtkPolyData());
164 mMesh->setVtkPolyData(normals->GetOutput());
166 QString outputBasePath = mPatientModelService->getActivePatientFolder();
167 mMesh->save(outputBasePath);
178 QWidget::showEvent(event);
183 QWidget::closeEvent(event);
186 void MeshInfoWidget::addWidgets()
188 MeshPtr mesh = boost::dynamic_pointer_cast<
Mesh>(mMeshSelector->getData());
190 QPushButton* importTransformButton =
new QPushButton(
"Import Transform from Parent",
this);
191 importTransformButton->setToolTip(
"Replace data transform with that of the parent data.");
194 QPushButton* addNormalsButton =
new QPushButton(
"Generate Normals",
this);
195 addNormalsButton->setToolTip(
"Generate surface normals and add to model.\nThis usually gives a smoother appearance.");
208 gridLayout->addWidget(importTransformButton, row++, 0, 1, 2);
209 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.