34 #include <QVBoxLayout>
58 TabbedWidget(parent,
"MeshInfoWidget",
"Mesh Properties")
60 this->setToolTip(
"Mesh properties");
63 activeMeshProperty->setValueName(
"Active Mesh");
67 this->
addTab(
new MeshInfoWidget(activeMeshProperty, services->patient(), services->view(),
this),
"Info");
104 InfoWidget(parent,
"MeshCoreInfoWidget",
"Mesh Properties"),
105 mPatientModelService(patientModelService),
106 mViewService(viewService),
107 mMeshSelector(meshSelector)
130 mMesh->setColor(mColorAdapter->getValue());
135 if (mMesh == mMeshSelector->getData())
140 mMesh->setVisSize((
double) mVisSizeWidget->getValue());
143 disconnect(mGlyphVisualizationCheckBox, SIGNAL(toggled(
bool)), mMesh.get(), SLOT(setShowGlyph(
bool)));
144 disconnect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
147 mMesh = boost::dynamic_pointer_cast<
Mesh>(mMeshSelector->getData());
151 mParentFrameAdapter->setData(mMesh);
152 mNameAdapter->setData(mMesh);
153 mUidAdapter->setData(mMesh);
154 mGlyphOrientationArrayAdapter->setData(mMesh);
155 mGlyphColorArrayAdapter->setData(mMesh);
156 mGlyphColorLUTAdapter->setData(mMesh);
163 mGlyphVisualizationCheckBox->setChecked(mMesh->showGlyph());
164 mGlyphVisualizationCheckBox->setEnabled(mMesh->hasGlyph());
165 mVisSizeWidget->setValue(mMesh->getVisSize());
169 connect(mGlyphVisualizationCheckBox, SIGNAL(toggled(
bool)), mMesh.get(), SLOT(setShowGlyph(
bool)));
171 connect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(
meshChangedSlot()));
174 mParentFrameAdapter->setData(mMesh);
175 mNameAdapter->setData(mMesh);
176 mUidAdapter->setData(mMesh);
177 mColorAdapter->setValue(mMesh->getColor());
178 mGlyphOrientationArrayAdapter->setData(mMesh);
179 mGlyphColorArrayAdapter->setData(mMesh);
180 mGlyphColorLUTAdapter->setData(mMesh);
190 DataPtr parent = mPatientModelService->getData(mMesh->getParentSpace());
193 mMesh->get_rMd_History()->setRegistration(parent->get_rMd());
194 report(
"Assigned rMd from volume [" + parent->getName() +
"] to surface [" + mMesh->getName() +
"]");
201 mBackfaceCullingCheckBox->setChecked(mMesh->getBackfaceCulling());
202 mFrontfaceCullingCheckBox->setChecked(mMesh->getFrontfaceCulling());
203 mGlyphVisualizationCheckBox->setChecked(mMesh->showGlyph());
204 mGlyphVisualizationCheckBox->setEnabled(mMesh->hasGlyph());
205 mColorAdapter->setValue(mMesh->getColor());
206 mMesh->setVisSize((
double) mVisSizeWidget->getValue());
211 QWidget::showEvent(event);
216 QWidget::closeEvent(event);
219 void MeshInfoWidget::addWidgets()
224 QString uid(
"Color");
226 QString help(
"Color of the mesh.");
229 MeshPtr mesh = boost::dynamic_pointer_cast<
Mesh>(mMeshSelector->getData());
235 connect(mColorAdapter.get(), SIGNAL(changed()),
this, SLOT(
setColorSlot()));
237 QPushButton* importTransformButton =
new QPushButton(
"Import Transform from Parent",
this);
238 importTransformButton->setToolTip(
"Replace data transform with that of the parent data.");
248 QWidget* optionsWidget =
new QWidget(
this);
249 QHBoxLayout* optionsLayout =
new QHBoxLayout(optionsWidget);
250 optionsLayout->setMargin(0);
251 mBackfaceCullingCheckBox =
new QCheckBox(
"Backface culling");
252 mBackfaceCullingCheckBox->setToolTip(
"Set backface culling on. This makes transparent meshes work, but only draws outside mesh walls (eg. navigating inside meshes will not work).");
253 optionsLayout->addWidget(mBackfaceCullingCheckBox);
254 mFrontfaceCullingCheckBox =
new QCheckBox(
"Frontface culling");
255 mFrontfaceCullingCheckBox->setToolTip(
"Set frontface culling on. Can be used to make transparent meshes work from inside the meshes.");
256 optionsLayout->addWidget(mFrontfaceCullingCheckBox);
259 optionsLayout->addStretch(1);
265 int gridGlyphLayoutRow = 1;
266 QWidget* glyphWidget =
new QWidget(
this);
267 QGridLayout* glyphLayout =
new QGridLayout(glyphWidget);
268 glyphLayout->setMargin(0);
269 mGlyphVisualizationCheckBox =
new QCheckBox(
"Enable glyph visualization");
270 mGlyphVisualizationCheckBox->setToolTip(
"Enable glyph visualization");
271 glyphLayout->addWidget(mGlyphVisualizationCheckBox, gridGlyphLayoutRow++,0);
276 int gridLayoutRow = 1;
282 gridLayout->addWidget(optionsWidget, gridLayoutRow++, 0, 1, 2);
283 gridLayout->addWidget(
new QLabel(
"Visualization size:",
this), gridLayoutRow, 0);
285 gridLayout->addWidget(glyphWidget, gridLayoutRow++, 0, 1, 2);
287 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)
boost::shared_ptr< class VisServices > VisServicesPtr
Utility class for describing a bounded numeric range.
static StringPropertyGlyphLUTPtr New(PatientModelServicePtr patientModelService)
static StringPropertyGlyphColorArrayPtr New(PatientModelServicePtr patientModelService)
static StringPropertyDataUidEditablePtr New()
QWidget * createDataWidget(ViewServicePtr viewService, PatientModelServicePtr patientModelService, QWidget *parent, PropertyPtr data, QGridLayout *gridLayout, int row)
Create a widget capable of displaying the input data.
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class SelectDataStringPropertyBase > SelectDataStringPropertyBasePtr
static StringPropertyDataNameEditablePtr New()
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
static StringPropertyGlyphOrientationArrayPtr New(PatientModelServicePtr patientModelService)
void changed()
emit when the underlying data value is changed: The user interface will be updated.
cxLogicManager_EXPORT ViewServicePtr viewService()
static DoublePropertyPtr initialize(const QString &uid, QString name, QString help, double value, DoubleRange range, int decimals, QDomNode root=QDomNode())
static ColorPropertyPtr initialize(const QString &uid, QString name, QString help, QColor value, QDomNode root=QDomNode())
static StringPropertyActiveDataPtr New(PatientModelServicePtr patientModelService, QString typeRegexp=".*")
boost::shared_ptr< class Mesh > MeshPtr
boost::shared_ptr< class StringPropertyActiveData > StringPropertyActiveDataPtr
Helper class for xml files used to store ssc/cx data.
QColor getColor()
Get the color of the mesh (Values are range 0 - 255)