本文整理汇总了C++中CAMptr::set_min方法的典型用法代码示例。如果您正苦于以下问题:C++ CAMptr::set_min方法的具体用法?C++ CAMptr::set_min怎么用?C++ CAMptr::set_min使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAMptr
的用法示例。
在下文中一共展示了CAMptr::set_min方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: curpt
int
Cam_int::zoom2(
CEvent &e,
State *&
)
{
if (debug_fsa)
cerr << "Cam_int::zoom2"
<< endl;
DEVice_2d *ptr = (DEVice_2d *)e._d;
CAMptr cam (e.view()->cam());
PIXEL curpt (ptr->cur());
XYpt startpt(_start_pix);
int w,h; e.view()->get_size(w,h);
double zoom_factor = 1 + Sign(ptr->delta()[0]) *
(PIXEL(ptr->cur())-PIXEL(ptr->old())).length()/(w/4);
cam->set_zoom(cam->zoom() * zoom_factor);
cam->set_min (cam->min() + NDCvec(XYpt(_start_pix) - startpt));
ptr->set_cur(curpt);
cam->data()->changed();
return 0;
}
示例2: data
int
Cam_int::rot(
CEvent &e,
State *&
)
{
if (debug_fsa)
cerr << "Cam_int::rot"
<< endl;
CAMptr cam (e.view()->cam());
CAMdataptr data(cam->data());
DEVice_2d *ptr=(DEVice_2d *)e._d;
cam->set_zoom(1);
cam->set_min(NDCpt(XYpt(-1,-1)));
cam->data()->changed();
XYpt cpt = data->center();
double radsq = sqr(1+fabs(cpt[0])); // squared rad of virtual cylinder
XYpt tp = ptr->old();
XYpt te = ptr->cur();
Wvec op (tp[0], 0, 0); // get start and end X coordinates
Wvec oe (te[0], 0, 0); // of cursor motion
double opsq = op * op, oesq = oe * oe;
double lop = opsq > radsq ? 0 : sqrt(radsq - opsq);
double loe = oesq > radsq ? 0 : sqrt(radsq - oesq);
Wvec nop = Wvec(op[0], 0, lop).normalized();
Wvec noe = Wvec(oe[0], 0, loe).normalized();
double dot = nop * noe;
if (fabs(dot) > 0.0001) {
data->rotate(Wline(data->center(), Wvec::Y()),
-2*Acos(dot) * Sign(te[0]-tp[0]));
double rdist = te[1]-tp[1];
CAMdata dd = CAMdata(*data);
Wline raxe(data->center(),data->right_v());
data->rotate(raxe, rdist);
data->set_up(data->from() + Wvec::Y());
if (data->right_v() * dd.right_v() < 0)
*data = dd;
}
return 0;
}
示例3: cam
int
Cam_int_edit::pan2(
CEvent &e,
State *&
)
{
DEVice_2d *ptr=(DEVice_2d *)e._d;
CAMptr cam (e.view()->cam());
PIXEL curpt(ptr->cur());
cam->set_min(cam->min() + NDCvec(ptr->delta()));
cam->data()->changed();
ptr->set_cur(curpt);
return 0;
}
示例4: cam
int
Cam_int::pan2(
CEvent &e,
State *&
)
{
if (debug_fsa)
cerr << "Cam_int::pan2"
<< endl;
DEVice_2d *ptr=(DEVice_2d *)e._d;
CAMptr cam (e.view()->cam());
PIXEL curpt(ptr->cur());
cam->set_min(cam->min() + NDCvec(ptr->delta()));
cam->data()->changed();
ptr->set_cur(curpt);
return 0;
}