35 BaseWidget(parent,
"ViewGroupPropertiesWidget",
"View Properties"),
36 mGroupIndex(groupIndex),
42 mLayout =
new QVBoxLayout(
this);
63 mLayout->setMargin(2);
66 mLayout->addWidget(slices3D);
68 this->createCameraStyleProperties();
69 this->createCameraStyleWidget();
70 this->createControllingToolSelector();
72 mLayout->addStretch();
78 this->updateFrontend();
81 void ViewGroupPropertiesWidget::updateFrontend()
97 mUniCam->setValue(data.
mUniCam);
102 ToolPtr tool = group->getControllingTool();
104 mToolSelector->setValue(tool->getUid());
109 return mServices->view()->getGroup(mGroupIndex);
112 void ViewGroupPropertiesWidget::createCameraStyleProperties()
115 focusroi->setValueName(
"Focus ROI");
116 focusroi->setHelp(
"Set focus to center of ROI");
117 focusroi->setTypeRegexp(
"roi");
118 mFocusROI = focusroi;
119 mCameraStyleProperties.push_back(mFocusROI);
122 "Camera View Angle, of Field of View",
124 mCameraStyleProperties.push_back(mCameraViewAngle);
125 mCameraViewAngle->setInternal2Display(180.0/
M_PI);
128 "Camera position is fixed to the tool and moving along with it.\n" 129 "Zooming causes the position to slide along the tool axis",
131 mCameraStyleProperties.push_back(mCameraFollowTool);
134 "Scene focus is fixed to the tool and moving along with it.",
136 mCameraStyleProperties.push_back(mFocusFollowTool);
139 "Camera position is located exactly on the tool tip",
141 mCameraStyleProperties.push_back(mCameraOnTooltip);
144 "Camera offset from tooltip, used if Camera on Tooltip is set.",
146 mCameraStyleProperties.push_back(mCameraTooltipOffset);
149 notbehind->setValueName(
"Camera not behind ROI");
150 notbehind->setHelp(
"Camera cannot move behind ROI");
151 notbehind->setTypeRegexp(
"roi");
152 mCameraNotBehindROI = notbehind;
153 mCameraStyleProperties.push_back(notbehind);
156 "The camera's up vector is aligned with the operating table's up vector.",
158 mCameraStyleProperties.push_back(mTableLock);
161 "View angle above tool, used if Follow tool is set.",
163 mElevation->setInternal2Display(180.0/
M_PI);
164 mCameraStyleProperties.push_back(mElevation);
167 "Use the VTK Unicam interactor. Overrides other style settings",
169 mCameraStyleProperties.push_back(mUniCam);
172 autozoom->setValueName(
"Auto Zoom ROI");
173 autozoom->setHelp(
"Zoom so that the given ROI always is visible");
174 autozoom->setTypeRegexp(
"roi");
175 mAutoZoomROI = autozoom;
176 mCameraStyleProperties.push_back(mAutoZoomROI);
178 for (
unsigned i=0; i<mCameraStyleProperties.size(); ++i)
181 this, &ViewGroupPropertiesWidget::onCameraStyleChanged);
185 void ViewGroupPropertiesWidget::createCameraStyleWidget()
187 QGroupBox* groupBox =
new QGroupBox(
"Camera Style");
188 mLayout->addWidget(groupBox);
190 QVBoxLayout* layout =
new QVBoxLayout(groupBox);
191 layout->setMargin(0);
194 mCameraStyleInteractor->connectCameraStyle(this->getViewGroup());
196 QToolBar* toolBar =
new QToolBar(
this);
197 layout->addWidget(toolBar);
198 toolBar->addActions(mCameraStyleInteractor->getInteractorStyleActionGroup()->actions());
201 QGridLayout *cameraStyleLayout =
new QGridLayout;
202 layout->addLayout(cameraStyleLayout);
203 cameraStyleLayout->setMargin(0);
205 for (
unsigned i=0; i<mCameraStyleProperties.size(); ++i)
207 createDataWidget(mServices->view(), mServices->patient(),
this, mCameraStyleProperties[i], cameraStyleLayout, count++);
211 void ViewGroupPropertiesWidget::createControllingToolSelector()
213 mToolSelector->setValueName(
"Controlling Tool");
214 mToolSelector->setHelp(
"Select a tool for controlling the 2D/3D views in this view group. This will override the Active Tool");
215 mToolSelector->provideActiveTool(
true);
216 mToolSelector->setActiveTool();
220 QHBoxLayout *layout =
new QHBoxLayout();
221 layout->addWidget(toolSelectorWidget);
222 mLayout->addLayout(layout);
227 ToolPtr tool = mToolSelector->getTool();
232 if(mToolSelector->isActiveToolSelected())
240 group->setControllingTool(tool);
243 void ViewGroupPropertiesWidget::onCameraStyleChanged()
256 data.
mUniCam = mUniCam->getValue();
262 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.
boost::shared_ptr< class Tool > ToolPtr