33 BaseWidget(parent,
"ViewGroupPropertiesWidget",
"View Properties"),
34 mGroupIndex(groupIndex),
40 mLayout =
new QVBoxLayout(
this);
57 mLayout->setMargin(2);
60 mLayout->addWidget(slices3D);
62 this->createCameraStyleProperties();
63 this->createCameraStyleWidget();
65 mLayout->addStretch();
71 this->updateFrontend();
74 void ViewGroupPropertiesWidget::updateFrontend()
90 mUniCam->setValue(data.
mUniCam);
98 return mServices->view()->getGroup(mGroupIndex);
101 void ViewGroupPropertiesWidget::createCameraStyleProperties()
104 focusroi->setValueName(
"Focus ROI");
105 focusroi->setHelp(
"Set focus to center of ROI");
106 focusroi->setTypeRegexp(
"roi");
107 mFocusROI = focusroi;
108 mCameraStyleProperties.push_back(mFocusROI);
111 "Camera View Angle, of Field of View",
113 mCameraStyleProperties.push_back(mCameraViewAngle);
114 mCameraViewAngle->setInternal2Display(180.0/
M_PI);
117 "Camera position is fixed to the tool and moving along with it.\n" 118 "Zooming causes the position to slide along the tool axis",
120 mCameraStyleProperties.push_back(mCameraFollowTool);
123 "Scene focus is fixed to the tool and moving along with it.",
125 mCameraStyleProperties.push_back(mFocusFollowTool);
128 "Camera position is located exactly on the tool tip",
130 mCameraStyleProperties.push_back(mCameraOnTooltip);
133 "Camera offset from tooltip, used if Camera on Tooltip is set.",
135 mCameraStyleProperties.push_back(mCameraTooltipOffset);
138 notbehind->setValueName(
"Camera not behind ROI");
139 notbehind->setHelp(
"Camera cannot move behind ROI");
140 notbehind->setTypeRegexp(
"roi");
141 mCameraNotBehindROI = notbehind;
142 mCameraStyleProperties.push_back(notbehind);
145 "The camera's up vector is aligned with the operating table's up vector.",
147 mCameraStyleProperties.push_back(mTableLock);
150 "View angle above tool, used if Follow tool is set.",
152 mElevation->setInternal2Display(180.0/
M_PI);
153 mCameraStyleProperties.push_back(mElevation);
156 "Use the VTK Unicam interactor. Overrides other style settings",
158 mCameraStyleProperties.push_back(mUniCam);
161 autozoom->setValueName(
"Auto Zoom ROI");
162 autozoom->setHelp(
"Zoom so that the given ROI always is visible");
163 autozoom->setTypeRegexp(
"roi");
164 mAutoZoomROI = autozoom;
165 mCameraStyleProperties.push_back(mAutoZoomROI);
167 for (
unsigned i=0; i<mCameraStyleProperties.size(); ++i)
170 this, &ViewGroupPropertiesWidget::onCameraStyleChanged);
174 void ViewGroupPropertiesWidget::createCameraStyleWidget()
176 QGroupBox* groupBox =
new QGroupBox(
"Camera Style");
177 mLayout->addWidget(groupBox);
179 QVBoxLayout* layout =
new QVBoxLayout(groupBox);
180 layout->setMargin(0);
183 mCameraStyleInteractor->connectCameraStyle(this->getViewGroup());
185 QToolBar* toolBar =
new QToolBar(
this);
186 layout->addWidget(toolBar);
187 toolBar->addActions(mCameraStyleInteractor->getInteractorStyleActionGroup()->actions());
190 QGridLayout *cameraStyleLayout =
new QGridLayout;
191 layout->addLayout(cameraStyleLayout);
192 cameraStyleLayout->setMargin(0);
194 for (
unsigned i=0; i<mCameraStyleProperties.size(); ++i)
196 createDataWidget(mServices->view(), mServices->patient(),
this, mCameraStyleProperties[i], cameraStyleLayout, count++);
200 void ViewGroupPropertiesWidget::onCameraStyleChanged()
213 data.
mUniCam = mUniCam->getValue();
219 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.