57 this->moveManualToolToPosition(p_r);
59 if (viewType.testFlag(
v2D))
62 mServices->patient()->setCenter(p_r);
65 if (viewType.testFlag(
v3D))
68 mCamera3D->translateByFocusTo(p_r);
74 void Navigation::centerToData(
DataPtr image)
78 Vector3D p_r = image->get_rMd().coord(image->boundingBox().center());
86 void Navigation::centerToData(
const std::vector<DataPtr>& images)
88 Vector3D p_r = findDataCenter(images);
103 std::vector<DataPtr> visibleData = group->getData(properties);
104 if(visibleData.empty())
107 ActiveDataPtr active = mServices->patient()->getActiveData();
109 if(activeImage && std::count(visibleData.begin(), visibleData.end(), activeImage))
110 this->centerToData(activeImage);
112 this->centerToData(visibleData);
120 ToolPtr tool = mServices->tracking()->getActiveTool();
121 Vector3D p_pr = tool->get_prMt().coord(
Vector3D(0, 0, tool->getTooltipOffset()));
122 Vector3D p_r = mServices->patient()->get_rMpr().coord(p_pr);
132 Vector3D Navigation::findDataCenter(
const std::vector<DataPtr>& data)
138 void Navigation::moveManualToolToPosition(
Vector3D& p_r)
141 ToolPtr manual = mServices->tracking()->getManualTool();
142 Vector3D p_pr = mServices->patient()->get_rMpr().inv().coord(p_r);
148 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
boost::shared_ptr< class ActiveData > ActiveDataPtr
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