本文整理汇总了C++中drawEllipse函数的典型用法代码示例。如果您正苦于以下问题:C++ drawEllipse函数的具体用法?C++ drawEllipse怎么用?C++ drawEllipse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawEllipse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawEllipse
void QGLWindow::renderFace() {
// calculate the ratio of between the original image and the rendered image
float ratio = static_cast<float>(m_width)
/static_cast<float>(m_renderedImage.width());
// scale and set the new origin for each ellipse
// in order to draw it on top of the face
drawEllipse(m_face.face.scale(ratio).setOrigin(m_posX, -m_posY));
drawEllipse(m_face.eyes[0].scale(ratio).setOrigin(m_posX, -m_posY));
drawEllipse(m_face.eyes[1].scale(ratio).setOrigin(m_posX, -m_posY));
drawEllipse(m_face.smile.scale(ratio).setOrigin(m_posX, -m_posY));
}
示例2: it
void TipsPainter::drawVelocityDots(const BallTraj& traj)
{
QListIterator<Mark> it(traj.velMarks);
while(it.hasNext())
{
Mark item = it.next();
if (!item.isNull())
{
drawEllipse(round(item), 2,2);
drawEllipse(round(item), 3,3);
//drawBall(Ball(round(item),traj.radius,traj.type,0), true);
}
}
}
示例3: eyeLiner
static void
eyeLiner(EyesWidget w,
Boolean draw,
int num)
{
drawEllipse(w, draw ? PART_OUTLINE : PART_SHAPE,
EYE_X(num), EYE_Y(num),
TPOINT_NONE, TPOINT_NONE,
EYE_DIAM + 2.0*EYE_THICK);
if (draw) {
drawEllipse(w, PART_CENTER, EYE_X(num), EYE_Y(num),
TPOINT_NONE, TPOINT_NONE,
EYE_DIAM);
}
}
示例4: assert
void MapStorage::renderGrid(void)
{
int wc, hc;
wc = (int)(xMax/cellSz);
hc = (int)(yMax/cellSz);
assert(wc > 0);
assert(hc > 0);
map->info.width = wc;
map->info.height = hc;
assert(wc*hc < 100000000);
map->data.resize(wc*hc);
*distMap = *map;
*inflMap = *map;
if(cr!=nullptr)
cairo_destroy(cr);
if(surface!=nullptr)
cairo_surface_destroy(surface);
surface = cairo_image_surface_create (CAIRO_FORMAT_A8, wc, hc);
cr = cairo_create (surface);
for(int i = 0; i<wallSt.size(); i++)
drawWall(wallSt[i].x0, wallSt[i].y0, wallSt[i].x1, wallSt[i].y1, wallSt[i].thickness);
for(int i = 0; i<lineSt.size(); i++)
drawWall(lineSt[i].x0, lineSt[i].y0, lineSt[i].x1, lineSt[i].y1, lineSt[i].thickness);
for(int i = 0; i<ellipseSt.size(); i++)
drawEllipse(ellipseSt[i].x, ellipseSt[i].y, ellipseSt[i].a, ellipseSt[i].b, ellipseSt[i].th);
unsigned char *data = cairo_image_surface_get_data (surface);
map->data.assign(data, data+(wc*hc));
renderDistMap();
renderInflMap();
}
示例5: qDebug
void MainWindow::drawEllipse(){
ui->graphicsView->setScene(scene);
item3 = new ellipse;
scene->addItem(item3);
qDebug() << "Ellipse Created";
connect(item3, SIGNAL(DrawFinished()), this, SLOT(drawEllipse()));
}
示例6: property
void ImageGeneratorSource::process()
{
if ((int)mSize[0] != property("width").toInt())
{
mImageFrame.release();
mSize[0] = property("width").toInt();
}
if ((int)mSize[1] != property("height").toInt())
{
mImageFrame.release();
mSize[1] = property("height").toInt();
}
// Create an image
if (!mImageFrame.isEmpty())
emit processingCompleted();
else
{
mImageFrame.resize(mSize);
mImageFrame.clear();
// Make a square
ColorImageFrame::ImageType::IndexType pixelIndex;
ColorImageFrame::PixelType pixel;
pixel[0] = 255;
pixel[1] = 0;
pixel[2] = 0;
for (pixelIndex[0] = 0; pixelIndex[0] < (int)mSize[0]; ++pixelIndex[0])
for (pixelIndex[1] = 0; pixelIndex[1] < (int)mSize[1]; ++pixelIndex[1])
if (drawEllipse((double)pixelIndex[0]/(double)mSize[0], (double)pixelIndex[1]/(double)mSize[1]))
((ColorImageFrame::ImageType::Pointer)mImageFrame)->SetPixel(pixelIndex, pixel);
emit framesReady();
}
}
示例7: infoData
static void infoData (pScene sc, pMesh mesh, int k, int typel) {
pSolution ps;
if (!mesh->nbb) return;
ps = &mesh->sol[k];
if (mesh->nfield == 1) {
fprintf(stdout, " Data (scalar): %f\n", ps->bb);
} else if (mesh->nfield == mesh->dim) {
fprintf(stdout, " Data (vector): %f %f", ps->m[0], ps->m[1]);
if (mesh->dim == 3) fprintf(stdout, " %f", ps->m[2]);
fprintf(stdout, "\n");
} else if (mesh->dim == 2 && mesh->nfield == 3) {
fprintf(stdout, " Data (tensor): %f %f %f\n",
ps->m[0], ps->m[1], ps->m[2]);
drawEllipse(sc, mesh, typel, k);
} else if (mesh->dim == 3 && mesh->nfield == 6) {
if (mesh->ne)
fprintf(stdout, " Data (tensor): %f %f %f %f %f %f\n",
ps->m[0], ps->m[1], ps->m[2], ps->m[3], ps->m[4], ps->m[5]);
drawEllipsoid(sc, mesh, typel, k);
}
fflush(stdout); /* add J. Morice 12/2008 */
}
示例8: qMin
void SkyQPainter::drawPointSource(const QPointF& pos, float size, char sp)
{
int isize = qMin(static_cast<int>(size), 14);
if( !m_vectorStars || starColorMode == 0 ) {
// Draw stars as bitmaps, either because we were asked to, or because we're painting real colors
QPixmap* im = imageCache[ harvardToIndex(sp) ][isize];
float offset = 0.5 * im->width();
drawPixmap( QPointF(pos.x()-offset, pos.y()-offset), *im );
}
else {
// Draw stars as vectors, for better printing / SVG export etc.
if ( starColorMode != 4 ) {
setPen( m_starColor );
setBrush( m_starColor );
}
else {
// Note: This is not efficient, but we use vector stars only when plotting SVG, not when drawing the skymap, so speed is not very important.
QColor c = ColorMap.value( sp, Qt::white );
setPen( c );
setBrush( c );
}
// Be consistent with old raster representation
if( size > 14 )
size = 14;
if( size >= 2 )
drawEllipse( pos.x() - 0.5 * size, pos.y() - 0.5 * size, int(size), int(size) );
else if( size >= 1 )
drawPoint( pos.x(), pos.y() );
}
}
示例9: drawControlPoints
void drawControlPoints(){
glColor3f(1.0f, 0.0f, 0.0f);
for (int i = 0; i < numberOfPoints; i++){
drawEllipse(points[i].pos, 1.0f, 1.0f);
}
}
示例10: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
setupUi(this);
setWindowTitle(tr("GD CAD"));
newFile();
qApp->installEventFilter(this);
// scene = new QGraphicsScene;
/*or(int x = 0; x <= ui->graphicsView->width(); x += 10){
scene->addLine(x,0,x,ui->graphicsView->height(),QPen(Qt::green));
}
for(int y = 0; y <= ui->graphicsView->height(); y += 10){
scene->addLine(0,y,ui->graphicsView->width(),y,QPen(Qt::green));
}
for(int x = 10; x <= ui->graphicsView->width(); x += 100){
scene->addLine(x,0,x,ui->graphicsView->height(),QPen(Qt::darkGreen));
}
for(int y = 10; y <= ui->graphicsView->height(); y += 100){
scene->addLine(0,y,ui->graphicsView->width(),y,QPen(Qt::darkGreen));
}
ui->graphicsView->setScene(scene);*/
connect(ui->pointButton, SIGNAL(clicked()), this, SLOT(drawPoint()));
connect(ui->lineButton, SIGNAL(clicked()), this, SLOT(drawLine()));
connect(ui->circleButton, SIGNAL(clicked()), this, SLOT(drawCircle()));
connect(ui->ellipseButton, SIGNAL(clicked()), this, SLOT(drawEllipse()));
connect(ui->actionPoints, SIGNAL(triggered()), this, SLOT(drawPoint()));
connect(ui->actionLine, SIGNAL(triggered()), this, SLOT(drawLine()));
connect(ui->actionCircle, SIGNAL(triggered()), this, SLOT(drawCircle()));
connect(ui->actionEllipse, SIGNAL(triggered()), this, SLOT(drawEllipse()));
connect(actionNew, SIGNAL(triggered()), this, SLOT(newFile()));
connect(actionQuit, SIGNAL(triggered()), this, SLOT(close()));
connect(actionNew, SIGNAL(triggered()), this, SLOT(newFile()));
connect(actionQuit, SIGNAL(triggered()), this, SLOT(close()));
connect(actionPrint, SIGNAL(triggered()), this, SLOT(filePrint()));
connect(actionPrintPreview, SIGNAL(triggered()), this, SLOT(filePrintPreview()));
}
示例11: save
void FieldPainter::drawBallRR (const BallInfo &ball, const AbsCoord &robot)
{
save ();
translateRR(ball.rr, robot);
setPen (QColor ("black"));
setBrush(QBrush(QColor(255, 127, 0)));
drawEllipse (QPoint(0, 0), 40, 40);
restore ();
}
示例12: ellipseBinding
int ellipseBinding(lua_State *L) {
int x,y,rx,ry;
x = lua_tonumber(L,-4);
y = lua_tonumber(L,-3);
rx = lua_tonumber(L,-2);
ry = lua_tonumber(L,-1);
drawEllipse(l81.fb,x,y,rx,ry,l81.r,l81.g,l81.b,l81.alpha);
return 0;
}
示例13: save
void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& ellipseColor, const Color& shadowColor)
{
if (paintingDisabled())
return;
save();
setStrokeColor(shadowColor);
setFillColor(shadowColor);
drawEllipse(FloatRect(rect.x(), rect.y() + 1, rect.width(), rect.height()));
setStrokeColor(ellipseColor);
setFillColor(ellipseColor);
drawEllipse(rect);
restore();
}
示例14: eyeBall
static void
eyeBall(EyesWidget w,
Boolean draw,
TPoint *old,
int num)
{
drawEllipse(w, draw ? PART_PUPIL : PART_CLEAR,
w->eyes.pupil[num].x, w->eyes.pupil[num].y,
old ? old->x : TPOINT_NONE, old ? old->y : TPOINT_NONE,
BALL_DIAM);
}
示例15: main
task main()
{
//varibles!!!!!!!!
int offset = 10;
int noseOffset = 0;
//draws a mouth
drawRect(5 + offset,12,65 + offset,8);
//
//draws eyes
//
//left
drawEllipse(10 + offset,50,20 + offset,35);
//right
drawEllipse(50 + offset,50,60 + offset,35);
while (true)
{
if (noseOffset == 0)
{
noseOffset = 5;
}
else
{
noseOffset = 0;
}
//draws nose
drawEllipse(30 + offset,30 + noseOffset,40 + offset,20 + noseOffset);
wait1Msec(1000);
eraseEllipse(30 + offset,30 + noseOffset,40 + offset,20 + noseOffset);
}
}