void drawGrid() { for(int x = 0; x < GRID_WIDTH; x++) { for(int y = 0; y < GRID_HEIGHT; y++) { if(g_GRID[x][y].show == YES && g_GRID_BAK[x][y].show == NO) { drawOne(x * 2 + 2, y + 1, (char *)g_const_rect_b); } else if(g_GRID[x][y].show == NO && g_GRID_BAK[x][y].show == YES){ drawOne(x * 2 + 2, y + 1, (char *)ICON_NULL); } } } }
//! Draw any parts on the screen which are for our module void AngleMeasure::draw(StelCore* core) { if (startPoint.lengthSquared()==0.0) // avoid crash on switch-on, lp:#1455839 return; if (lineVisible.getInterstate() < 0.000001f && messageFader.getInterstate() < 0.000001f) return; if (flagShowHorizontal) { drawOne(core, StelCore::FrameAltAz, StelCore::RefractionOff, horTextColor, horLineColor); } if (flagShowEquatorial) { drawOne(core, StelCore::FrameEquinoxEqu, StelCore::RefractionAuto, textColor, lineColor); } }
void drawEangSlice(){ string infile="../output/depth15x2mm/o_dis_V_mottx1e2_1e6_15Sections.root"; int z=9; onm="../output/depth15x2mm/y_EsliceAngle.pdf"; c1->Print(Form("%s[",onm.c_str()),"pdf"); drawOne(infile,z); c1->Print(Form("%s]",onm.c_str()),"pdf"); }
/** * * @param target * @return */ bool AsciiFilter::drawGlyphs(ADMImage *source,ADMImage *target) { int luma; uint8_t glyph; target->blacken (); for(int y=0;y<reducedHeight;y++) { for(int x=0;x<reducedWidth;x++) { glyph=findBestMatch(source,x,y,luma); drawOne(glyph,target,x,y,luma); } } return true; }
void onDraw(SkCanvas* canvas) override { canvas->save(); canvas->translate(-2, 120); drawOne(canvas, fPath, SkRect::MakeLTRB(0, 0, 80, 150)); canvas->translate(0, 170); drawOne(canvas, fPath, SkRect::MakeLTRB(0, 0, 80, 100)); canvas->translate(0, 170); drawOne(canvas, fPath, SkRect::MakeLTRB(0, 0, 30, 150)); canvas->translate(0, 170); drawOne(canvas, fPath, SkRect::MakeLTRB(0, 0, 10, 150)); canvas->restore(); canvas->save(); canvas->translate(20, -2); drawOne(canvas, fFlipped, SkRect::MakeLTRB(0, 0, 150, 80)); canvas->translate(170, 0); drawOne(canvas, fFlipped, SkRect::MakeLTRB(0, 0, 100, 80)); canvas->translate(170, 0); drawOne(canvas, fFlipped, SkRect::MakeLTRB(0, 0, 150, 30)); canvas->translate(170, 0); drawOne(canvas, fFlipped, SkRect::MakeLTRB(0, 0, 150, 10)); canvas->restore(); }
void drawSingleDigiNumber(GLint value, GLfloat x,GLfloat y,GLfloat length ) { switch(value) { case 0: drawZero(x, y, 0.0, length); break; case 1: drawOne(x, y, 0.0, length); break; case 2: drawTwo(x, y, 0.0, length); break; case 3: drawThree(x, y, 0.0, length); break; case 4: drawFour(x, y, 0.0, length); break; case 5: drawFive(x, y, 0.0, length); break; case 6: drawSix(x, y, 0.0, length); break; case 7: drawSeven(x, y, 0.0, length); break; case 8: drawEight(x, y, 0.0, length); break; case 9: drawNine(x, y, 0.0, length); break; default: break; } }
static void DrawCube(void) { if (guss == 99){ } else if (gCharacter[0].patt_found){ glPushMatrix(); //Applying // coordinate transformation matrix arglCameraViewRH(gCharacter[0].trans, m, gViewScaleFactor); glLoadMatrixd(m); glPushMatrix(); glScalef(7.8, 4.8, 4.8); //glTranslated(3, 0, -30); //glRotated(90, 1, 0, 0); //sky(); //glTranslated(-3, 0, 20); //glScalef(xx, yy, z); //drawElephant2(); if (wire){ OnDraw(); } else OnDraw1(); glPopMatrix(); glPopMatrix(); if (skyflag){ } //FSOUND_Stream_Play(0, g_mp3_stream1); //PlaySound(data1, NULL, SND_ASYNC | SND_NOSTOP );*/ } else if (gCharacter[4].patt_found){ glPushMatrix(); //Applying // coordinate transformation matrix arglCameraViewRH(gCharacter[4].trans, m, gViewScaleFactor); glLoadMatrixd(m); glPushMatrix(); //sky(); glTranslated(-3, 0, 20); glScalef(xx, yy, z); //drawElephant2(); FSOUND_Stream_Play(0, g_mp3_stream1); //PlaySound(data1, NULL, SND_ASYNC | SND_NOSTOP );*/ } else if(gCharacter[1].patt_found){ glPushMatrix(); arglCameraViewRH(gCharacter[1].trans, m, gViewScaleFactor); glLoadMatrixd(m); glPushMatrix(); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, LIGHT_MODEL_AMBIENT); glEnable(GL_LIGHTING); //gluPerspective(60.0, ASPECT_RATIO, 0.2, 100.0); gluLookAt(LOOK_AT_POSITION[0] + ViewerDistance * sin(viewerZenith) * sin(viewerAzimuth), LOOK_AT_POSITION[1] + ViewerDistance * cos(viewerZenith), LOOK_AT_POSITION[2] + ViewerDistance * sin(viewerZenith) * cos(viewerAzimuth), LOOK_AT_POSITION[0], LOOK_AT_POSITION[1], LOOK_AT_POSITION[2], 0.0, 1.0, 0.20); glScalef(xx, yy, z); glShadeModel(GL_SMOOTH); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glEnable(GL_NORMALIZE); glCullFace(GL_BACK); glEnable(GL_CULL_FACE); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); FSOUND_Stream_Play(0, g_mp3_stream2); glRotated(90, 1, 0, 0); glScaled(2, 2, 2); UpdateLight(); drawEarthAndMoon(); drawAllPlanets(); drawSaturnRing(); drawSun(); if (blendFlag){ glEnable(GL_BLEND); glDepthMask(GL_FALSE); glBlendFunc(GL_SRC_COLOR, GL_ONE); } if (particleFlag) drawAllParticles(); glDepthMask(GL_TRUE); glDisable(GL_BLEND); glDisable(GL_LIGHTING); //drawElephant(); //glTranslated(0, 0, -2); glPopMatrix(); glPopMatrix(); //OnDraw2(); } else if (gCharacter[3].patt_found) { glPushMatrix(); arglCameraViewRH(gCharacter[3].trans, m, gViewScaleFactor); glLoadMatrixd(m); glPushMatrix(); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, LIGHT_MODEL_AMBIENT); glEnable(GL_LIGHTING); //gluPerspective(60.0, ASPECT_RATIO, 0.2, 100.0); gluLookAt(LOOK_AT_POSITION[0] + ViewerDistance * sin(viewerZenith) * sin(viewerAzimuth), LOOK_AT_POSITION[1] + ViewerDistance * cos(viewerZenith), LOOK_AT_POSITION[2] + ViewerDistance * sin(viewerZenith) * cos(viewerAzimuth), LOOK_AT_POSITION[0], LOOK_AT_POSITION[1], LOOK_AT_POSITION[2], 0.0, 1.0, 0.020); glShadeModel(GL_SMOOTH); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glEnable(GL_NORMALIZE); glCullFace(GL_BACK); glEnable(GL_CULL_FACE); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glTranslated(0, 0, 0); glScalef(xx, yy, z); UpdateLight(); glRotated(90, 1, 0, 0); drawOne(); glDepthMask(GL_TRUE); glDisable(GL_BLEND); glDisable(GL_LIGHTING); guss1 = 1; glPopMatrix(); glPopMatrix(); } /* if (gCharacter[4].patt_found){ glPushMatrix(); arglCameraViewRH(gCharacter[4].trans, m, gViewScaleFactor); glLoadMatrixd(m); glPushMatrix(); glScaled(xx, yy, z); glColor3d(1, 1, 1); glBegin(GL_QUADS); glVertex2f(-3, 3); glVertex2f(-3, -3); glVertex2f(3, -3); glVertex2f(3, 3); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(0, 0, 2); glScaled(25, 25, 25); glBegin(GL_TRIANGLES); glColor3f(0.0f, 0.0f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.0f); glEnd(); glPopMatrix(); glPopMatrix(); //printf("found"); } if (gCharacter[5].patt_found){ glPushMatrix(); arglCameraViewRH(gCharacter[5].trans, m, gViewScaleFactor); glLoadMatrixd(m); glPushMatrix(); glScaled(xx, yy, z); glColor3d(1, 1, 1); glBegin(GL_QUADS); glVertex2f(-3, 3); glVertex2f(-3, -3); glVertex2f(3, -3); glVertex2f(3, 3); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(0, 0, 2); glScaled(25, 25, 25); glBegin(GL_TRIANGLES); glColor3f(0.0f, 0.0f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.0f); glEnd(); glPopMatrix(); glPopMatrix(); //printf("found"); }*/else if (gCharacter[5].patt_found){ glPushMatrix(); arglCameraViewRH(gCharacter[6].trans, m, gViewScaleFactor); glLoadMatrixd(m); glPushMatrix(); glScalef(13, 13, 13); glColor3f(1, 1, 1); glTranslated(-10, 0, 0); cube(); FSOUND_Stream_Play(0, g_mp3_stream16); glPopMatrix(); glPopMatrix(); } /* if (gCharacter[7].patt_found){ glPushMatrix(); arglCameraViewRH(gCharacter[7].trans, m, gViewScaleFactor); glLoadMatrixd(m); glPushMatrix(); glScaled(xx, yy, z); glColor3d(1, 1, 1); glBegin(GL_QUADS); glVertex2f(-3, 3); glVertex2f(-3, -3); glVertex2f(3, -3); glVertex2f(3, 3); glEnd(); glPopMatrix(); if (pause){ glPushMatrix(); glTranslated(0, 0, 2); glScaled(25, 25, 25); glBegin(GL_TRIANGLES); glColor3f(0.0f, 0.0f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.0f); glEnd(); glPopMatrix(); } else if (!pause){ glPushMatrix(); glScaled(8, 8, 8); glTranslated(0, -1 , 3); glRotated(90, 0, 0, 1); glColor3d(0, 1, 1); glBegin(GL_QUADS); glVertex2f(-0.6, 3); glVertex2f(-0.6, -3); glVertex2f(0.6, -3); glVertex2f(0.6, 3); glEnd(); glPopMatrix(); glPushMatrix(); glScaled(8, 8, 8); glTranslated(0, 1 , 3); glRotated(90, 0, 0, 1); glColor3d(0, 1, 1); glBegin(GL_QUADS); glVertex2f(-0.6, 3); glVertex2f(-0.6, -3); glVertex2f(0.6, -3); glVertex2f(0.6, 3); glEnd(); glPopMatrix(); } glPopMatrix(); }*/ }
void cleanNEXT(Cube *cube) { COORD c = {FRAME_RIGHT + 9, 5}; for(int i = 0; i < 4; i++) { drawOne(c.X + cube->getShapes()[cube->cur_type][i].X * 2, c.Y + cube->getShapes()[cube->cur_type][i].Y, (char *)ICON_NULL); } }
void drawNEXT(Cube *cube) { COORD c = {FRAME_RIGHT + 9, 5}; for(int i = 0; i < 4; i++) { drawOne(c.X + cube->getShapes()[cube->cur_type][i].X * 2, c.Y + cube->getShapes()[cube->cur_type][i].Y, (char *)g_const_rect_b); } }