本文整理汇总了C++中spGframe_t::getSelView方法的典型用法代码示例。如果您正苦于以下问题:C++ spGframe_t::getSelView方法的具体用法?C++ spGframe_t::getSelView怎么用?C++ spGframe_t::getSelView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spGframe_t
的用法示例。
在下文中一共展示了spGframe_t::getSelView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showIntensity
void AxisInfo::showIntensity(spGframe_t gf, int x, int y, bool updateSlaves, double mag) {
spViewInfo_t view = gf->getSelView();
if(view == nullView) return;
int i,j;
if(mag == 0.0) gf->getPositionInfo(view,x,y,i,j,mag);
char str[64];
sprintf(str,"%d",(int)mag);
bool showLabel = true;
int xmin = gf->pixstx;
int xmax = gf->pixstx + gf->pixwd - 3;
int ymin = gf->pixsty;
int ymax = gf->pixsty + gf->pixht - 3;
if(x < xmin || x > xmax || y < ymin || y > ymax) return;
/*
if(crosshair && getReal("aipMode",1) == 3 && updateSlaves) {
GraphicsWin::drawLine(x,ymin,x,ymax, labelColor);
GraphicsWin::drawLine(xmin,y,xmax,y, labelColor);
} else {
GraphicsWin::drawLine(x-3,y-3,x+3,y+3, labelColor);
GraphicsWin::drawLine(x+3,y-3,x-3,y+3, labelColor);
}
*/
// Get width and height of a character (cwd, cht)
int ascent;
int descent;
int cwd; // string width
int cht; // string height
GraphicsWin::getTextExtents(str, 12, &ascent, &descent, &cwd);
cht = ascent + descent;
cwd = (int)(cwd*12.0/14.0); // getTextExtents calls a function that assume font size 14
int px = x+8;
if(px <= xmin) showLabel=false;
if(px+cwd+1 >= xmax) px -= cwd;
if(px <= xmin) showLabel=false;
int py = y;
if(py <= ymin+cht) py = y+cht;
if(py >=ymax) showLabel=false;
if(showLabel)
GraphicsWin::drawString(str, px, py, labelColor, 0,0,0);
if(updateSlaves && getReal("aipRoiBind",0) > 0) {
double ux,uy,uz;
pixToMagnet(view,(double)x, (double)y, 0.0,ux,uy,uz);
spGframe_t frame;
GframeManager *gfm = GframeManager::get();
GframeList::iterator gfi;
for (frame=gfm->getFirstFrame(gfi); frame != nullFrame; frame
=gfm->getNextFrame(gfi)) {
if(frame == gf || !gfm->isFrameDisplayed(frame)) continue;
view = frame->getFirstView();
if(view == nullView) return;
double dx,dy,dz;
magnetToPix(view,ux,uy,uz,dx,dy,dz);
showIntensity(frame,(int)dx, (int)dy, false);
}
}
}