#include <fstream>
#include <strstream>
using namespace std:
#include <windows.h>
//change if using xWindows or other platform

// изменяем, если используется xWindows или другая

// платформа

#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <gl/Gl.h>
#include <gl/Glu.h>
#include <gl/glut.h>

IntPoint class ШШШШдар

Источник 1lady.net.

class IntPoint{

// for 2D points with integer coordinates // для двумерных точек с целыми координатами public: int х.у:

void set(int dx. int dy){x * dx: у = dy:} void setdntPointS p){ x - p.x; у = p.y:} IntPoint(int xx. int yy){x - xx: у = yy:} IntPo1nt(){ x - у - 0;}

}:

//@№т@№@Ж1№ Point2 class щадащаадаада class Point2{

// for 2D points with real coordinates // для двумерных точек с вещественными координатами public: float х.у:

void setCfloat dx. float dy){x = dx: у = dy:} void set(Point2& p){ x = p.x: у = p.y:} Point2(float xx. float yy){x = xx: у - yy:} Point2(){x - у - 0:}

}:
//««««««««««« PolyLine »»>»»»»»»»»»» class PolyLine{

// a polyline is a num plus an array of points // ломаная - это число плюс массив точек public:

int num:
Point2 pt[80]:

Приложение В. Некоторые полезные классы и служебные подпрограммы

//may need larger arrays in some circumstances // в некоторых случаях могут понадобиться большие массивы PolyLine(){num =0:}

}:

// ттотеттш? intRect class тттттеот

class IntRect{

// a rectangle with integer border values // прямоугольник с целыми значениями границ public:

int left. top. right, bott: IntRect(){left - top - right - bott - 0;} IntRectCint 1. int t. int r. int b) {left - 1: top - t: right - r: bott - b:} void set(int 1. int t. int r. int b) {left - 1: top - t: right - r: bott - b:} void set(IntRect& r)
{left - r.left: top - r.top: right - r.right: bott - r.bott:}
}:

//штттжт® vector2 class

class Vector2{ public: float x.y:

void set(float dx. float dy){ x - dx: у - dy; }


⇐ Предыдущая| |Следующая ⇒