54 BaseWidget(parent,
"ViewGroupPropertiesWidget",
"View Properties"),
55 mGroupIndex(groupIndex),
61 mLayout =
new QVBoxLayout(
this);
78 mLayout->setMargin(2);
81 mLayout->addWidget(slices3D);
83 this->createCameraStyleProperties();
84 this->createCameraStyleWidget();
86 mLayout->addStretch();
92 this->updateFrontend();
95 void ViewGroupPropertiesWidget::updateFrontend()
111 mUniCam->setValue(data.
mUniCam);
119 return mServices->view()->getGroup(mGroupIndex);
122 void ViewGroupPropertiesWidget::createCameraStyleProperties()
125 focusroi->setValueName(
"Focus ROI");
126 focusroi->setHelp(
"Set focus to center of ROI");
127 focusroi->setTypeRegexp(
"roi");
128 mFocusROI = focusroi;
129 mCameraStyleProperties.push_back(mFocusROI);
132 "Camera View Angle, of Field of View",
134 mCameraStyleProperties.push_back(mCameraViewAngle);
135 mCameraViewAngle->setInternal2Display(180.0/
M_PI);
138 "Camera position is fixed to the tool and moving along with it.\n" 139 "Zooming causes the position to slide along the tool axis",
141 mCameraStyleProperties.push_back(mCameraFollowTool);
144 "Scene focus is fixed to the tool and moving along with it.",
146 mCameraStyleProperties.push_back(mFocusFollowTool);
149 "Camera position is located exactly on the tool tip",
151 mCameraStyleProperties.push_back(mCameraOnTooltip);
154 "Camera offset from tooltip, used if Camera on Tooltip is set.",
156 mCameraStyleProperties.push_back(mCameraTooltipOffset);
159 notbehind->setValueName(
"Camera not behind ROI");
160 notbehind->setHelp(
"Camera cannot move behind ROI");
161 notbehind->setTypeRegexp(
"roi");
162 mCameraNotBehindROI = notbehind;
163 mCameraStyleProperties.push_back(notbehind);
166 "The camera's up vector is aligned with the operating table's up vector.",
168 mCameraStyleProperties.push_back(mTableLock);
171 "View angle above tool, used if Follow tool is set.",
173 mElevation->setInternal2Display(180.0/
M_PI);
174 mCameraStyleProperties.push_back(mElevation);
177 "Use the VTK Unicam interactor. Overrides other style settings",
179 mCameraStyleProperties.push_back(mUniCam);
182 autozoom->setValueName(
"Auto Zoom ROI");
183 autozoom->setHelp(
"Zoom so that the given ROI always is visible");
184 autozoom->setTypeRegexp(
"roi");
185 mAutoZoomROI = autozoom;
186 mCameraStyleProperties.push_back(mAutoZoomROI);
188 for (
unsigned i=0; i<mCameraStyleProperties.size(); ++i)
191 this, &ViewGroupPropertiesWidget::onCameraStyleChanged);
195 void ViewGroupPropertiesWidget::createCameraStyleWidget()
197 QGroupBox* groupBox =
new QGroupBox(
"Camera Style");
198 mLayout->addWidget(groupBox);
200 QVBoxLayout* layout =
new QVBoxLayout(groupBox);
201 layout->setMargin(0);
204 mCameraStyleInteractor->connectCameraStyle(this->getViewGroup());
206 QToolBar* toolBar =
new QToolBar(
this);
207 layout->addWidget(toolBar);
208 toolBar->addActions(mCameraStyleInteractor->getInteractorStyleActionGroup()->actions());
211 QGridLayout *cameraStyleLayout =
new QGridLayout;
212 layout->addLayout(cameraStyleLayout);
213 cameraStyleLayout->setMargin(0);
215 for (
unsigned i=0; i<mCameraStyleProperties.size(); ++i)
217 createDataWidget(mServices->view(), mServices->patient(),
this, mCameraStyleProperties[i], cameraStyleLayout, count++);
221 void ViewGroupPropertiesWidget::onCameraStyleChanged()
234 data.
mUniCam = mUniCam->getValue();
240 group->setOptions(options);
static BoolPropertyPtr initialize(const QString &uid, QString name, QString help, bool value, QDomNode root=QDomNode())
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
QString mCameraNotBehindROI
bool mCameraLockToTooltip
boost::shared_ptr< class VisServices > VisServicesPtr
static StringPropertySelectDataPtr New(PatientModelServicePtr patientModelService, QString typeRegexp=".*")
Utility class for describing a bounded numeric range.
QWidget * createDataWidget(ViewServicePtr viewService, PatientModelServicePtr patientModelService, QWidget *parent, PropertyPtr data, QGridLayout *gridLayout, int row)
Create a widget capable of displaying the input data.
CameraStyleData mCameraStyle
double mCameraTooltipOffset
void changed()
emit when the underlying data value is changed: The user interface will be updated.
static DoublePropertyPtr initialize(const QString &uid, QString name, QString help, double value, DoubleRange range, int decimals, QDomNode root=QDomNode())
boost::shared_ptr< class StringPropertySelectData > StringPropertySelectDataPtr
Namespace for all CustusX production code.