本文整理汇总了C++中Plotter::move方法的典型用法代码示例。如果您正苦于以下问题:C++ Plotter::move方法的具体用法?C++ Plotter::move怎么用?C++ Plotter::move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plotter
的用法示例。
在下文中一共展示了Plotter::move方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: backgroundIntro
//Function that prints names
bool backgroundIntro()
{
ifstream data;
POINT p;
Plotter screen;
/* HWND consoleWnd = GetConsoleWindow();*/
Sleep(100);
//PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
screen.setColor(yellow);
screen.move(30,23);
cout<<"Created By:";
Sleep(2000);
Sleep(100);
//PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
screen.setColor(green);
screen.move(30,25);
cout<<"Abril Resendiz";
Sleep(2000);
// PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
screen.setColor(yellow);
screen.move(30,27);
cout<<"Daniel Holt";
Sleep(2000);
// PlaySound("C:\\Users\\Alex\\Desktop\\CB\\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
screen.setColor(green);
screen.move(30,29);
cout<<"Maggie Schmeltekopf";
Sleep(2000);
// PlaySound("C:\\Users\\Alex\\Desktop\\CB\\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
screen.setColor(yellow);
screen.move(30,31);
cout<<"Victoria Robinson";
Sleep(2000);
// PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
screen.setColor(green);
screen.move(30,33);
cout<<"Emily Peirce";
Sleep(2000);
screen.clear();
return exit;
}
示例2: draw_axes
int draw_axes(Plotter& plot, WorldPt cross, Color col_ax, int ax_thickness,
float x_tic, float y_tic, bool labels, int width, int prec,
Color col_lab)
{
int const EPS = 1.0e-6f;
int const fontsize = 15;
float tic_pos;
float direction;
float limit;
float tic_length;
WorldPt wl;
WorldPt wu;
WorldPt p;
ScrPt pv;
int labelPixs;
Color col_prev;
int thick_prev;
String str;
Font my_font;
if (!my_font.LoadFromFile("FreeMono.ttf", fontsize))
{
return EXIT_FAILURE;
}
col_prev = plot.get_draw_col();
plot.set_draw_col(col_ax);
thick_prev = plot.get_draw_thick();
plot.set_draw_thick(ax_thickness);
plot.get_world_ext(wl, wu);
p.x = wl.x;
p.y = cross.y;
plot.move(p);
p.x = wu.x;
plot.draw(p);
p.x = cross.x;
p.y = wl.y;
plot.move(p);
p.y = wu.y;
plot.draw(p);
direction = 1.0f;
limit = wu.x * (1.0f + EPS);
if (limit == 0.0f)
{
limit = EPS * abs(wl.x);
}
x_tic = abs(x_tic);
tic_length = 0.01f * (wu.y - wl.y);
while (true)
{
tic_pos = cross.x + x_tic;
while (direction * tic_pos <= limit)
{
p.x = tic_pos;
p.y = cross.y;
if (labels)
{
plot.world2scr(p, pv);
labelPixs = 6 * width * fontsize / 10;
pv.x -= labelPixs / 2;
ostringstream ss;
ss << setw(width) << setprecision(prec) << fixed << right
<< tic_pos;
str.SetText(ss.str());
str.SetFont(my_font);
str.SetColor(col_lab);
str.SetSize(fontsize);
str.SetPosition(pv.x, pv.y);
plot.Draw(str);
}
plot.move(p);
p.y += tic_length;
plot.draw(p);
tic_pos += x_tic;
}
if (direction < 0.0f)
{
break;
}
direction = -1.0f;
limit = direction * wl.x;
//.........这里部分代码省略.........