34 #include <QVBoxLayout>
57 InfoWidget(parent,
"MeshInfoWidget",
"Mesh Properties"),
58 mPatientModelService(patientModelService),
59 mVisualizationService(visualizationService)
61 this->addWidgets(patientModelService);
79 mMesh->setColor(mColorAdapter->getValue());
84 if (mMesh == mSelectMeshWidget->getMesh())
89 disconnect(mBackfaceCullingCheckBox, SIGNAL(toggled(
bool)), mMesh.get(), SLOT(setBackfaceCullingSlot(
bool)));
90 disconnect(mFrontfaceCullingCheckBox, SIGNAL(toggled(
bool)), mMesh.get(), SLOT(setFrontfaceCullingSlot(
bool)));
91 disconnect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
94 mMesh = mSelectMeshWidget->getMesh();
98 mParentFrameAdapter->setData(mMesh);
99 mNameAdapter->setData(mMesh);
100 mUidAdapter->setData(mMesh);
104 mBackfaceCullingCheckBox->setChecked(mMesh->getBackfaceCulling());
105 mFrontfaceCullingCheckBox->setChecked(mMesh->getFrontfaceCulling());
106 connect(mBackfaceCullingCheckBox, SIGNAL(toggled(
bool)), mMesh.get(), SLOT(setBackfaceCullingSlot(
bool)));
107 connect(mFrontfaceCullingCheckBox, SIGNAL(toggled(
bool)), mMesh.get(), SLOT(setFrontfaceCullingSlot(
bool)));
108 connect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
110 mParentFrameAdapter->setData(mMesh);
111 mNameAdapter->setData(mMesh);
112 mUidAdapter->setData(mMesh);
113 mColorAdapter->setValue(mMesh->getColor());
123 DataPtr parent = mPatientModelService->getData(mMesh->getParentSpace());
126 mMesh->get_rMd_History()->setRegistration(parent->get_rMd());
127 report(
"Assigned rMd from volume [" + parent->getName() +
"] to surface [" + mMesh->getName() +
"]");
132 mBackfaceCullingCheckBox->setChecked(mMesh->getBackfaceCulling());
133 mFrontfaceCullingCheckBox->setChecked(mMesh->getFrontfaceCulling());
134 mColorAdapter->setValue(mMesh->getColor());
139 QWidget::showEvent(event);
144 QWidget::closeEvent(event);
150 mSelectMeshWidget->setValueName(
"Surface: ");
154 QString uid(
"Color");
156 QString help(
"Color of the mesh.");
159 if(mSelectMeshWidget->getMesh())
160 color = mSelectMeshWidget->getMesh()->getColor();
163 connect(mColorAdapter.get(), SIGNAL(changed()),
this, SLOT(
setColorSlot()));
165 QPushButton* importTransformButton =
new QPushButton(
"Import Transform from Parent",
this);
166 importTransformButton->setToolTip(
"Replace data transform with that of the parent data.");
173 QWidget* optionsWidget =
new QWidget(
this);
174 QHBoxLayout* optionsLayout =
new QHBoxLayout(optionsWidget);
175 mBackfaceCullingCheckBox =
new QCheckBox(
"Backface culling");
176 mBackfaceCullingCheckBox->setToolTip(
"Set backface culling on. This makes transparent meshes work, but only draws outside mesh walls (eg. navigating inside meshes will not work).");
177 optionsLayout->addWidget(mBackfaceCullingCheckBox);
178 mFrontfaceCullingCheckBox =
new QCheckBox(
"Frontface culling");
179 mFrontfaceCullingCheckBox->setToolTip(
"Set frontface culling on. Can be used to make transparent meshes work from inside the meshes.");
180 optionsLayout->addWidget(mFrontfaceCullingCheckBox);
182 optionsLayout->addStretch(1);
184 int gridLayoutRow = 1;
186 gridLayout->addWidget(
new DataSelectWidget(mVisualizationService, mPatientModelService,
this, mSelectMeshWidget), gridLayoutRow++, 0, 1, 2);
190 gridLayout->addWidget(optionsWidget, gridLayoutRow++, 0, 1, 2);
192 gridLayout->addWidget(importTransformButton, gridLayoutRow++, 0, 1, 2);
cxResource_EXPORT ProfilePtr profile()
std::map< std::string, std::string > getDisplayFriendlyInfo(MeshPtr mesh)
static StringPropertyParentFramePtr New(PatientModelServicePtr patientModelService)
static StringPropertyDataUidEditablePtr New()
boost::shared_ptr< class Data > DataPtr
static StringPropertyDataNameEditablePtr New()
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
void changed()
emit when the underlying data value is changed: The user interface will be updated.
static StringPropertySelectMeshPtr New(PatientModelServicePtr patientModelService)
static ColorPropertyPtr initialize(const QString &uid, QString name, QString help, QColor value, QDomNode root=QDomNode())
Helper class for xml files used to store ssc/cx data.