您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ topLeft函数代码示例

51自学网 2021-06-03 08:55:26
  C++
这篇教程C++ topLeft函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中topLeft函数的典型用法代码示例。如果您正苦于以下问题:C++ topLeft函数的具体用法?C++ topLeft怎么用?C++ topLeft使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了topLeft函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SystemGc

void CSplashContainer::Draw(const TRect & /*aRect*/)const{  CWindowGc &gc = SystemGc();  gc.SetBrushStyle(CGraphicsContext::ENullBrush);  gc.SetBrushColor(KRgbBlack);  gc.DrawRect(Rect());  TPoint topLeft(KTopLeftX, KTopLeftY);  TSize bitmapSize(KSizeWidth, KSizeHeight);  gc.DrawBitmap(TRect(topLeft, bitmapSize), iLogoBitmap);}
开发者ID:Tumunu,项目名称:Mauru,代码行数:12,


示例2: topLeft

RECT MeaCircleTool::GetRegion(){    int radius = m_circle.GetRadius();    CPoint topLeft(m_center.x - radius, m_center.y - radius);    CPoint bottomRight(m_center.x + radius, m_center.y + radius);    CRect rect(topLeft, bottomRight);    rect.InflateRect(0, 0, 1, 1);    return rect;}
开发者ID:craigshaw,项目名称:Meazure,代码行数:12,


示例3: ASSERT

