36 this->moveManualToolToPosition(p_r);
38 if (viewType.testFlag(
v2D))
41 mServices->patient()->setCenter(p_r);
44 if (viewType.testFlag(
v3D))
47 mCamera3D->translateByFocusTo(p_r);
53 void Navigation::centerToData(
DataPtr image)
57 Vector3D p_r = image->get_rMd().coord(image->boundingBox().center());
65 void Navigation::centerToData(
const std::vector<DataPtr>& images)
67 Vector3D p_r = findDataCenter(images);
82 std::vector<DataPtr> visibleData = group->getData(properties);
83 if(visibleData.empty())
88 if(activeImage && std::count(visibleData.begin(), visibleData.end(), activeImage))
89 this->centerToData(activeImage);
91 this->centerToData(visibleData);
99 ToolPtr tool = mServices->tracking()->getActiveTool();
100 Vector3D p_pr = tool->get_prMt().coord(
Vector3D(0, 0, tool->getTooltipOffset()));
101 Vector3D p_r = mServices->patient()->get_rMpr().coord(p_pr);
111 Vector3D Navigation::findDataCenter(
const std::vector<DataPtr>& data)
117 void Navigation::moveManualToolToPosition(
Vector3D& p_r)
120 ToolPtr manual = mServices->tracking()->getManualTool();
121 Vector3D p_pr = mServices->patient()->get_rMpr().inv().coord(p_r);
127 manual->set_prMt(prM1t);
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Navigation(VisServicesPtr services, CameraControlPtr camera3D=CameraControlPtr())
boost::shared_ptr< class CameraControl > 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)
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.
void centerToDataInActiveViewGroup(DataViewProperties properties=DataViewProperties::createFull())
bool similar(const CameraInfo &lhs, const CameraInfo &rhs, double tol)
void centerToPosition(Vector3D p_r, QFlags< VIEW_TYPE > viewType=vBOTH)
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr