本文整理汇总了C++中drawEllipse函数的典型用法代码示例。如果您正苦于以下问题:C++ drawEllipse函数的具体用法?C++ drawEllipse怎么用?C++ drawEllipse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawEllipse函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
开发者ID:Babouchot,项目名称:PanicEngine,代码行数:13,代码来源:main.cpp
示例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);
}
}
}
开发者ID:tguglanaklona,项目名称:BI,代码行数:14,代码来源:TipsPainter.cpp
示例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);
}
}
开发者ID:rsaxvc,项目名称:xDisapprovingEyes,代码行数:15,代码来源:Eyes.c
示例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();
}
开发者ID:DD2425-2015-Group7,项目名称:catkin_ws,代码行数:34,代码来源:MapStorage.cpp
示例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()));
}
开发者ID:ChanKaur,项目名称:Egdcad,代码行数:7,代码来源:mainwindow.cpp
示例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();
}
}
开发者ID:rpietruc,项目名称:qmediamodeler,代码行数:35,代码来源:imagegeneratorsource.cpp
示例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 */
}
开发者ID:zzyatlantise,项目名称:FreeFem-sources,代码行数:27,代码来源:picking.c
示例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() );
}
}
开发者ID:seanhoughton,项目名称:kstars,代码行数:31,代码来源:skyqpainter.cpp
示例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);
}
}
开发者ID:csiki,项目名称:grafika_hf,代码行数:7,代码来源:cg_template_2014_1.cpp
示例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()));
}
开发者ID:ChanKaur,项目名称:Egdcad,代码行数:45,代码来源:mainwindow.cpp
示例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 ();
}
开发者ID:LoweDavince,项目名称:rUNSWift-2014-release,代码行数:9,代码来源:FieldPainter.cpp
示例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;
}
开发者ID:r043v,项目名称:load81,代码行数:10,代码来源:load81.c
示例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();
}
开发者ID:josedealcala,项目名称:webkit,代码行数:19,代码来源:GraphicsContext.cpp
示例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);
}
开发者ID:rsaxvc,项目名称:xDisapprovingEyes,代码行数:11,代码来源:Eyes.c
示例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);
}
}
开发者ID:Proromayev,项目名称:Robotics,代码行数:41,代码来源:Teaching_Dad1.c
示例16: log10
bool SkyQPainter::drawPlanet(KSPlanetBase* planet)
{
if( !m_proj->checkVisibility(planet) ) return false;
bool visible = false;
QPointF pos = m_proj->toScreen(planet,true,&visible);
if( !visible || !m_proj->onScreen(pos) ) return false;
float fakeStarSize = ( 10.0 + log10( Options::zoomFactor() ) - log10( MINZOOM ) ) * ( 10 - planet->mag() ) / 10;
if( fakeStarSize > 15.0 )
fakeStarSize = 15.0;
float size = planet->angSize() * dms::PI * Options::zoomFactor()/10800.0;
if( size < fakeStarSize && planet->name() != "Sun" && planet->name() != "Moon" ) {
// Draw them as bright stars of appropriate color instead of images
char spType;
//FIXME: do these need i18n?
if( planet->name() == i18n("Mars") ) {
spType = 'K';
} else if( planet->name() == i18n("Jupiter") || planet->name() == i18n("Mercury") || planet->name() == i18n("Saturn") ) {
spType = 'F';
} else {
spType = 'B';
}
drawPointSource(pos,fakeStarSize,spType);
} else {
float sizemin = 1.0;
if( planet->name() == "Sun" || planet->name() == "Moon" )
sizemin = 8.0;
float size = planet->angSize() * dms::PI * Options::zoomFactor()/10800.0;
if( size < sizemin )
size = sizemin;
if( Options::showPlanetImages() && !planet->image().isNull() ) {
//Because Saturn has rings, we inflate its image size by a factor 2.5
if( planet->name() == "Saturn" )
size = int(2.5*size);
// Scale size exponentially so it is visible at large zooms
else if (planet->name() == "Pluto")
size = int(size*exp(1.5*size));
save();
translate(pos);
rotate( m_proj->findPA( planet, pos.x(), pos.y() ) );
drawImage( QRect(-0.5*size, -0.5*size, size, size),
planet->image() );
restore();
} else { //Otherwise, draw a simple circle.
drawEllipse( pos, size, size );
}
}
return true;
}
开发者ID:seanhoughton,项目名称:kstars,代码行数:53,代码来源:skyqpainter.cpp
示例17: spinEllipse
void spinEllipse(GLfloat increment,int id){ //speedLimiter - da se ne vrti prebrzo, da se mogu uociti prazni lukovi!
glPushMatrix();
glTranslatef(increment,0,0);
if(matrixProperties[id][0]<speedMax)
matrixProperties[id][0]++;
else{
if(matrixProperties[id][1]<6)
drawEllipse(matrixDistance[id][0],matrixDistance[id][1],matrixAngle[matrixProperties[id][1]][0],matrixAngle[matrixProperties[id][1]++][1]);
else
matrixProperties[id][1]=0;
matrixProperties[id][0]=0;
}
glPopMatrix();
}
开发者ID:MilicaMilicevic,项目名称:MagneticForce,代码行数:14,代码来源:Main.cpp
示例18: pen
void TipsPainter::drawBall(const Ball& ball, bool drawCenter)
{
QPen old = pen();
setCircledPointPen(ball.type);
drawEllipse(round(ball.center),int(ball.radius),int(ball.radius));
if (drawCenter){
double koeff = 0.5;
drawLine(QPoint(round(ball.center.x() + koeff*ball.radius), round(ball.center.y())), QPoint(round(ball.center.x() - koeff*ball.radius), round(ball.center.y())));
drawLine(QPoint(round(ball.center.x()), round(ball.center.y() - koeff*ball.radius)), QPoint(round(ball.center.x()), round(ball.center.y() + koeff*ball.radius)));
}
setPen(old);
}
开发者ID:tguglanaklona,项目名称:BI,代码行数:15,代码来源:TipsPainter.cpp
示例19: drawTrackerRPhi
void drawTrackerRPhi(TPad* pad)
{
pad->cd();
double r = 0, x = 0, y = 0;
TEllipse *e;
// PXB
drawEllipse(x,y,4.4);
drawEllipse(x,y,7.3);
drawEllipse(x,y,10.2);
// TIB
drawEllipse(x,y,25.5);
drawEllipse(x,y,33.9);
drawEllipse(x,y,41.9);
drawEllipse(x,y,49.8);
}
开发者ID:frmeier,项目名称:usercode,代码行数:15,代码来源:genDisplay01.C
示例20: sqrt
// draw absolute position covariance ellipse
void FieldPainter::drawAbsCovEllipse(const AbsCoord &pos, QPen variancePen) {
variancePen.setWidth(20);
Eigen::VectorXf eigenvalues = pos.var.block<2, 2>(0,0).marked<Eigen::SelfAdjoint>().eigenvalues();
int r_major_axis = sqrt(MAX(eigenvalues[0], eigenvalues[1]));
int r_minor_axis = sqrt(MIN(eigenvalues[0], eigenvalues[1]));
float theta = atan2(2*pos.var(0,1), pos.var(0,0)-pos.var(1,1))/2.0;
save();
translate(pos.x(), pos.y());
rotate(RAD2DEG(theta));
QRect varRect(-r_major_axis, -r_minor_axis, r_major_axis*2, r_minor_axis*2);
setPen(variancePen);
setBrush(QBrush(Qt::NoBrush));
drawEllipse(varRect);
restore();
}
开发者ID:LoweDavince,项目名称:rUNSWift-2014-release,代码行数:18,代码来源:FieldPainter.cpp
注:本文中的drawEllipse函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论