35 #include <boost/bind.hpp>
36 #include <ctkPluginContext.h>
50 mPluginContext(pluginContext),
53 this->initServiceListener();
58 return mViewService->get3DView(group, index);
63 return mViewService->getActiveGroupId();
68 return mViewService->getGroup(groupIdx);
73 mViewService->setRegistrationMode(mode);
76 void ViewServiceProxy::initServiceListener()
80 boost::bind(&ViewServiceProxy::onServiceAdded,
this, _1),
82 boost::bind(&ViewServiceProxy::onServiceRemoved,
this, _1)
84 mServiceListener->open();
86 void ViewServiceProxy::onServiceAdded(ViewService* service)
88 mViewService.reset(service, null_deleter());
101 void ViewServiceProxy::onServiceRemoved(ViewService *service)
118 return mViewService->isNull();
123 mViewService->aboutToStop();
128 mViewService->autoShowData(data);
133 mViewService->enableRender(val);
138 return mViewService->renderingIsEnabled();
143 return mViewService->createLayoutWidget(parent, index);
148 return mViewService->getLayoutWidget(index);
153 return mViewService->getActiveLayout(widgetIndex);
158 mViewService->setActiveLayout(uid, widgetIndex);
163 return mViewService->getCropper();
168 return mViewService->getRenderTimer();
173 return mViewService->getNavigation();
178 return mViewService->getLayoutRepository();
183 return mViewService->getCameraControl();
188 return mViewService->getInteractorStyleActionGroup();
193 return mViewService->centerToImageCenterInActiveViewGroup();
198 mViewService->setCameraStyle(style, groupIdx);
203 mViewService->addDefaultLayout(layoutData);
208 return mViewService->getClippers();
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
virtual QWidget * getLayoutWidget(int index)
Get the specified layout widget, NULL if not created.
virtual void setCameraStyle(CAMERA_STYLE_TYPE style, int groupIdx)
boost::shared_ptr< class LayoutRepository > LayoutRepositoryPtr
virtual QWidget * createLayoutWidget(QWidget *parent, int index)
Get the specified layout widget, create if necessary.
virtual void setRegistrationMode(REGISTRATION_STATUS mode)
virtual CameraControlPtr getCameraControl()
ViewServiceProxy(ctkPluginContext *pluginContext)
virtual LayoutRepositoryPtr getLayoutRepository()
void fps(int number)
Emits number of frames per second.
virtual ViewGroupDataPtr getGroup(int groupIdx) const
virtual CyclicActionLoggerPtr getRenderTimer()
virtual void aboutToStop()
virtual InteractiveCropperPtr getCropper()
virtual int getActiveGroupId() const
boost::shared_ptr< class View > ViewPtr
boost::shared_ptr< class Navigation > NavigationPtr
virtual void centerToImageCenterInActiveViewGroup()
virtual ClippersPtr getClippers()
void pointSampled(Vector3D p_r)
void renderingEnabledChanged()
emitted then rendering is enabled/disabled
boost::shared_ptr< class Data > DataPtr
virtual QString getActiveLayout(int widgetIndex=0) const
virtual void enableRender(bool val)
boost::shared_ptr< class CyclicActionLogger > CyclicActionLoggerPtr
virtual void autoShowData(DataPtr data)
virtual ViewPtr get3DView(int group=0, int index=0)
boost::shared_ptr< class InteractiveCropper > InteractiveCropperPtr
void activeViewChanged()
emitted when the active view changes
virtual void addDefaultLayout(LayoutData layoutData)
static ViewServicePtr getNullObject()
void activeLayoutChanged()
emitted when the active layout changes
Helper class for listening to services being added, modified and removed.
virtual QActionGroup * getInteractorStyleActionGroup()
boost::shared_ptr< class CameraControl > CameraControlPtr
virtual NavigationPtr getNavigation()
virtual bool renderingIsEnabled() const
static ViewServicePtr create(ctkPluginContext *pluginContext)
boost::shared_ptr< class Clippers > ClippersPtr
virtual void setActiveLayout(const QString &uid, int widgetIndex)