56 this->moveManualToolToPosition(p_r);
58 if (viewType.testFlag(
v2D))
61 mServices->patientModelService->setCenter(p_r);
64 if (viewType.testFlag(
v3D))
67 mCamera3D->translateByFocusTo(p_r);
73 void Navigation::centerToData(
DataPtr image)
77 Vector3D p_r = image->get_rMd().coord(image->boundingBox().center());
85 void Navigation::centerToData(
const std::vector<DataPtr>& images)
87 Vector3D p_r = findDataCenter(images);
93 ViewGroupDataPtr activeGroup = mServices->visualizationService->getActiveViewGroup();
102 std::vector<DataPtr> visibleData = group->getData(properties);
103 if(visibleData.empty())
106 ImagePtr activeImage = mServices->patientModelService->getActiveImage();
107 if(activeImage && std::count(visibleData.begin(), visibleData.end(), activeImage))
108 this->centerToData(activeImage);
110 this->centerToData(visibleData);
118 ToolPtr tool = mServices->trackingService->getActiveTool();
119 Vector3D p_pr = tool->get_prMt().coord(
Vector3D(0, 0, tool->getTooltipOffset()));
120 Vector3D p_r = mServices->patientModelService->get_rMpr().coord(p_pr);
130 Vector3D Navigation::findDataCenter(
const std::vector<DataPtr>& data)
136 void Navigation::moveManualToolToPosition(
Vector3D& p_r)
139 ToolPtr manual = mServices->trackingService->getManualTool();
140 Vector3D p_pr = mServices->patientModelService->get_rMpr().inv().coord(p_r);
146 manual->set_prMt(prM1t);
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Navigation(VisServicesPtr services, CameraControlPtr camera3D=CameraControlPtr())
boost::shared_ptr< class VisServices > VisServicesPtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Image > ImagePtr
DoubleBoundingBox3D findEnclosingBoundingBox(std::vector< DataPtr > data, Transform3D qMr)
bool similar(const DoubleBoundingBox3D &a, const DoubleBoundingBox3D &b, double tol)
boost::shared_ptr< class Data > DataPtr
Transform3D createTransformTranslate(const Vector3D &translation)
void centerToDataInViewGroup(ViewGroupDataPtr group, DataViewProperties properties=DataViewProperties::createFull())
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
boost::shared_ptr< class CameraControl > CameraControlPtr
void centerToDataInActiveViewGroup(DataViewProperties properties=DataViewProperties::createFull())
void centerToPosition(Vector3D p_r, QFlags< VIEW_TYPE > viewType=vBOTH)
boost::shared_ptr< class Tool > ToolPtr