bool SVGInlineTextBox::nodeAtPoint(HitTestResult& result,                                   const HitTestLocation& locationInContainer,                                   const LayoutPoint& accumulatedOffset,                                   LayoutUnit,                                   LayoutUnit) {  // FIXME: integrate with InlineTextBox::nodeAtPoint better.  ASSERT(!isLineBreak());  PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING,                                 result.hitTestRequest(),                                 getLineLayoutItem().style()->pointerEvents());  bool isVisible =      getLineLayoutItem().style()->visibility() == EVisibility::Visible;  if (isVisible || !hitRules.requireVisible) {    if (hitRules.canHitBoundingBox ||        (hitRules.canHitStroke &&         (getLineLayoutItem().style()->svgStyle().hasStroke() ||          !hitRules.requireStroke)) ||        (hitRules.canHitFill &&         (getLineLayoutItem().style()->svgStyle().hasFill() ||          !hitRules.requireFill))) {      LayoutRect rect(topLeft(), LayoutSize(logicalWidth(), logicalHeight()));      rect.moveBy(accumulatedOffset);      if (locationInContainer.intersects(rect)) {        LineLayoutSVGInlineText lineLayoutItem =            LineLayoutSVGInlineText(this->getLineLayoutItem());        const SimpleFontData* fontData =            lineLayoutItem.scaledFont().primaryFont();        DCHECK(fontData);        if (!fontData)          return false;        DCHECK(lineLayoutItem.scalingFactor());        float baseline = fontData->getFontMetrics().floatAscent() /                         lineLayoutItem.scalingFactor();        FloatPoint floatLocation = FloatPoint(locationInContainer.point());        for (const SVGTextFragment& fragment : m_textFragments) {          FloatQuad fragmentQuad = fragment.boundingQuad(baseline);          if (fragmentQuad.containsPoint(floatLocation)) {            lineLayoutItem.updateHitTestResult(                result,                locationInContainer.point() - toLayoutSize(accumulatedOffset));            if (result.addNodeToListBasedTestResult(lineLayoutItem.node(),                                                    locationInContainer,                                                    rect) == StopHitTesting)              return true;          }        }      }    }  }  return false;}
开发者ID:mirror,项目名称:chromium,代码行数:53,


示例4: layout

	void layout() {		rectCount = 0;		minimum = 0;		if (list.isEmpty())			return;		_Expand(rects, list.size()+4, 2.1);		int fills = 0;		qreal filled = 0;		auto calculate = [&filled, &fills, this] (const ItemListAttached *attached) {			filled += 2*O::padding(p, attached);			if (attached->thickness() < 0) {				if (length < 0)					++fills;				else					filled += length;			} else				filled += attached->thickness();		};		runLayoutLoop(calculate);		const auto fill = qMax((O::length(p) - filled)/fills, 0.0);		auto it = rects.begin();		qreal pos = 0;		auto append = [&it, &pos, fill, this] (ItemListAttached *attached) {			qreal total = 2*O::padding(p, attached);			if (attached->thickness() < 0) {				if (length < 0)					total += fill;				else					total += length;			} else				total += attached->thickness();			attached->fill(total);			if (attached->isQmlItem()) {				const auto vpad = pick(attached->verticalPadding(), this->vpad);				const auto hpad = pick(attached->horizontalPadding(), this->hpad);				const auto rect = O::itemRect(p, attached, pos, {hpad, vpad});				auto qml = static_cast<QQuickItem*>(attached->attachee());				qml->setPosition(rect.topLeft());				qml->setSize(rect.size());			}			it->attached = attached;			it->pos = pos;			++it;			pos += total;		};		runLayoutLoop(append);		rectCount = std::distance(rects.begin(), it);		if (_Change(minimum, filled))			emit p->minimumLengthChanged();		p->setGeometryDirty();	}
开发者ID:xylosper,项目名称:koboman,代码行数:52,


示例5: GDALAllRegister

intNBHeightMapper::loadTiff(const std::string& file) {#ifdef HAVE_GDAL    GDALAllRegister();    GDALDataset* poDataset = (GDALDataset*)GDALOpen(file.c_str(), GA_ReadOnly);    if (poDataset == 0) {        WRITE_ERROR("Cannot load GeoTIFF file.");        return 0;    }    const int xSize = poDataset->GetRasterXSize();    const int ySize = poDataset->GetRasterYSize();    double adfGeoTransform[6];    if (poDataset->GetGeoTransform(adfGeoTransform) == CE_None) {        Position topLeft(adfGeoTransform[0], adfGeoTransform[3]);        mySizeOfPixel.set(adfGeoTransform[1], adfGeoTransform[5]);        const double horizontalSize = xSize * mySizeOfPixel.x();        const double verticalSize = ySize * mySizeOfPixel.y();        myBoundary.add(topLeft);        myBoundary.add(topLeft.x() + horizontalSize, topLeft.y() + verticalSize);    } else {        WRITE_ERROR("Could not parse geo information from " + file + ".");        return 0;    }    const int picSize = xSize * ySize;    myRaster = (int16_t*)CPLMalloc(sizeof(int16_t) * picSize);    for (int i = 1; i <= poDataset->GetRasterCount(); i++) {        GDALRasterBand* poBand = poDataset->GetRasterBand(i);        if (poBand->GetColorInterpretation() != GCI_GrayIndex) {            WRITE_ERROR("Unknown color band in " + file + ".");            clearData();            break;        }        if (poBand->GetRasterDataType() != GDT_Int16) {            WRITE_ERROR("Unknown data type in " + file + ".");            clearData();            break;        }        assert(xSize == poBand->GetXSize() && ySize == poBand->GetYSize());        if (poBand->RasterIO(GF_Read, 0, 0, xSize, ySize, myRaster, xSize, ySize, GDT_Int16, 0, 0) == CE_Failure) {            WRITE_ERROR("Failure in reading " + file + ".");            clearData();            break;        }    }    GDALClose(poDataset);    return picSize;#else    UNUSED_PARAMETER(file);    WRITE_ERROR("Cannot load GeoTIFF file since SUMO was compiled without GDAL support.");    return 0;#endif}
开发者ID:fieryzig,项目名称:sumo,代码行数:52,


示例6: Json

Rectangle::operator Json() const{    Json j;    cv::Point2f topleft = topLeft();    j[top_left_x_Key] = topleft.x;    j[top_left_y_Key] = topleft.y;    cv::Point2f bottomRight = topRight();    j[bottom_right_x_Key] = bottomRight.x;    j[bottom_right_y_Key] = bottomRight.y;    return j;}
开发者ID:RafalAndrusieczko,项目名称:StudyBox_CV,代码行数:13,


示例7: rect

void CHlpView::SizeChanged()	{	const TInt KKludgeFactor = 4;	TRect rect(Position(), Rect().Size());	TSize choiceListSize = iHelpCategories->MinimumSize() + TSize(0, KKludgeFactor);	TPoint topLeft(rect.iTl);	iHelpCategories->SetExtent(topLeft, TSize(rect.Width()/2, choiceListSize.iHeight));	iHelpTopicsForCategory->SetExtent(TPoint(rect.Size().iWidth/2,topLeft.iY), TSize(rect.Size().iWidth/2, choiceListSize.iHeight));	iRichTextEditor->SetRect(TRect(TPoint(topLeft.iX, choiceListSize.iHeight), rect.iBr));	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:13,


示例8: topLeft

void SimpleGraphicsView::setCurrentLabelPositionFromTextField(ivec2 pos) {    if (currentRectItem_) {        SimpleWithRectangleLabel* rectItem = qgraphicsitem_cast<SimpleWithRectangleLabel*>(currentRectItem_);        if (rectItem) {            vec2 topLeft(pos.x, pos.y);            QRectF rect = rectItem->mapRectToScene(rectItem->rect());            vec2 rectSize(rect.size().width(), rect.size().height());            topLeft = topLeft - (rectSize/2.0f);            rectItem->setPos(QPointF(topLeft.x, topLeft.y));        }    }}
开发者ID:Ojaswi,项目名称:inviwo,代码行数:13,


示例9: CorrectForAspectRatio

// Return the largest rectangle that fits in aRect and has the// same aspect ratio as aRatio, centered at the center of aRectstatic gfxRectCorrectForAspectRatio(const gfxRect& aRect, const nsIntSize& aRatio){  NS_ASSERTION(aRatio.width > 0 && aRatio.height > 0 && !aRect.IsEmpty(),               "Nothing to draw");  // Choose scale factor that scales aRatio to just fit into aRect  gfxFloat scale =    PR_MIN(aRect.Width()/aRatio.width, aRect.Height()/aRatio.height);  gfxSize scaledRatio(scale*aRatio.width, scale*aRatio.height);  gfxPoint topLeft((aRect.Width() - scaledRatio.width)/2,                   (aRect.Height() - scaledRatio.height)/2);  return gfxRect(aRect.TopLeft() + topLeft, scaledRatio);}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:15,


示例10: extend

void BitmapImage::drawEllipse( QRectF rectangle, QPen pen, QBrush brush, QPainter::CompositionMode cm, bool antialiasing){    int width = pen.width();    extend( rectangle.adjusted(-width,-width,width,width).toRect() );    if (brush.style() == Qt::RadialGradientPattern)    {        QRadialGradient* gradient = (QRadialGradient*)brush.gradient();        gradient->setCenter( gradient->center() - topLeft() );        gradient->setFocalPoint( gradient->focalPoint() - topLeft() );    }    if (mImage != NULL && !mImage->isNull() )    {        QPainter painter(mImage);        painter.setCompositionMode(cm);        painter.setRenderHint(QPainter::Antialiasing, antialiasing);        painter.setPen(pen);        painter.setBrush(brush);        //if (brush == Qt::NoBrush)        painter.drawEllipse( rectangle.translated(-topLeft()) );        painter.end();    }}
开发者ID:meiavy,项目名称:pencil-1,代码行数:22,


示例11: QRubberBand

void Crop::setup(){    rubberBand = new QRubberBand(QRubberBand::Rectangle, this);    QPoint topLeft(x, y);    QPoint bottomRight(x + width, y + height);    image = new QRect(topLeft, bottomRight);    toDraw = false;    toClear = false;    cropping = QRect(0,0,0,0);}
开发者ID:azar923,项目名称:sandboxQt,代码行数:13,


示例12: frameWidth

void TableSideSelector::paintEvent(QPaintEvent* event){	double edgeWidth = 5;	double inset = edgeWidth/2 + frameWidth()*2;	QPointF topLeft(inset, inset);	QPointF topRight(width() - inset, inset);	QPointF bottomLeft(inset, height() - inset);	QPointF bottomRight(width() - inset, height() - inset);	m_left = QLineF(topLeft, bottomLeft);	m_right = QLineF(topRight, bottomRight);	m_top = QLineF(topRight, topLeft);	m_bottom = QLineF(bottomRight, bottomLeft);	QPainter painter(this);	// Paint selection.	painter.setPen(QPen(Qt::black, edgeWidth, Qt::SolidLine, Qt::RoundCap));	if (m_selection & Left) painter.drawLine(m_left);	if (m_selection & Right) painter.drawLine(m_right);	if (m_selection & Top) painter.drawLine(m_top);	if (m_selection & Bottom) painter.drawLine(m_bottom);	// Paint the dotted grid.	painter.setPen(QPen(Qt::gray, edgeWidth/4, Qt::DotLine));	painter.drawRect(QRectF(topLeft, bottomRight));	painter.drawLine(m_left.pointAt(0.5), m_right.pointAt(0.5));	painter.drawLine(m_top.pointAt(0.5), m_bottom.pointAt(0.5));	// Paint highlighting.	painter.setPen(QPen(QColor(255, 255, 255, 60), edgeWidth, Qt::SolidLine, Qt::RoundCap));	switch (m_highlighted)	{	case Left:		painter.drawLine(m_left);		break;	case Right:		painter.drawLine(m_right);		break;	case Top:		painter.drawLine(m_top);		break;	case Bottom:		painter.drawLine(m_bottom);		break;	default:		break;	}}
开发者ID:Fahad-Alsaidi,项目名称:scribus-svn,代码行数:50,


示例13: topLeft

void tag_recognition::cutWords(cv::Mat wordsMask, cv::Mat rawDst, cv::Mat &word1, cv::Mat &word2){    std::vector < std::vector<cv::Point2f> > rotatedBlobs;    cv::normalize(wordsMask,wordsMask,0,1,cv::NORM_MINMAX);    this->findBlobs(wordsMask,rotatedBlobs);    rotatedBlobs = this->removeImpossibleBlobs(rotatedBlobs);    //    qDebug() << rotatedBlobs.size();    if(rotatedBlobs.size() < 2)    {        cv::normalize(wordsMask,wordsMask,0,255,cv::NORM_MINMAX);//        cv::imshow("WTF",wordsMask);        word1 = cv::Mat::zeros(1,1,CV_8UC1);        word2 = cv::Mat::zeros(1,1,CV_8UC1);        return;    }    std::vector<cv::Point2f> topLeft(rotatedBlobs.size());    std::vector<cv::Point2f> downRight(rotatedBlobs.size());    for(int i = 0; i < rotatedBlobs.size(); i++)    {        topLeft[i] = cv::Point2f(tagSize,tagSize);        downRight[i] = cv::Point2f(0,0);        for(int j=0; j < rotatedBlobs[i].size(); j++)        {            if(topLeft[i].x > rotatedBlobs[i][j].x)                topLeft[i].x = rotatedBlobs[i][j].x;            if(topLeft[i].y > rotatedBlobs[i][j].y)                topLeft[i].y = rotatedBlobs[i][j].y;            if(downRight[i].x < rotatedBlobs[i][j].x)                downRight[i].x = rotatedBlobs[i][j].x;            if(downRight[i].y < rotatedBlobs[i][j].y)                downRight[i].y = rotatedBlobs[i][j].y;        }        //        qDebug() << topLeft.x << topLeft.y << downRight.x << downRight.y;        //        cv::imshow(std::to_string(i),dst);    }    if(topLeft[0].x < topLeft[1].x)    {        cv::getRectSubPix(rawDst,cv::Size(downRight[0].x-topLeft[0].x+4,downRight[0].y-topLeft[0].y+4),(downRight[0]+topLeft[0])/2,word1);        cv::getRectSubPix(rawDst,cv::Size(downRight[1].x-topLeft[1].x+4,downRight[1].y-topLeft[1].y+4),(downRight[1]+topLeft[1])/2,word2);    }    else    {        cv::getRectSubPix(rawDst,cv::Size(downRight[0].x-topLeft[0].x+4,downRight[0].y-topLeft[0].y+4),(downRight[0]+topLeft[0])/2,word2);        cv::getRectSubPix(rawDst,cv::Size(downRight[1].x-topLeft[1].x+4,downRight[1].y-topLeft[1].y+4),(downRight[1]+topLeft[1])/2,word1);    }}
开发者ID:jefftsai8049,项目名称:BeeObservationSystem_Analysis,代码行数:50,


示例14: height

void CProgressBar::drawRects(QPainter *painter){    painter->save();    painter->setPen(Qt::NoPen);    painter->setRenderHints(QPainter::Antialiasing);    qreal initX = PI_EXTRA_SPACE;    qreal top = PI_EXTRA_SPACE;    qreal bottom = height() - PI_EXTRA_SPACE;    qreal rectWidth = (qreal)(width() - PI_RECT_COUNT * PI_EXTRA_SPACE)/PI_RECT_COUNT;    for(int rectIndex = 0 ; rectIndex <= PI_RECT_COUNT ; rectIndex++)    {        QPointF topLeft(initX,top);        QPointF bottomRight(initX + rectWidth,bottom);        QRectF theRect(topLeft,bottomRight);        if(rectIndex <= m_nCurrValue )        {            QLinearGradient rectGradient(theRect.topLeft(),theRect.topRight());            rectGradient.setColorAt(0.0,QColor(85,120,0));            rectGradient.setColorAt(0.1,QColor(70,150,20));            rectGradient.setColorAt(0.5,QColor(70,220,20));            rectGradient.setColorAt(0.9,QColor(70,150,20));            rectGradient.setColorAt(1.0,QColor(85,120,0));            painter->setBrush(rectGradient);            if(rectIndex == m_nCurrValue)            {                emit sig_Finished();            }        }		else		{            QLinearGradient rectGradient(theRect.topLeft(),theRect.topRight());            rectGradient.setColorAt(0.0,QColor(120,120,120));            rectGradient.setColorAt(0.1,QColor(160,160,160));            rectGradient.setColorAt(0.5,QColor(210,210,210));            rectGradient.setColorAt(0.9,QColor(160,160,160));            rectGradient.setColorAt(1.0,QColor(120,120,120));            painter->setBrush(rectGradient);        }        painter->drawRoundedRect(theRect,PI_ANGLE_RADIUS,PI_ANGLE_RADIUS);        initX +=rectWidth + PI_EXTRA_SPACE;    }    painter->restore();}
开发者ID:radtek,项目名称:isoftstone,代码行数:50,


示例15: Retrieve

// 获取矩形范围内,所有四叉树的所有物体// 如果这个矩形是完全处于一个四叉树中的,那么跟Retrieve返回的结果一样// 如果这个矩形处于多个四叉树中,那么需要获取它所在的四叉树,以及它四个点所在四叉树的物体void FixedQuadTree::RetrieveArea(const plane_shooting::Rectangle& rect, list<Object*>& objList) {	Retrieve(rect, objList);	// 左上顶点	Rectangle topLeft(rect.x - rect.fWidth / 2, rect.y + rect.fHeight / 2, 0, 1);	// 右上顶点	Rectangle topRight(rect.x + rect.fWidth / 2, rect.y + rect.fHeight / 2, 0, 1);	// 左下顶点	Rectangle bottomLeft(rect.x - rect.fWidth / 2, rect.y - rect.fHeight / 2, 0, 1);	// 右下顶点	Rectangle bottomRight(rect.x + rect.fWidth / 2, rect.y - rect.fHeight / 2, 0, 1);	// TODO , 改成直接返回list<Object*>列表指针}
开发者ID:lovemychobits,项目名称:game_server,代码行数:17,


示例16: FindLaplacianValue

		float FindLaplacianValue(			const MatrixF& img,			const Remapping& remapping,			float gvalue,			int level,			int row,			int col )		{			//find the total size we need			int size = 3 * ( pow(2.0f,level+2) - 1 );			int halfSize = size / 2;			//find the corresponding point from that level to original image			int rowTemp = row*pow(2.0f,level);			int colTemp = col*pow(2.0f,level);			//copy the whole block (replicating when necessary)			MatrixF mat[2];			MatrixF* dest0 = &(mat[0]);			MatrixF* dest1 = &(mat[1]);			Point topLeft( colTemp - halfSize, rowTemp - halfSize );			Point bottomRight( colTemp + halfSize, rowTemp + halfSize );			Copy( img, topLeft, bottomRight, *dest0 );			RemapImage(*dest0, gvalue, remapping, *dest0);			Pyramid::Gaussian( *dest0, *dest1, 0.4f );			Copy( *dest1, Point(2,2), Point(dest1->Cols()-3,dest1->Rows()-3), *dest1);			Decimate(*dest1,*dest1);			for(int i = 0; i < level; ++i)			{				std::swap( dest0, dest1 );				Pyramid::Gaussian( *dest0, *dest1, 0.4f );				Copy( *dest1, Point(2,2), Point(dest1->Cols()-3,dest1->Rows()-3), *dest1);				Decimate(*dest1,*dest1);			}			//expand			assert( dest1->Rows() == 3 );			assert( dest1->Cols() == 3 );			ExpandOdd( *dest1, *dest1, 0.4f ); //now 5X5			//we need to also reduce dest0			Copy( *dest0, Point(2,2), Point(dest0->Cols()-3,dest0->Rows()-3), *dest0);			MatrixF laplacian;			Subtract(*dest0, *dest1, laplacian);			return laplacian[laplacian.Rows()/2][laplacian.Cols()/2];		}
开发者ID:AngelOnFira,项目名称:samples,代码行数:49,


示例17: getParentTextDomArea

void FixedHeightLayoutManager::calculateLineHeight(void){		// calculating the character height using 'A' as the standard character		heightOfLine = LINEHEIGHT;				UInt32 lineSpacing = getParentTextDomArea()->getLineSpacing();		Vec2f topLeft(0,0),bottomRight(0,0);		if(getParentTextDomArea()->getFont())		{			getParentTextDomArea()->getFont()->getBounds("A",topLeft,bottomRight);			heightOfLine = bottomRight.y() - topLeft.y();		}}
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:15,


示例18: topLeft

void BlockRemoveButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *){    painter->setPen(m_Pen);    painter->setBrush(m_Brush);        QPointF topLeft(0, 0);    QPointF bottomRight(m_Width, m_Height);    QRectF rect(topLeft, bottomRight);    painter->drawEllipse(rect);    qreal widthPer4 = m_Width / 4.0;    qreal heightPer4 = m_Height / 4.0;    painter->drawLine(widthPer4, heightPer4, 3 * widthPer4, 3 * heightPer4);    painter->drawLine(widthPer4, 3 * heightPer4, 3 * widthPer4, heightPer4);}
开发者ID:ylliac,项目名称:qcircuit,代码行数:15,


示例19: topLeft

// ---------------------------------------------------------------------------// CEikCapCArray::MoveLineToScreen// ---------------------------------------------------------------------------//void CEikCapCArray::MoveLineToScreen( TInt aLine, TInt aTopY, TBool aVisible ){    if ( aLine != -1 && aLine < Count() )    {        CEikCaptionedControl* line = (*this)[aLine];        TPoint topLeft( 1000, 0 );        if ( aVisible )        {            topLeft.SetXY( Rect().iTl.iX, LineIndexToYPosition( aLine, aTopY ) );        }        line->SetRect( TRect( topLeft, line->Size() ) );    }}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:19,


示例20: DisplayHelpBalloons

// --------------------------------------------------------------------------------------void DisplayHelpBalloons(WindowRef prefsWindow){	GrafPtr savedPort;	Point mouseLocation;	Rect hotRects[3];	short hotRectID;	static int previousHotRectID = kNotInHotRect;		GetPort(&savedPort);	SetPortWindowPort(prefsWindow);		GetMouse(&mouseLocation);		GetWindowProperty(prefsWindow, kAppSignature, kHotRectsTag, 3 * sizeof(Rect), NULL, 						hotRects);		for (hotRectID = kInList; hotRectID < kNotInHotRect; hotRectID++)	{		if (PtInRect(mouseLocation, &hotRects[hotRectID]))		{			if (hotRectID != previousHotRectID)			{				HMMessageRecord helpMessage;				Point tips[3];								helpMessage.hmmHelpType = khmmStringRes;				helpMessage.u.hmmStringRes.hmmResID = rHelpStrings;				helpMessage.u.hmmStringRes.hmmIndex = hotRectID + 1;								GetWindowProperty(prefsWindow, kAppSignature, kBalloonTipsTag, 									3 * sizeof(Point), NULL, tips);				LocalToGlobal(&tips[hotRectID]);								LocalToGlobal(&topLeft(hotRects[hotRectID]));				LocalToGlobal(&botRight(hotRects[hotRectID]));								HMShowBalloon(&helpMessage, tips[hotRectID], &hotRects[hotRectID], NULL, 								kBalloonWDEFID, kTopLeftTipPointsLeftVariant, 								kHMRegularWindow);			}							break;		}	}		previousHotRectID = hotRectID;	SetPort(savedPort);}
开发者ID:fruitsamples,项目名称:CarbonPorting,代码行数:49,


示例21: GetWidget

void nsScrollPortView::Scroll(nsView *aScrolledView, nsPoint aTwipsDelta, nsPoint aPixDelta,                              float aT2P){  if (aTwipsDelta.x != 0 || aTwipsDelta.y != 0)  {    nsIWidget *scrollWidget = GetWidget();    PRBool canBitBlit = scrollWidget && !CannotBitBlt(aScrolledView);    if (canBitBlit) {      // We're going to bit-blit.  Let the viewmanager know so it can      // adjust dirty regions appropriately.      mViewManager->WillBitBlit(this, aTwipsDelta);    }        if (!scrollWidget)    {      NS_ASSERTION(!canBitBlit, "Someone screwed up");      nsPoint offsetToWidget;      GetNearestWidget(&offsetToWidget);      // We're moving the child widgets because we are scrolling. But      // the child widgets may stick outside our bounds, so their area      // may include area that's not supposed to be scrolled. We need      // to invalidate to ensure that any such area is properly      // repainted back to the right rendering.      AdjustChildWidgets(aScrolledView, offsetToWidget, aT2P, PR_TRUE);      // If we don't have a scroll widget then we must just update.      // We should call this after fixing up the widget positions to be      // consistent with the view hierarchy.      mViewManager->UpdateView(this, 0);    } else if (!canBitBlit) {      // We can't blit for some reason.      // Just update the view and adjust widgets      // Recall that our widget's origin is at our bounds' top-left      nsRect bounds(GetBounds());      nsPoint topLeft(bounds.x, bounds.y);      AdjustChildWidgets(aScrolledView,                         GetPosition() - topLeft, aT2P, PR_FALSE);      // We should call this after fixing up the widget positions to be      // consistent with the view hierarchy.      mViewManager->UpdateView(this, 0);    } else { // if we can blit and have a scrollwidget then scroll.      // Scroll the contents of the widget by the specfied amount, and scroll      // the child widgets      scrollWidget->Scroll(aPixDelta.x, aPixDelta.y, nsnull);      mViewManager->UpdateViewAfterScroll(this);    }  }}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:48,


示例22: topLeft

void ofApp::setupScene(int width, int height){    /* setup camera */    double aspectRatio = static_cast<double>(width) / height;    ofVec3f topLeft (-CAMERA_SIZE * aspectRatio,  CAMERA_SIZE, 0.0);    ofVec3f botLeft (-CAMERA_SIZE * aspectRatio, -CAMERA_SIZE, 0.0);    ofVec3f botRight( CAMERA_SIZE * aspectRatio, -CAMERA_SIZE, 0.0);    cam = OffAxisCamera(topLeft, botLeft, botRight);    cam.setPosition(ofVec3f(0.0, 0.0, 50.0f));    /* calculate grid box dimension */    ofVec3f camWidthVec = botRight - botLeft;    double camWidth = camWidthVec.length();    gridBox = GridBox(ofVec3f(-CAMERA_SIZE * aspectRatio, -CAMERA_SIZE, 0.0f),            camWidth, camWidth / aspectRatio, 8.0f);}
开发者ID:wiped1,项目名称:vr3d,代码行数:16,


示例23: extend

void BitmapImage::drawEllipse( QRectF rectangle, QPen pen, QBrush brush, QPainter::CompositionMode cm, bool antialiasing){    int width = pen.width();    extend( rectangle.adjusted(-width,-width,width,width).toRect() );    if (image != NULL && !image->isNull() )    {        QPainter painter(image);        painter.setCompositionMode(cm);        painter.setRenderHint(QPainter::Antialiasing, antialiasing);        painter.setPen(pen);        painter.setBrush(brush);        //if (brush == Qt::NoBrush)        painter.drawEllipse( rectangle.translated(-topLeft()) );        painter.end();    }}
开发者ID:sarathms,项目名称:pencil,代码行数:16,


示例24: topLeft

Prism::DebugFont::CharacterData Prism::DebugFont::GetCharData(char aChar){	int x = aChar % 16;	int y = aChar / 16;		CU::Vector2<float> topLeft(x * myCharSize.x, y * myCharSize.y);	CU::Vector2<float> bottomLeft(topLeft.x + myCharSize.x, topLeft.y + myCharSize.y);	CharacterData data;	data.myTopLeftUV = topLeft / 512.f;	data.myBottomRightUV = bottomLeft / 512.f;	return data;}
开发者ID:LastVision,项目名称:ModelViewer,代码行数:16,


示例25: topLeft

void CIndicator::drawLCDNums(QPainter* painter){    painter->save();    int topLeftX=boundingRect().width()/10;    int topLeftY=boundingRect().height()-m_topSpace-m_lcdHeight;    QPointF topLeft(topLeftX,topLeftY);    for(int i=0;i<INDICATOR_COUNT;i++)    {        lcd[i]->resize(m_lcdWidth,m_lcdHeight);        lcd[i]->moveBy(topLeftX,topLeftY);        topLeftX+=m_lcdWidth;    }    painter->restore();}
开发者ID:radtek,项目名称:isoftstone,代码行数:16,


示例26: topLeft

void TalkablePainter::computeIconRect(){    QPoint topLeft(CheckboxRect.x() + CheckboxRect.width(), ItemRect.y());    IconRect = QRect(topLeft, QSize(0, 0));    const QPixmap &paintedIcon = icon();    if (paintedIcon.isNull())        return;    IconRect.setSize(paintedIcon.size() + QSize(HFrameMargin, 0));    if (!Configuration->alignTop())        IconRect.moveTop(ItemRect.top() + (ItemRect.height() - paintedIcon.height()) / 2);    else if (fontMetrics().lineSpacing() > paintedIcon.height())        IconRect.moveTop(ItemRect.top() + (fontMetrics().lineSpacing() - paintedIcon.height()) / 2);}
开发者ID:vogel,项目名称:kadu,代码行数:16,


示例27: Q_UNUSED

void ScriptEditorCloseButton::paint(QPainter* p,                                    const QStyleOptionGraphicsItem* o,                                    QWidget* w){    Q_UNUSED(o);    Q_UNUSED(w);    auto br = boundingRect();    p->setPen(QPen(Colors::base06, 3));    int offset = 6;    p->drawLine(br.bottomLeft() + QPointF(offset, -offset),                br.topRight() - QPointF(offset, -offset));    p->drawLine(br.topLeft() + QPointF(offset, offset),                br.bottomRight() - QPointF(offset, offset));}
开发者ID:denji,项目名称:antimony,代码行数:16,



注:本文中的topLeft函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ topLevelItem函数代码示例
C++ top函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。