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

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

51自学网 2021-06-01 20:30:12
  C++
这篇教程C++ DrawShape函数代码示例写得很实用,希望能帮到您。

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

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

示例1: painter

void Orientation_Widget::paintEvent(QPaintEvent * event){	(void)event;	QPainter painter(this);	// Draw the border and fill the background	painter.setRenderHint(QPainter::Antialiasing, false);	painter.setBrush( painter.background() );	painter.setPen( Qt::NoPen );	painter.drawRect( 0, 0, width(), height() );	painter.setBrush( Qt::NoBrush );	painter.setPen( QPen( QColor::fromRgb(0,0,0)) );	painter.setRenderHint(QPainter::Antialiasing, true);	CenterX = (float)(width() / 2);	CenterY = (float)(height() / 2);	DrawScale = ViewScale * ((float)width()/ 560.0f);	if(bQuat2Valid) {		DrawShape( painter, mat2, QColor::fromRgb(192,192,192), QuadPt, QuadLine );	}	DrawShape( painter, mat, QColor::fromRgb(0,0,0), QuadPt, QuadLine );}
开发者ID:MatzElectronics,项目名称:Flight-Controller,代码行数:28,


示例2: DoMouseMove

void DoMouseMove(HWND hWnd,LONG lParam){    HDC hdc;    if (mouseDown)    {	hdc = GetDC(hWnd);	/*	 * Erase the old shape.	 */	SaveROP = SetROP2(hdc,R2_NOTXORPEN);	DrawShape(hdc, thisShape[CurrentPoint].Points.left,		  thisShape[CurrentPoint].Points.top, oldx, oldy,		  thisShape[CurrentPoint].theShape,		  thisShape[CurrentPoint].PenWidth,		  thisShape[CurrentPoint].PenColor, 1);	/*	 * At this point, the slope must be positive because	 * the coordinates could not have been switched.	 * The next step is to draw the new shape.	 */	oldx = LOWORD(lParam);	oldy = HIWORD(lParam);	DrawShape(hdc, thisShape[CurrentPoint].Points.left,		  thisShape[CurrentPoint].Points.top, oldx, oldy,		  thisShape[CurrentPoint].theShape,		  thisShape[CurrentPoint].PenWidth,		  thisShape[CurrentPoint].PenColor, 1);	SetROP2(hdc,SaveROP);	ReleaseDC(hWnd,hdc);    }}
开发者ID:nicolaemariuta,项目名称:bachelorHomeworkAndStudy,代码行数:34,


示例3: ProcessFace

static void ProcessFace(    CImage&      cimg,      // io: color version of image    const float* landmarks, // in    int          nfaces,    // in    const char*  imgpath)   // in{    Shape shape(LandmarksAsShape(landmarks));    shape = ConvertShape(shape, nlandmarks_g);    if (shape.rows == 0)        Err("Cannot convert to a %d point shape", nlandmarks_g);    if (writeimgs_g)        DrawShape(cimg, shape);    if (multiface_g)    {        logprintf("face %d/n", nfaces);        double xmin, xmax, ymin, ymax; // needed to position face nbr        ShapeMinMax(xmin, xmax, ymin, ymax, shape);        ImgPrintf(cimg,                  (xmin + xmax)/2, ymin - (ymax-ymin)/50., 0xff0000, 1,                 "%d", nfaces);    }    if (csv_g)        LogShapeAsCsv(shape, imgpath);    else        LogShape(shape, imgpath);}
开发者ID:apprisi,项目名称:stasm4,代码行数:26,


示例4: WriteLandmarkedImg

static void WriteLandmarkedImg(    const Image& img,         // in: the image    const char*  newpath,     // in: the image path    const Shape& shape,       // in: the shape    const Shape& cropshape,   // in: crop image to this shape (typically the ref shape)    unsigned     color=C_RED, // in: rrggbb e.g. 0xff0000 is red    int          iworst=-1)   // in: index of worst fitting point, -1 for none{    CImage cimg; cvtColor(img, cimg, CV_GRAY2BGR); // color image    if (iworst >= 0) // draw circle at worst fitting point?        cv::circle(cimg,                   cv::Point(cvRound(shape(iworst, IX)),                             cvRound(shape(iworst, IY))),                   MAX(2, cvRound(ShapeWidth(shape) / 40)),                   cv::Scalar(255, 255, 0), 2); // cyan    DrawShape(cimg, shape, color);    if (crop_g)        CropCimgToShapeWithMargin(cimg, cropshape);    if (!cv::imwrite(newpath, cimg))        Err("Cannot write %s", newpath);}
开发者ID:avtomaton,项目名称:stasm,代码行数:25,


示例5: DrawNode

void DrawNode(R3Scene *scene, R3Node *node){  // Push transformation onto stack  glPushMatrix();  LoadMatrix(&node->transformation);  // Load material  if (node->material) LoadMaterial(node->material);  // Draw shape  if (node->shape) DrawShape(node->shape);  // Draw children nodes  for (int i = 0; i < (int) node->children.size(); i++)     DrawNode(scene, node->children[i]);  // Restore previous transformation  glPopMatrix();  // Show bounding box  if (show_bboxes) {    GLboolean lighting = glIsEnabled(GL_LIGHTING);    glDisable(GL_LIGHTING);    node->bbox.Outline();    if (lighting) glEnable(GL_LIGHTING);  }}
开发者ID:freezeflare,项目名称:cos426-assign-4,代码行数:27,


示例6: DrawParticleSinks

void DrawParticleSinks(R3Scene *scene){  // Check if should draw particle sinks  if (!show_particle_sources_and_sinks) return;  // Setup  GLboolean lighting = glIsEnabled(GL_LIGHTING);  glEnable(GL_LIGHTING);  // Define sink material  static R3Material sink_material;  if (sink_material.id != 33) {    sink_material.ka.Reset(0.2,0.2,0.2,1);    sink_material.kd.Reset(1,0,0,1);    sink_material.ks.Reset(1,0,0,1);    sink_material.kt.Reset(0,0,0,1);    sink_material.emission.Reset(0,0,0,1);    sink_material.shininess = 1;    sink_material.indexofrefraction = 1;    sink_material.texture = NULL;    sink_material.texture_index = -1;    sink_material.id = 33;  }  // Draw all particle sinks  glEnable(GL_LIGHTING);  LoadMaterial(&sink_material);  for (int i = 0; i < scene->NParticleSinks(); i++) {    R3ParticleSink *sink = scene->ParticleSink(i);    DrawShape(sink->shape);  }  // Clean up  if (!lighting) glDisable(GL_LIGHTING);}
开发者ID:freezeflare,项目名称:cos426-assign-4,代码行数:35,


示例7: DrawLanders

void DrawLanders(){	// draw the landers in 2 colors	NxU32 nbActors = gScene->getNbActors();	NxActor** actors = gScene->getActors();	while (nbActors--)	{		NxActor* actor = *actors++;		const char *name=actor->getName();		if (strcmp(name,"~lander")==0) {			NxShape*const* shapes;			shapes = actor->getShapes();			NxU32 nShapes = actor->getNbShapes();			//glDisable(GL_LIGHTING);			char sname[256]="";			while (nShapes--)			{				sprintf(sname,"%s",shapes[nShapes]->getName());				if      (strcmp(sname,"upside")==0)					glColor4f(0.0f,1.0f,0.0f,1.0f);				else if (strcmp(sname,"downside")==0)					glColor4f(1.0f,0.0f,0.0f,1.0f);				else if (strcmp(sname,"U1")==0)					glColor4f(1.0f,0.0f,0.0f,1.0f);				else if (strcmp(sname,"U2")==0)					glColor4f(0.0f,1.0f,0.0f,1.0f);				else if (strcmp(sname,"U3")==0)					glColor4f(0.0f,0.0f,1.0f,1.0f);				DrawShape(shapes[nShapes], false);			}			//glEnable(GL_LIGHTING);		}	}}
开发者ID:nmovshov,项目名称:ARSS_win,代码行数:34,


示例8: DrawActor

void DrawActor(NxActor* actor, NxActor* gSelectedActor){	NxShape*const* shapes = actor->getShapes();	NxU32 nShapes = actor->getNbShapes();	if (actor == gSelectedActor) 	{		while (nShapes--)		{			DrawWireShape(shapes[nShapes], NxVec3(1,1,1));		}	}	NxVec3 defaultColor = NxVec3(0.65f, 0.67f, 0.63f);	NxVec3 dynamicActiveColor = NxVec3(0.82f, 0.77f, 0.73f);	NxVec3 dynamicSleepingColor = NxVec3(0.6f, 0.6f, 0.6f);	NxVec3 kinematicColor = NxVec3(0.73f, 0.77f, 0.82f);	nShapes = actor->getNbShapes();	while (nShapes--)	{		NxVec3 color = defaultColor;		if (actor->isDynamic())		{			if (actor->readBodyFlag(NX_BF_KINEMATIC))				color = kinematicColor;			else				if (actor->isSleeping())					color = dynamicSleepingColor;				else					color = dynamicActiveColor;		}		DrawShape(shapes[nShapes], color);	}}
开发者ID:bitllorent,项目名称:CompAnim_P3,代码行数:34,


示例9: CleanupClosePushL

/**Starts test step@return TVerdict pass / fail*/enum TVerdict CT_WServGenericpluginStepLoad::doTestStepL()	{	__UHEAP_MARK;	RWindow win;	CleanupClosePushL(win);	CreateRWindowL(iWinGroup, win, KWinPos, KRgbBlue, KWinSize);	DrawShape(win);		RWindow win1;	CleanupClosePushL(win1);	if(iScreen1)		{		CreateRWindowL(iWinGroup1, win1, KWinPos, KRgbBlue, KWinSize);		DrawShape(win1);		}		switch( iTestId )		{		case 1:			INFO_PRINTF1(_L("Testing Control of CWsPlugin loading from WSINI.INI..."));			GraphicsWservGenericpluginLoad1L();			break;		case 2:				INFO_PRINTF1(_L("Testing that plugins can be specified on a per-screen basis through WSINI.INI file..."));			GraphicsWservGenericpluginLoad2L();			break;		case 3:				INFO_PRINTF1(_L("Testing Integer and string attributes in WSINI.INI file can be read from CWsPlugin..."));			GraphicsWservGenericpluginLoad3L();			break;		case 4:			INFO_PRINTF1(_L("Testing CWsPlugin can gain information about closing windows using MWsWindow interface..."));			GraphicsWservGenericpluginLoad4L();			break;		case 5:				INFO_PRINTF1(_L("Testing CWsPlugin can obtain instance of another CWPlugin..."));			GraphicsWservGenericpluginLoad5L();			break;		default:			break;			}	CleanupStack::PopAndDestroy(2,&win);	__UHEAP_MARKEND;	return TestStepResult();	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:50,


示例10: col

void nuiDrawContext::DrawPoint(float x, float y){  nuiShape shp;  shp.AddCircle(x, y, mCurrentState.mLineWidth);  nuiColor col(mCurrentState.mFillColor);  SetFillColor(mCurrentState.mStrokeColor);  DrawShape(&shp, eFillShape);  SetFillColor(col);}
开发者ID:JamesLinus,项目名称:nui3,代码行数:9,


示例11: slowdown

void slowdown(){    Touch();    //if(Touch_ret)    asm("lda %b",Touch_ret);    asm("beq %g",else1);        TouchDo();        asm("rts");    else1:        //PosY--;        asm("dec %b",PosY);        DrawShape();}
开发者ID:abiaozsh,项目名称:MyCode,代码行数:12,


示例12: while

void DrawPxShapes::DrawActor( PxRigidActor* actor ){	PxU32 nShapes = actor->getNbShapes();	PxShape** shapes = new PxShape*[ nShapes ];	actor->getShapes( shapes, nShapes );	while ( nShapes-- )	{		DrawShape( shapes[ nShapes ] );	}	delete [] shapes;}
开发者ID:kzs-sgw,项目名称:GLSL,代码行数:12,


示例13: FillShape

    void UIShape::OnDraw(UIDrawingContext& context)    {        UIVisual::OnDraw(context);        const RectF clippedBounds = context.GetCurrentClippedBounds();        const RectF bounds = context.GetCurrentBounds();        if (fillColor.A > 0)            FillShape(context, clippedBounds, bounds, fillColor);        if (lineColor.A > 0)            DrawShape(context, clippedBounds, bounds, lineColor);    }
开发者ID:Darkttd,项目名称:Bibim,代码行数:12,


示例14: rotate

void rotate(){    //NowDirectionNo=(NowDirectionNo+4+rotate_n)&3;    asm("lda %b",NowDirectionNo);    asm("clc");    asm("adc #$04");    asm("adc %b",rotate_n);    asm("and #$03");    asm("sta %b",NowDirectionNo);        getNowLeft();    //if(PosX+getBlock_ret>10)    asm("lda %b",getBlock_ret);    asm("clc");    asm("adc %b",PosX);    asm("cmp #$0A");    asm("bmi %g",else1);    asm("beq %g",else1);        //rotate_tempPosX=PosX;        asm("lda %b",PosX);        asm("sta %b",rotate_tempPosX);        //PosX=10-getBlock_ret;        asm("lda #$0A");        asm("sec");        asm("sbc %b",getBlock_ret);        asm("sta %b",PosX);        AnyTouch();                //if(0==AnyTouch_ret)jmp jp2        asm("lda %b",AnyTouch_ret);        asm("beq %g",jp2);                //PosX=rotate_tempPosX;        asm("lda %b",rotate_tempPosX);        asm("sta %b",PosX);        asm("jmp %g",jp1);    else1:    AnyTouch();    //if(AnyTouch_ret)asm("jmp %g",jp1);    asm("lda %b",AnyTouch_ret);    asm("beq %g",jp2);    jp1:    //NowDirectionNo=(NowDirectionNo+4-rotate_n)&3;    asm("lda %b",NowDirectionNo);    asm("clc");    asm("adc #$04");    asm("sec");    asm("sbc %b",rotate_n);    asm("and #$03");    asm("sta %b",NowDirectionNo);    jp2:    DrawShape();}
开发者ID:abiaozsh,项目名称:MyCode,代码行数:52,


示例15: GetPolygonPoints

voidAirspacePreviewRenderer::Draw(Canvas &canvas, const AbstractAirspace &airspace,                              const RasterPoint pt, unsigned radius,                              const AirspaceRendererSettings &settings,                              const AirspaceLook &look){  AbstractAirspace::Shape shape = airspace.GetShape();  AirspaceClass type = airspace.GetType();  // Container for storing the points of a polygon airspace  std::vector<RasterPoint> pts;  if (shape == AbstractAirspace::Shape::POLYGON && !IsAncientHardware())    GetPolygonPoints(pts, (const AirspacePolygon &)airspace, pt, radius);  if (PrepareFill(canvas, type, look, settings)) {    DrawShape(canvas, shape, pt, radius, pts);    UnprepareFill(canvas);  }  if (PrepareOutline(canvas, type, look, settings))    DrawShape(canvas, shape, pt, radius, pts);}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:22,


示例16: DrawShape

	void Render::DrawBodies(list<Body*> bodies) {		list<Body*>::iterator bIter;		for (bIter = bodies.begin(); bIter != bodies.end(); ++bIter) {			Body* b = *bIter;			const b2Transform& xf = b->getBody()->GetTransform();			list<Fixture*> fixtures = b->getFixtureList();			list<Fixture*>::iterator fIter;			for (fIter = fixtures.begin(); fIter != fixtures.end(); ++fIter) {				Fixture* f = *fIter;				DrawShape(f->getFixture(), xf, f->getColor());			}		}	}
开发者ID:Jesippea1,项目名称:capselchi,代码行数:14,


示例17: DrawPoint

void nuiDrawContext::DrawLine(float x1, float y1, float x2, float y2){  if (x1 == x2 && y1 == y2)  {    DrawPoint(x1, y1);  }  else  {    nuiShape shp;    shp.LineTo(nuiPoint(x1, y1));    shp.LineTo(nuiPoint(x2, y2));    DrawShape(&shp, eStrokeShape);  }}
开发者ID:JamesLinus,项目名称:nui3,代码行数:14,


示例18: DrawShape

void BulletOpenGLApplication::RenderScene() {	// create an array of 16 floats (representing a 4x4 matrix)	btScalar transform[16];	// iterate through all of the objects in our world	for(GameObjects::iterator i = m_objects.begin(); i != m_objects.end(); ++i) {		// get the object from the iterator		GameObject* pObj = *i;		// read the transform		pObj->GetTransform(transform);		// get data from the object and draw it		DrawShape(transform, pObj->GetShape(), pObj->GetColor());	}}
开发者ID:jchen114,项目名称:Learning-Bullet-With-OpenGL-Example-code,代码行数:16,


示例19: EnableStencilTest

bool nuiGLDrawContext::AddClipShape(nuiShape& rShape, bool Invert){  EnableStencilTest(true);  glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);  glStencilMask(~0);  // Now draw the shape in the stencil buffer:  GLenum value = Invert? 0: mClipShapeValue;  glStencilFunc(GL_ALWAYS, value, 255);  glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);  DrawShape(&rShape, eFillShape);  // Now lets get back to the mode we were in before the stencill fun:  glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);  glStencilMask(0);  glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);  glStencilFunc(GL_EQUAL, mClipShapeValue, 255);  return true;}
开发者ID:JamesLinus,项目名称:nui3,代码行数:19,


示例20: movelr

void movelr(){    //PosX+=movelr_n;    asm("lda %b",PosX);    asm("clc");    asm("adc %b",movelr_n);    asm("sta %b",PosX);    AnyTouch();        //if(AnyTouch_ret)    asm("lda %b",AnyTouch_ret);    asm("beq %g",else1);        //PosX-=movelr_n;        asm("lda %b",PosX);        asm("sec");        asm("sbc %b",movelr_n);        asm("sta %b",PosX);    else1:    DrawShape();}
开发者ID:abiaozsh,项目名称:MyCode,代码行数:19,


示例21: TImage

//simvan kata to opio afinoume to click tou pontikiouvoid __fastcall TForm1::Image1MouseUp(TObject *Sender, TMouseButton Button,      TShiftState Shift, int X, int Y){        redo = new TImage(this);        redo->Picture = Image1->Picture;    if (Button != mbLeft)        return;    if ((Form1->FillButton->Down) || (Form1->PencilButton->Down))        return;    if (Form1->EraseButton->Down)    {        Image1->Canvas->Pen->Width = 1;        return;    }    DrawShape(X, Y);    delete TmpImage;}
开发者ID:dd731,项目名称:Paint-Project-in-C-plusplus,代码行数:21,


示例22: DrawShape

void BulletOpenGLApplication::RenderScene() {	// create an array of 16 floats (representing a 4x4 matrix)	btScalar transform[16];	// iterate through all of the objects in our world	for(GameObjects::iterator i = m_objects.begin(); i != m_objects.end(); ++i) {		// get the object from the iterator		GameObject* pObj = *i;		// read the transform		pObj->GetTransform(transform);		// get data from the object and draw it		DrawShape(transform, pObj->GetShape(), pObj->GetColor());	}	// after rendering all game objects, perform debug rendering	// Bullet will figure out what needs to be drawn then call to	// our DebugDrawer class to do the rendering for us	m_pWorld->debugDrawWorld();}
开发者ID:jchen114,项目名称:Learning-Bullet-With-OpenGL-Example-code,代码行数:21,


示例23: DrawShape

//simvan to opoio pragmatopoieite kata to sirsimo tou pontikiou eno exi patimeno to clickvoid __fastcall TForm1::Image1MouseMove(TObject *Sender, TShiftState Shift,      int X, int Y){    if (!Shift.Contains(ssLeft))        return;    if (Form1->FillButton->Down)        return;    if (Form1->PencilButton->Down) //zografizi analogos to antikimeno pou xrisimopoioume    {        Image1->Canvas->LineTo(X,Y);  //X,Y oi sintetagmenes tou kersora pano sto image1        return;    }    if (Form1->EraseButton->Down)    {        Image1->Canvas->LineTo(X,Y);        return;    }    DrawShape(X, Y);}
开发者ID:dd731,项目名称:Paint-Project-in-C-plusplus,代码行数:23,


示例24: DrawShape

void b2World::DrawDebugData(){	if (m_debugDraw == NULL)	{		return;	}	uint32 flags = m_debugDraw->GetFlags();	if (flags & b2DebugDraw::e_shapeBit)	{		bool core = (flags & b2DebugDraw::e_coreShapeBit) == b2DebugDraw::e_coreShapeBit;		for (b2Body* b = m_bodyList; b; b = b->GetNext())		{			const b2XForm& xf = b->GetXForm();			for (b2Shape* s = b->GetShapeList(); s; s = s->GetNext())			{				if (b->IsStatic())				{					DrawShape(s, xf, b2Color(0.5f, 0.9f, 0.5f), core);				}				else if (b->IsSleeping())				{					DrawShape(s, xf, b2Color(0.5f, 0.5f, 0.9f), core);				}				else				{					DrawShape(s, xf, b2Color(0.9f, 0.9f, 0.9f), core);				}			}		}	}	if (flags & b2DebugDraw::e_jointBit)	{		for (b2Joint* j = m_jointList; j; j = j->GetNext())		{			if (j->GetType() != e_mouseJoint)			{				DrawJoint(j);			}		}	}	if (flags & b2DebugDraw::e_controllerBit)	{		for (b2Controller* c = m_controllerList; c; c= c->GetNext())		{			c->Draw(m_debugDraw);		}	}	if (flags & b2DebugDraw::e_pairBit)	{		b2BroadPhase* bp = m_broadPhase;		b2Vec2 invQ;		invQ.Set(1.0f / bp->m_quantizationFactor.x, 1.0f / bp->m_quantizationFactor.y);		b2Color color(0.9f, 0.9f, 0.3f);		for (int32 i = 0; i < b2_tableCapacity; ++i)		{			uint16 index = bp->m_pairManager.m_hashTable[i];			while (index != b2_nullPair)			{				b2Pair* pair = bp->m_pairManager.m_pairs + index;				b2Proxy* p1 = bp->m_proxyPool + pair->proxyId1;				b2Proxy* p2 = bp->m_proxyPool + pair->proxyId2;				b2AABB b1, b2;				b1.lowerBound.x = bp->m_worldAABB.lowerBound.x + invQ.x * bp->m_bounds[0][p1->lowerBounds[0]].value;				b1.lowerBound.y = bp->m_worldAABB.lowerBound.y + invQ.y * bp->m_bounds[1][p1->lowerBounds[1]].value;				b1.upperBound.x = bp->m_worldAABB.lowerBound.x + invQ.x * bp->m_bounds[0][p1->upperBounds[0]].value;				b1.upperBound.y = bp->m_worldAABB.lowerBound.y + invQ.y * bp->m_bounds[1][p1->upperBounds[1]].value;				b2.lowerBound.x = bp->m_worldAABB.lowerBound.x + invQ.x * bp->m_bounds[0][p2->lowerBounds[0]].value;				b2.lowerBound.y = bp->m_worldAABB.lowerBound.y + invQ.y * bp->m_bounds[1][p2->lowerBounds[1]].value;				b2.upperBound.x = bp->m_worldAABB.lowerBound.x + invQ.x * bp->m_bounds[0][p2->upperBounds[0]].value;				b2.upperBound.y = bp->m_worldAABB.lowerBound.y + invQ.y * bp->m_bounds[1][p2->upperBounds[1]].value;				b2Vec2 x1 = 0.5f * (b1.lowerBound + b1.upperBound);				b2Vec2 x2 = 0.5f * (b2.lowerBound + b2.upperBound);				m_debugDraw->DrawSegment(x1, x2, color);				index = pair->next;			}		}	}	if (flags & b2DebugDraw::e_aabbBit)	{		b2BroadPhase* bp = m_broadPhase;		b2Vec2 worldLower = bp->m_worldAABB.lowerBound;		b2Vec2 worldUpper = bp->m_worldAABB.upperBound;		b2Vec2 invQ;		invQ.Set(1.0f / bp->m_quantizationFactor.x, 1.0f / bp->m_quantizationFactor.y);		b2Color color(0.9f, 0.3f, 0.9f);		for (int32 i = 0; i < b2_maxProxies; ++i)		{//.........这里部分代码省略.........
开发者ID:6301158,项目名称:KinectHacks,代码行数:101,


示例25: w1Point

/**@SYMTestCaseID			graphics-wserv-1841-0005@SYMPREQ				1841@SYMTestCaseDesc		CWsPlugin can gain information about closing windows using MWsWindow interface.@SYMTestActions			Create modified WSINI.INI file which specifies a test renderer to be loaded.						Register CWsPLugin as eventhandler receiving EWindowClosing events.@SYMTestStatus			Implemented@SYMTestPriority		2@SYMTestExpectedResults	Plugin can access information about closing windows through MWsWindow interface.						Windows with different size and position are created and closed in screen 0.@SYMTestType			CT*/	void CT_WServGenericpluginStepLoad::GraphicsWservGenericpluginLoad4L()	{	const TUint32 KWin1WsHandle = 0xFFFFFFFC;	const TUint32 KWin2WsHandle = 0xFFFFFFFD;	const TUint32 KWin3WsHandle = 0xFFFFFFFE;	TPoint w1Point(50,240);	TPoint w2Point(580,100);	TPoint w3Point(25,100);	TSize w1Size(10,10);	TSize w2Size(150,70);	TSize w3Size(50,140);			//Draw windows with different origins and sizes		RWindow win;		CleanupClosePushL(win);	CreateRWindowL(iWinGroup, win, w1Point, KRgbBlue, w1Size, KWin1WsHandle);	DrawShape(win);	CleanupStack::PopAndDestroy(&win);		CleanupClosePushL(win);	CreateRWindowL(iWinGroup, win, w2Point, KRgbBlue, w2Size, KWin2WsHandle);	DrawShape(win);	CleanupStack::PopAndDestroy(&win);		CleanupClosePushL(win);	CreateRWindowL(iWinGroup, win, w3Point, KRgbBlue, w3Size, KWin3WsHandle);	DrawShape(win);	CleanupStack::PopAndDestroy(&win);		CleanupClosePushL(win); //create dummy 4th window to ensure window3 closing event has time to log info	CreateRWindowL(iWinGroup, win, w2Point, KRgbBlue, w2Size, KWin2WsHandle);	DrawShape(win);	CleanupStack::PopAndDestroy(&win);		//Calculate AbsRect values	TSize absRect1;	TSize absRect2;	TSize absRect3;	CalcAbsRect(absRect1, w1Point, w1Size);		CalcAbsRect(absRect2, w2Point, w2Size);		CalcAbsRect(absRect3, w3Point, w3Size);		TBuf8<255> msg;	//check log for window1 info	msg.Format(_L8("Closing Window Handle %d - Origin: %d, %d"), KWin1WsHandle, w1Point.iX, w1Point.iY);	TEST(CheckLogL(msg) == EMsgFound);	msg.Format(_L8("Closing Window Handle %d - AbsRec: Height %d, Width %d"), KWin1WsHandle, absRect1.iHeight, absRect1.iWidth);	TEST(CheckLogL(msg) == EMsgFound);	msg.Format(_L8("Closing Window Handle %d - Size: Height %d, Width %d"), KWin1WsHandle, w1Size.iHeight, w1Size.iWidth);	TEST(CheckLogL(msg) == EMsgFound);	//check log for window2 info	msg.Format(_L8("Closing Window Handle %d - Origin: %d, %d"), KWin2WsHandle, w2Point.iX, w2Point.iY);	TEST(CheckLogL(msg) == EMsgFound);	msg.Format(_L8("Closing Window Handle %d - AbsRec: Height %d, Width %d"), KWin2WsHandle, absRect2.iHeight, absRect2.iWidth);	TEST(CheckLogL(msg) == EMsgFound);	msg.Format(_L8("Closing Window Handle %d - Size: Height %d, Width %d"), KWin2WsHandle, w2Size.iHeight, w2Size.iWidth);	TEST(CheckLogL(msg) == EMsgFound);	//check log for window3 info	msg.Format(_L8("Closing Window Handle %d - Origin: %d, %d"), KWin3WsHandle, w3Point.iX, w3Point.iY);	TEST(CheckLogL(msg) == EMsgFound);	msg.Format(_L8("Closing Window Handle %d - AbsRec: Height %d, Width %d"), KWin3WsHandle, absRect3.iHeight, absRect3.iWidth);	TEST(CheckLogL(msg) == EMsgFound);	msg.Format(_L8("Closing Window Handle %d - Size: Height %d, Width %d"), KWin3WsHandle, w3Size.iHeight, w3Size.iWidth);	TEST(CheckLogL(msg) == EMsgFound);	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:77,


示例26: margin

//.........这里部分代码省略.........        switch( showActualMaskSize )        {        case B_Mask:        case F_Mask:            mask_margin.x = mask_margin.y = GetSolderMaskMargin();            break;        case B_Paste:        case F_Paste:            mask_margin = GetSolderPasteMargin();            break;        default:            // Another layer which has no margin to handle            break;        }    }#endif    // if Contrast mode is ON and a technical layer active, show pads on this    // layer so we can see pads on paste or solder layer and the size of the    // mask    if( ( aDraw_mode & GR_ALLOW_HIGHCONTRAST ) &&        displ_opts && displ_opts->m_ContrastModeDisplay && !IsCopperLayer( screen->m_Active_Layer ) )    {        if( IsOnLayer( screen->m_Active_Layer ) )        {            color = brd->GetLayerColor( screen->m_Active_Layer );            // In high contrast mode, and if the active layer is the mask            // layer shows the pad size with the mask clearance            switch( screen->m_Active_Layer )            {            case B_Mask:            case F_Mask:                mask_margin.x = mask_margin.y = GetSolderMaskMargin();                break;            case B_Paste:            case F_Paste:                mask_margin = GetSolderPasteMargin();                break;            default:                break;            }        }        else            color = DARKDARKGRAY;    }    if( aDraw_mode & GR_HIGHLIGHT )        ColorChangeHighlightFlag( &color, !(aDraw_mode & GR_AND) );    ColorApplyHighlightFlag( &color );    bool DisplayIsol = displ_opts && displ_opts->m_DisplayPadIsol;    if( !( m_layerMask & LSET::AllCuMask() ).any() )        DisplayIsol = false;    if( ( GetAttribute() == PAD_HOLE_NOT_PLATED ) &&        brd->IsElementVisible( NON_PLATED_VISIBLE ) )    {        drawInfo.m_ShowNotPlatedHole = true;        drawInfo.m_NPHoleColor = brd->GetVisibleElementColor( NON_PLATED_VISIBLE );    }    drawInfo.m_DrawMode    = aDraw_mode;    drawInfo.m_Color       = color;    drawInfo.m_DrawPanel   = aPanel;    drawInfo.m_Mask_margin = mask_margin;    drawInfo.m_ShowNCMark  = brd->IsElementVisible( PCB_VISIBLE( NO_CONNECTS_VISIBLE ) );    drawInfo.m_IsPrinting  = screen->m_IsPrinting;    SetAlpha( &color, 170 );    /* Get the pad clearance. This has a meaning only for Pcbnew.     *  for CvPcb GetClearance() creates debug errors because     *  there is no net classes so a call to GetClearance() is made only when     *   needed (never needed in CvPcb)     */    drawInfo.m_PadClearance = DisplayIsol ? GetClearance() : 0;    // Draw the pad number    if( displ_opts && !displ_opts->m_DisplayPadNum )        drawInfo.m_Display_padnum = false;    if( displ_opts &&        (( displ_opts ->m_DisplayNetNamesMode == 0 ) || ( displ_opts->m_DisplayNetNamesMode == 2 )) )        drawInfo.m_Display_netname = false;    // Display net names is restricted to pads that are on the active layer    // in high contrast mode display    if( ( aDraw_mode & GR_ALLOW_HIGHCONTRAST ) &&        !IsOnLayer( screen->m_Active_Layer ) && displ_opts && displ_opts->m_ContrastModeDisplay )        drawInfo.m_Display_netname = false;    DrawShape( aPanel->GetClipBox(), aDC, drawInfo );}
开发者ID:natsfr,项目名称:kicad,代码行数:101,


示例27: DrawShape

void b2World::DrawDebugData(){	if (m_debugDraw == NULL)	{		return;	}	uint32 flags = m_debugDraw->GetFlags();	if (flags & b2DebugDraw::e_shapeBit)	{		for (b2Body* b = m_bodyList; b; b = b->GetNext())		{			const b2Transform& xf = b->GetTransform();			for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext())			{				if (b->IsStatic())				{					DrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f));				}				else if (b->IsSleeping())				{					DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f));				}				else				{					DrawShape(f, xf, b2Color(0.9f, 0.9f, 0.9f));				}			}		}	}	if (flags & b2DebugDraw::e_jointBit)	{		for (b2Joint* j = m_jointList; j; j = j->GetNext())		{			if (j->GetType() != e_mouseJoint)			{				DrawJoint(j);			}		}	}	if (flags & b2DebugDraw::e_pairBit)	{		// TODO_ERIN	}	if (flags & b2DebugDraw::e_aabbBit)	{		b2Color color(0.9f, 0.3f, 0.9f);		b2BroadPhase* bp = &m_contactManager.m_broadPhase;		for (b2Body* b = m_bodyList; b; b = b->GetNext())		{			for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext())			{				b2AABB aabb = bp->GetFatAABB(f->m_proxyId);				b2Vec2 vs[4];				vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y);				vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y);				vs[2].Set(aabb.upperBound.x, aabb.upperBound.y);				vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y);				m_debugDraw->DrawPolygon(vs, 4, color);			}		}	}	if (flags & b2DebugDraw::e_centerOfMassBit)	{		for (b2Body* b = m_bodyList; b; b = b->GetNext())		{			b2Transform xf = b->GetTransform();			xf.position = b->GetWorldCenter();			m_debugDraw->DrawXForm(xf);		}	}}
开发者ID:ryachart,项目名称:Ballgame,代码行数:79,


示例28: DoPaint

void DoPaint(HWND hWnd){    int         i;    HDC		hdc,		hMemDC;    RECT	theRect,		destRect;    HBITMAP	theBitmap;    PAINTSTRUCT	ps;    if (CurrentPoint >= 0)    {	hdc = BeginPaint(hWnd,&ps);	/*	 * Determine which rectangle on the window is invalid.	 * If no rectangle is marked invalid, it will be a full	 * window repaint.	 */	GetUpdateRect(hWnd,&theRect,0);	if (IsRectEmpty(&theRect))	    GetClientRect(hWnd,&theRect);	/*	 * Create a memory DC and bitmap the same	 * size as the update rectangle.	 */	hMemDC = CreateCompatibleDC(hdc);	theBitmap = CreateCompatibleBitmap(hdc,					   theRect.right-theRect.left,					   theRect.bottom-theRect.top);	SelectObject(hMemDC,theBitmap);	/*	 * Erase the memBitmap.	 */	BitBlt(hMemDC, 0, 0,	       theRect.right-theRect.left,	       theRect.bottom-theRect.top,	       hdc, 0, 0, SRCCOPY);	/*	 * Draw only those shapes that lie	 * within the update rectangle.	 */	for (i = 0; i <= CurrentPoint; ++i)	{	    IntersectRect(&destRect, &thisShape[i].Points, &theRect);	    if (!IsRectEmpty(&destRect))		DrawShape(hMemDC,			  thisShape[i].Points.left-theRect.left,			  thisShape[i].Points.top-theRect.top,			  thisShape[i].Points.right-theRect.left,			  thisShape[i].Points.bottom-theRect.top,			  thisShape[i].theShape,thisShape[i].PenWidth,			  thisShape[i].PenColor,thisShape[i].Slope);		/*		 * Note that when drawing the shape, the shape's		 * position was transformed so that the origin was		 * at the upper-left corner of the update rectangle.		 * This is the point (0,0) on the bitmap that will		 * map onto (theRect.left,theRect.right).		 */	}	/*	 * Finally, copy the bitmap onto the update rectangle.	 */	BitBlt(hdc, theRect.left, theRect.top,	       theRect.right-theRect.left,	       theRect.bottom-theRect.top,	       hMemDC, 0, 0, SRCCOPY);	DeleteDC(hMemDC);	DeleteObject(theBitmap);	EndPaint(hWnd,&ps);     }}
开发者ID:nicolaemariuta,项目名称:bachelorHomeworkAndStudy,代码行数:81,



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


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