Renommage de classes.
This commit is contained in:
parent
e5798610b0
commit
df0230f1dd
2
Makefile
2
Makefile
|
@ -4,7 +4,7 @@ CCWARN=-Wall -Wextra -Werror
|
||||||
# -flto (nécessite GCC 4.5) -m32 ou -m64
|
# -flto (nécessite GCC 4.5) -m32 ou -m64
|
||||||
CFLAGS=-O0 -I. $(CCWARN)
|
CFLAGS=-O0 -I. $(CCWARN)
|
||||||
|
|
||||||
SOURCES = main.cpp view.cpp hash.cpp vertex.cpp segment.cpp triangle.cpp quad.cpp $(shell echo rules/*/*.cpp)
|
SOURCES = main.cpp view.cpp hash.cpp vertex.cpp segment.cpp triangle.cpp quad.cpp rules/chose.cpp $(shell echo rules/*/*.cpp)
|
||||||
LIBS = -lm -lGL -lGLU -lSDL -lGLEW
|
LIBS = -lm -lGL -lGLU -lSDL -lGLEW
|
||||||
EXECUTABLE = city
|
EXECUTABLE = city
|
||||||
|
|
||||||
|
|
|
@ -26,15 +26,15 @@ class Chose;
|
||||||
#include "view.hh"
|
#include "view.hh"
|
||||||
|
|
||||||
#include "rules/chose.hh"
|
#include "rules/chose.hh"
|
||||||
#include "rules/batiment/batiment.hh"
|
#include "rules/batiment/batimentquad.hh"
|
||||||
#include "rules/route/carrefour.hh"
|
#include "rules/quartier/quartierquad.hh"
|
||||||
#include "rules/route/route.hh"
|
#include "rules/quartier/quartierquadangle.hh"
|
||||||
#include "rules/route/trottoir.hh"
|
#include "rules/quartier/quartierquadcarre.hh"
|
||||||
#include "rules/quartier/quadrilatere.hh"
|
#include "rules/quartier/quartierquadrect.hh"
|
||||||
#include "rules/quartier/quadcroix.hh"
|
#include "rules/quartier/quartiertri.hh"
|
||||||
#include "rules/quartier/quadrect.hh"
|
#include "rules/route/routequadcarrefour.hh"
|
||||||
#include "rules/quartier/quadangle.hh"
|
#include "rules/route/routequadchaussee.hh"
|
||||||
#include "rules/terrain/quadherbe.hh"
|
#include "rules/route/trottoirquadnormal.hh"
|
||||||
#include "rules/tiletri.hh"
|
#include "rules/terrain/terrainquadherbe.hh"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
42
bugs/open/2011-12-12-2019-todo
Normal file
42
bugs/open/2011-12-12-2019-todo
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
Rules
|
||||||
|
=====
|
||||||
|
|
||||||
|
* chose
|
||||||
|
* batiment
|
||||||
|
* batimentquad (sorte de factory interne, fait un addChild : trottoirs (chosit le bon type), jardin (choisir le bon type, batimentquadmaison ou batimentquadimmeuble ou …)
|
||||||
|
* batimentquadmaison
|
||||||
|
* batimentquadimmeuble
|
||||||
|
* etagequad (factory, représente un étage d'une maison ou d'un immeuble par ex).
|
||||||
|
* piecequad (factory, représente une pièce d'un étage)
|
||||||
|
* ouverturequad (factory, paramètre décide si porte ou fenêtre, génère 2 ou 3 modèles de portes ou fenêtre)
|
||||||
|
* pareil pour les tri et penta
|
||||||
|
* mobilier (intérieur et extérieur)
|
||||||
|
* escalier
|
||||||
|
* table
|
||||||
|
* statue
|
||||||
|
* banc
|
||||||
|
* quartier
|
||||||
|
* quartierquad (factory)
|
||||||
|
* quartierquadangle
|
||||||
|
* quartierquadcarre
|
||||||
|
* quartierquadrect
|
||||||
|
* quartiertri (factory)
|
||||||
|
* quartiertrihauteur (coupe le triangle selon sa hauteur)
|
||||||
|
* quartiertriverscarre (coupe un coin du triangle pour en faire un carré)
|
||||||
|
* quartiertriverspenta (coupe un coin du triangle pour en faire un pentagone)
|
||||||
|
* quartierpenta (factory)
|
||||||
|
* quelques motifs quartierpenta*
|
||||||
|
* route
|
||||||
|
* routequad (factory, paramètre indique si l'on veut un carrefour ou une chaussee ou …)
|
||||||
|
* routequadcarrefour
|
||||||
|
* routequadchaussee
|
||||||
|
* routequadparking
|
||||||
|
* trottoirquad (factory, paramètre indique s'il faut un bateau, …)
|
||||||
|
* trottoirquadnormal
|
||||||
|
* trottoirquadbas (la partie basse du bateau)
|
||||||
|
* trottoirquadpente (la pente du bateau)
|
||||||
|
* trottoirquadbateau (se subdivise en 3 trottoirquad* : pente + bas + pente)
|
||||||
|
* un motif pour faire une place
|
||||||
|
* terrain
|
||||||
|
* terrainquadherbe
|
||||||
|
* d'autres terrains…
|
2
main.cpp
2
main.cpp
|
@ -26,7 +26,7 @@ int main() {
|
||||||
Vertex se(size, 0, 0);
|
Vertex se(size, 0, 0);
|
||||||
Vertex sw(0, 0, 0);
|
Vertex sw(0, 0, 0);
|
||||||
Vertex nw(0, size, 0);
|
Vertex nw(0, size, 0);
|
||||||
Chose* c = Quadrilatere::factory(Chose::initialSeed, 0, ne, se, sw, nw);
|
Chose* c = QuartierQuad::factory(Chose::initialSeed, 0, ne, se, sw, nw);
|
||||||
// c->subdivide();
|
// c->subdivide();
|
||||||
recursiveSubdivide(c);
|
recursiveSubdivide(c);
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
Batiment::Batiment(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose(), ne(ne), se(se), sw(sw), nw(nw) {
|
BatimentQuad::BatimentQuad(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose(), ne(ne), se(se), sw(sw), nw(nw) {
|
||||||
addEntropy(ne, se, sw, nw);
|
addEntropy(ne, se, sw, nw);
|
||||||
triangulation();
|
triangulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Batiment::width() { return this->ne.x - this->sw.x; }
|
int BatimentQuad::width() { return this->ne.x - this->sw.x; }
|
||||||
|
|
||||||
int Batiment::height() { return this->ne.y - this->sw.y; }
|
int BatimentQuad::height() { return this->ne.y - this->sw.y; }
|
||||||
|
|
||||||
bool Batiment::subdivide() {
|
bool BatimentQuad::subdivide() {
|
||||||
// TODO : rien ?
|
// TODO : rien ?
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Batiment::triangulation() {
|
void BatimentQuad::triangulation() {
|
||||||
triangles.reserve(12);
|
triangles.reserve(12);
|
||||||
|
|
||||||
int h = hashInRange(seed,0,minHeight,maxHeight);
|
int h = hashInRange(seed,0,minHeight,maxHeight);
|
|
@ -4,7 +4,7 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
// RectangleRoutes est un quadrilatère de routes avec des angles aux coins égaux à 90°.
|
// RectangleRoutes est un quadrilatère de routes avec des angles aux coins égaux à 90°.
|
||||||
class Batiment : public Chose {
|
class BatimentQuad : public Chose {
|
||||||
public:
|
public:
|
||||||
Vertex ne;
|
Vertex ne;
|
||||||
Vertex se;
|
Vertex se;
|
||||||
|
@ -14,7 +14,7 @@ public:
|
||||||
static const int minHeight = 400;
|
static const int minHeight = 400;
|
||||||
static const int maxHeight = 800;
|
static const int maxHeight = 800;
|
||||||
public:
|
public:
|
||||||
Batiment(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
BatimentQuad(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
||||||
int width();
|
int width();
|
||||||
int height();
|
int height();
|
||||||
virtual bool subdivide();
|
virtual bool subdivide();
|
|
@ -1,6 +1,6 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
Quadrilatere::Quadrilatere(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose() {
|
QuartierQuad::QuartierQuad(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose() {
|
||||||
addEntropy(ne, se, sw, nw);
|
addEntropy(ne, se, sw, nw);
|
||||||
corner[NE] = ne;
|
corner[NE] = ne;
|
||||||
corner[SE] = se;
|
corner[SE] = se;
|
||||||
|
@ -8,36 +8,36 @@ Quadrilatere::Quadrilatere(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose()
|
||||||
corner[NW] = nw;
|
corner[NW] = nw;
|
||||||
}
|
}
|
||||||
|
|
||||||
Chose* Quadrilatere::factory(int seed, int n, Vertex ne, Vertex se, Vertex sw, Vertex nw) {
|
Chose* QuartierQuad::factory(int seed, int n, Vertex ne, Vertex se, Vertex sw, Vertex nw) {
|
||||||
Quad q = Quad(ne,se,sw,nw);
|
Quad q = Quad(ne,se,sw,nw);
|
||||||
bool small = q.minLength() < 2500;
|
bool small = q.minLength() < 2500;
|
||||||
bool big = q.maxLength() >= 5000;
|
bool big = q.maxLength() >= 5000;
|
||||||
bool anglesAcceptable = q.minAngle() > Angle::d2r(30) && q.maxAngle() < Angle::d2r(150);
|
bool anglesAcceptable = q.minAngle() > Angle::d2r(90-60) && q.maxAngle() < Angle::d2r(90+60);
|
||||||
bool anglesOk = q.minAngle() > Angle::d2r(50) && q.maxAngle() < Angle::d2r(130);
|
bool anglesOk = q.minAngle() > Angle::d2r(90-40) && q.maxAngle() < Angle::d2r(90+40);
|
||||||
bool tooWideX = q.minLengthEW() * 2 < q.maxLengthNS(); // trop allongé (côté E ou W deux fois plus petit que le côté N ou S).
|
bool tooWideX = q.minLengthEW() * 2 < q.maxLengthNS(); // trop allongé (côté E ou W deux fois plus petit que le côté N ou S).
|
||||||
bool tooWideY = q.minLengthNS() * 2 < q.maxLengthEW(); // trop allongé (côté N ou S deux fois plus petit que le côté E ou W).
|
bool tooWideY = q.minLengthNS() * 2 < q.maxLengthEW(); // trop allongé (côté N ou S deux fois plus petit que le côté E ou W).
|
||||||
if (!big && proba(seed, n, 1, 20)) {
|
if (!big && proba(seed, n, 1, 20)) {
|
||||||
return new QuadHerbe(ne, se, sw, nw);
|
return new TerrainQuadHerbe(ne, se, sw, nw);
|
||||||
} else if (small && anglesAcceptable) {
|
} else if (small && anglesAcceptable) {
|
||||||
return new Batiment(ne, se, sw, nw);
|
return new BatimentQuad(ne, se, sw, nw);
|
||||||
} else if (!small && !anglesOk) {
|
} else if (!small && !anglesOk) {
|
||||||
return new QuadAngle(ne, se, sw, nw);
|
return new QuartierQuadAngle(ne, se, sw, nw);
|
||||||
} else if (!small && tooWideY) {
|
} else if (!small && tooWideY) {
|
||||||
return new QuadRect(nw, ne, se, sw);
|
return new QuartierQuadRect(nw, ne, se, sw);
|
||||||
} else if (!small && tooWideX) {
|
} else if (!small && tooWideX) {
|
||||||
return new QuadRect(ne, se, sw, nw);
|
return new QuartierQuadRect(ne, se, sw, nw);
|
||||||
} else if (!small) {
|
} else if (!small) {
|
||||||
return new QuadCroix(ne, se, sw, nw);
|
return new QuartierQuadCarre(ne, se, sw, nw);
|
||||||
} else {
|
} else {
|
||||||
return new QuadHerbe(ne, se, sw, nw);
|
return new TerrainQuadHerbe(ne, se, sw, nw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Quadrilatere::subdivide() {
|
bool QuartierQuad::subdivide() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Quadrilatere::triangulation() {
|
void QuartierQuad::triangulation() {
|
||||||
triangles.reserve(2);
|
triangles.reserve(2);
|
||||||
addTriangle(new Triangle(corner[NE], corner[NW], corner[SW], 0xc0, 0xc0, 0xc0));
|
addTriangle(new Triangle(corner[NE], corner[NW], corner[SW], 0xc0, 0xc0, 0xc0));
|
||||||
addTriangle(new Triangle(corner[SW], corner[SE], corner[NE], 0xc0, 0xc0, 0xc0));
|
addTriangle(new Triangle(corner[SW], corner[SE], corner[NE], 0xc0, 0xc0, 0xc0));
|
|
@ -4,11 +4,11 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
// RectangleRoutes est un quadrilatère de routes avec des angles aux coins égaux à 90°.
|
// RectangleRoutes est un quadrilatère de routes avec des angles aux coins égaux à 90°.
|
||||||
class Quadrilatere : public Chose {
|
class QuartierQuad : public Chose {
|
||||||
public:
|
public:
|
||||||
Vertex corner[4];
|
Vertex corner[4];
|
||||||
public:
|
public:
|
||||||
Quadrilatere(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
QuartierQuad(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
||||||
virtual bool subdivide();
|
virtual bool subdivide();
|
||||||
virtual void triangulation();
|
virtual void triangulation();
|
||||||
static Chose* factory(int seed, int n, Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
static Chose* factory(int seed, int n, Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
|
@ -1,21 +1,21 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
QuadAngle::QuadAngle(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Quadrilatere(ne, se, sw, nw) {
|
QuartierQuadAngle::QuartierQuadAngle(Vertex ne, Vertex se, Vertex sw, Vertex nw) : QuartierQuad(ne, se, sw, nw) {
|
||||||
triangulation();
|
triangulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuadAngle::subdivide() {
|
bool QuartierQuadAngle::subdivide() {
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if (Triangle(corner[NW+i], corner[NE+i], corner[SE+i]).angle() >= Angle::d2r(130)) {
|
if (Triangle(corner[NW+i], corner[NE+i], corner[SE+i]).angle() >= Angle::d2r(130)) {
|
||||||
Triangle t1(corner[NE+i], corner[SE+i], corner[SW+i]);
|
Triangle t1(corner[NE+i], corner[SE+i], corner[SW+i]);
|
||||||
t1.offsetBase(-hrw);
|
t1.offsetBase(-hrw);
|
||||||
Triangle t2(corner[SW+i], corner[NW+i], corner[NE+i]);
|
Triangle t2(corner[SW+i], corner[NW+i], corner[NE+i]);
|
||||||
t2.offsetBase(-hrw);
|
t2.offsetBase(-hrw);
|
||||||
addChild(TileTri::factory(seed, 0, t1.v1, t1.v2, t1.v3));
|
addChild(QuartierTri::factory(seed, 0, t1.v1, t1.v2, t1.v3));
|
||||||
addChild(TileTri::factory(seed, 1, t2.v1, t2.v2, t2.v3));
|
addChild(QuartierTri::factory(seed, 1, t2.v1, t2.v2, t2.v3));
|
||||||
addChild(new Route(t1.v1, t1.v3, t2.v1, t2.v3));
|
addChild(new RouteQuadChaussee(t1.v1, t1.v3, t2.v1, t2.v3));
|
||||||
addChild(new TileTri(t2.v3, corner[NE+i], t1.v1)); // TODO : new RouteTri
|
addChild(new QuartierTri(t2.v3, corner[NE+i], t1.v1)); // TODO : new RouteTri
|
||||||
addChild(new TileTri(t1.v3, corner[SW+i], t2.v1)); // TODO : new RouteTri
|
addChild(new QuartierTri(t1.v3, corner[SW+i], t2.v1)); // TODO : new RouteTri
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,24 +33,24 @@ bool QuadAngle::subdivide() {
|
||||||
Vertex oldv3 = tn.v3;
|
Vertex oldv3 = tn.v3;
|
||||||
tn.offsetBase(-hrw);
|
tn.offsetBase(-hrw);
|
||||||
q.offset(E, -hrw);
|
q.offset(E, -hrw);
|
||||||
addChild(TileTri::factory(seed, 0, tn.v1, tn.v2, tn.v3));
|
addChild(QuartierTri::factory(seed, 0, tn.v1, tn.v2, tn.v3));
|
||||||
addChild(Quadrilatere::factory(seed, 1, q.corner[0], q.corner[1], q.corner[2], q.corner[3]));
|
addChild(QuartierQuad::factory(seed, 1, q.corner[0], q.corner[1], q.corner[2], q.corner[3]));
|
||||||
addChild(new Route(tn.v1, tn.v3, q.corner[1], q.corner[0]));
|
addChild(new RouteQuadChaussee(tn.v1, tn.v3, q.corner[1], q.corner[0]));
|
||||||
addChild(new TileTri(tn.v3, oldv3, q.corner[1])); // TODO : new RouteTri
|
addChild(new QuartierTri(tn.v3, oldv3, q.corner[1])); // TODO : new RouteTri
|
||||||
} else {
|
} else {
|
||||||
q = Quad(corner[NW+i], e, corner[SE+i], corner[SW+i]);
|
q = Quad(corner[NW+i], e, corner[SE+i], corner[SW+i]);
|
||||||
Vertex oldv1 = te.v1;
|
Vertex oldv1 = te.v1;
|
||||||
te.offsetBase(-hrw);
|
te.offsetBase(-hrw);
|
||||||
q.offset(E, -hrw);
|
q.offset(E, -hrw);
|
||||||
addChild(TileTri::factory(seed, 0, te.v1, te.v2, te.v3));
|
addChild(QuartierTri::factory(seed, 0, te.v1, te.v2, te.v3));
|
||||||
addChild(Quadrilatere::factory(seed, 1, q.corner[0], q.corner[1], q.corner[2], q.corner[3]));
|
addChild(QuartierQuad::factory(seed, 1, q.corner[0], q.corner[1], q.corner[2], q.corner[3]));
|
||||||
addChild(new Route(te.v1, te.v3, q.corner[1], q.corner[0]));
|
addChild(new RouteQuadChaussee(te.v1, te.v3, q.corner[1], q.corner[0]));
|
||||||
addChild(new TileTri(q.corner[0], oldv1, te.v1)); // TODO : new RouteTri
|
addChild(new QuartierTri(q.corner[0], oldv1, te.v1)); // TODO : new RouteTri
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ne devait jamais arriver ici !
|
// Ne devait jamais arriver ici !
|
||||||
addChild(new QuadHerbe(corner[NE], corner[SE], corner[SW], corner[NW]));
|
addChild(new TerrainQuadHerbe(corner[NE], corner[SE], corner[SW], corner[NW]));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
|
@ -4,11 +4,11 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
// QuadAngle est un quadrilatère avec des angles malfichus (< 90-40 ou > 90+40).
|
// QuadAngle est un quadrilatère avec des angles malfichus (< 90-40 ou > 90+40).
|
||||||
class QuadAngle : public Quadrilatere {
|
class QuartierQuadAngle : public QuartierQuad {
|
||||||
private:
|
private:
|
||||||
static const int hrw = 150; // half road width : 2,50m.
|
static const int hrw = 150; // half road width : 2,50m.
|
||||||
public:
|
public:
|
||||||
QuadAngle(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
QuartierQuadAngle(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
||||||
virtual bool subdivide();
|
virtual bool subdivide();
|
||||||
private:
|
private:
|
||||||
void cutAngle();
|
void cutAngle();
|
|
@ -1,9 +1,9 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
QuadCroix::QuadCroix(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Quadrilatere(ne, se, sw, nw) {
|
QuartierQuadCarre::QuartierQuadCarre(Vertex ne, Vertex se, Vertex sw, Vertex nw) : QuartierQuad(ne, se, sw, nw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuadCroix::subdivide() {
|
bool QuartierQuadCarre::subdivide() {
|
||||||
Vertex middle[4];
|
Vertex middle[4];
|
||||||
Quad q[4];
|
Quad q[4];
|
||||||
|
|
||||||
|
@ -18,10 +18,10 @@ bool QuadCroix::subdivide() {
|
||||||
q[i] = Quad(corner[NE+i], middle[E+i], c, middle[N+i]);
|
q[i] = Quad(corner[NE+i], middle[E+i], c, middle[N+i]);
|
||||||
q[i].offset(W,-hrw); q[i].offset(S,-hrw);
|
q[i].offset(W,-hrw); q[i].offset(S,-hrw);
|
||||||
}
|
}
|
||||||
addChild(new Carrefour(q[0].corner[SW], q[1].corner[SW], q[2].corner[SW], q[3].corner[SW]));
|
addChild(new RouteQuadCarrefour(q[0].corner[SW], q[1].corner[SW], q[2].corner[SW], q[3].corner[SW]));
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
addChild(new Route(q[NE+i].corner[NW], q[NE+i].corner[SW], q[NW+i].corner[SW], q[NW+i].corner[SE]));
|
addChild(new RouteQuadChaussee(q[NE+i].corner[NW], q[NE+i].corner[SW], q[NW+i].corner[SW], q[NW+i].corner[SE]));
|
||||||
addChild(Quadrilatere::factory(seed, 4+i, q[i].corner[0], q[i].corner[1], q[i].corner[2], q[i].corner[3]));
|
addChild(QuartierQuad::factory(seed, 4+i, q[i].corner[0], q[i].corner[1], q[i].corner[2], q[i].corner[3]));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
|
@ -4,11 +4,11 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
// Quad est un quadrilatère
|
// Quad est un quadrilatère
|
||||||
class QuadCroix : public Quadrilatere {
|
class QuartierQuadCarre : public QuartierQuad {
|
||||||
private:
|
private:
|
||||||
static const int hrw = 250; // half road width : 2,50m.
|
static const int hrw = 250; // half road width : 2,50m.
|
||||||
public:
|
public:
|
||||||
QuadCroix(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
QuartierQuadCarre(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
||||||
virtual bool subdivide();
|
virtual bool subdivide();
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
QuadRect::QuadRect(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Quadrilatere(ne, se, sw, nw) {
|
QuartierQuadRect::QuartierQuadRect(Vertex ne, Vertex se, Vertex sw, Vertex nw) : QuartierQuad(ne, se, sw, nw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuadRect::subdivide() {
|
bool QuartierQuadRect::subdivide() {
|
||||||
Vertex n = Segment(corner[NW], corner[NE]).randomPos(seed, 0, 33, 67);
|
Vertex n = Segment(corner[NW], corner[NE]).randomPos(seed, 0, 33, 67);
|
||||||
Vertex s = Segment(corner[SE], corner[SW]).randomPos(seed, 1, 33, 67);
|
Vertex s = Segment(corner[SE], corner[SW]).randomPos(seed, 1, 33, 67);
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@ bool QuadRect::subdivide() {
|
||||||
qe.offset(W,-hrw);
|
qe.offset(W,-hrw);
|
||||||
qw.offset(W,-hrw);
|
qw.offset(W,-hrw);
|
||||||
|
|
||||||
addChild(new Route(qe.corner[NW], qe.corner[SW], qw.corner[NW], qw.corner[SW]));
|
addChild(new RouteQuadChaussee(qe.corner[NW], qe.corner[SW], qw.corner[NW], qw.corner[SW]));
|
||||||
addChild(Quadrilatere::factory(seed, 2, qe.corner[0], qe.corner[1], qe.corner[2], qe.corner[3]));
|
addChild(QuartierQuad::factory(seed, 2, qe.corner[0], qe.corner[1], qe.corner[2], qe.corner[3]));
|
||||||
addChild(Quadrilatere::factory(seed, 3, qw.corner[0], qw.corner[1], qw.corner[2], qw.corner[3]));
|
addChild(QuartierQuad::factory(seed, 3, qw.corner[0], qw.corner[1], qw.corner[2], qw.corner[3]));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
|
@ -4,11 +4,11 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
// Quad est un quadrilatère
|
// Quad est un quadrilatère
|
||||||
class QuadRect : public Quadrilatere {
|
class QuartierQuadRect : public QuartierQuad {
|
||||||
private:
|
private:
|
||||||
static const int hrw = 250; // half road width : 2,50m.
|
static const int hrw = 250; // half road width : 2,50m.
|
||||||
public:
|
public:
|
||||||
QuadRect(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
QuartierQuadRect(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
||||||
virtual bool subdivide();
|
virtual bool subdivide();
|
||||||
};
|
};
|
||||||
|
|
25
rules/quartier/quartiertri.cpp
Normal file
25
rules/quartier/quartiertri.cpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#include "all_includes.hh"
|
||||||
|
|
||||||
|
QuartierTri::QuartierTri(Vertex left, Vertex top, Vertex right) : Chose() {
|
||||||
|
addEntropy(left, top, right);
|
||||||
|
corner[0] = left;
|
||||||
|
corner[1] = top;
|
||||||
|
corner[2] = right;
|
||||||
|
triangulation();
|
||||||
|
}
|
||||||
|
|
||||||
|
Chose* QuartierTri::factory(int seed, int n, Vertex left, Vertex top, Vertex right) {
|
||||||
|
(void)seed;
|
||||||
|
(void)n;
|
||||||
|
// TODO
|
||||||
|
return new QuartierTri(left, top, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QuartierTri::subdivide() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QuartierTri::triangulation() {
|
||||||
|
triangles.reserve(1);
|
||||||
|
addTriangle(new Triangle(corner[0], corner[1], corner[2], 0xf0, 0xc0, 0xc0));
|
||||||
|
}
|
|
@ -4,11 +4,11 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
// RectangleRoutes est un quadrilatère de routes avec des angles aux coins égaux à 90°.
|
// RectangleRoutes est un quadrilatère de routes avec des angles aux coins égaux à 90°.
|
||||||
class TileTri : public Chose {
|
class QuartierTri : public Chose {
|
||||||
public:
|
public:
|
||||||
Vertex corner[3];
|
Vertex corner[3];
|
||||||
public:
|
public:
|
||||||
TileTri(Vertex left, Vertex top, Vertex right);
|
QuartierTri(Vertex left, Vertex top, Vertex right);
|
||||||
virtual bool subdivide();
|
virtual bool subdivide();
|
||||||
virtual void triangulation();
|
virtual void triangulation();
|
||||||
static Chose* factory(int seed, int n, Vertex left, Vertex top, Vertex right);
|
static Chose* factory(int seed, int n, Vertex left, Vertex top, Vertex right);
|
|
@ -1,45 +0,0 @@
|
||||||
#include "all_includes.hh"
|
|
||||||
|
|
||||||
TileTri::TileTri(Vertex left, Vertex top, Vertex right) : Chose() {
|
|
||||||
addEntropy(left, top, right);
|
|
||||||
corner[0] = left;
|
|
||||||
corner[1] = top;
|
|
||||||
corner[2] = right;
|
|
||||||
triangulation();
|
|
||||||
}
|
|
||||||
|
|
||||||
Chose* TileTri::factory(int seed, int n, Vertex left, Vertex top, Vertex right) {
|
|
||||||
(void)seed;
|
|
||||||
(void)n;
|
|
||||||
return new TileTri(left, top, right);
|
|
||||||
// Quad q = Quad(ne,se,sw,nw);
|
|
||||||
// bool small = q.minLength() < 2500;
|
|
||||||
// bool big = q.maxLength() >= 5000;
|
|
||||||
// bool anglesOk = q.minAngle() > Angle::d2r(50) && q.maxAngle() < Angle::d2r(130);
|
|
||||||
// bool tooWideX = q.minLengthEW() * 2 < q.maxLengthNS(); // trop allongé (côté E ou W deux fois plus petit que le côté N ou S).
|
|
||||||
// bool tooWideY = q.minLengthNS() * 2 < q.maxLengthEW(); // trop allongé (côté N ou S deux fois plus petit que le côté E ou W).
|
|
||||||
// if (!big && proba(seed, n, 1, 20)) {
|
|
||||||
// return new QuadHerbe(ne, se, sw, nw);
|
|
||||||
// } else if (small && anglesOk) {
|
|
||||||
// return new Batiment(ne, se, sw, nw);
|
|
||||||
// } else if (!anglesOk) {
|
|
||||||
// return new QuadAngle(ne, se, sw, nw);
|
|
||||||
// } else if (!small && tooWideY) {
|
|
||||||
// return new QuadRect(nw, ne, se, sw);
|
|
||||||
// } else if (!small && tooWideX) {
|
|
||||||
// return new QuadRect(ne, se, sw, nw);
|
|
||||||
// } else if (!small) {
|
|
||||||
// return new QuadCroix(ne, se, sw, nw);
|
|
||||||
// } else {
|
|
||||||
// return new QuadHerbe(ne, se, sw, nw);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TileTri::subdivide() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TileTri::triangulation() {
|
|
||||||
triangles.reserve(1);
|
|
||||||
addTriangle(new Triangle(corner[0], corner[1], corner[2], 0xf0, 0xc0, 0xc0));
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
#include "all_includes.hh"
|
|
||||||
|
|
||||||
Carrefour::Carrefour(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose(), ne(ne), se(se), sw(sw), nw(nw) {
|
|
||||||
addEntropy(ne,se,sw,nw);
|
|
||||||
triangulation();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Carrefour::subdivide() {
|
|
||||||
// TODO
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const Carrefour* c) {
|
|
||||||
return os << *c;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const Carrefour& c) {
|
|
||||||
return os << "Carrefour " << c.ne << "-" << c.se << "-" << c.sw << "-" << c.nw;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Carrefour::triangulation() {
|
|
||||||
triangles.reserve(2);
|
|
||||||
addTriangle(new Triangle(ne, nw, sw, 0x36, 0x36, 0x36));
|
|
||||||
addTriangle(new Triangle(sw, se, ne, 0x36, 0x36, 0x36));
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
#ifndef _CARREFOUR_ROUTE_HH_
|
|
||||||
#define _CARREFOUR_ROUTE_HH_
|
|
||||||
|
|
||||||
#include "all_includes.hh"
|
|
||||||
|
|
||||||
class Carrefour : public Chose {
|
|
||||||
public:
|
|
||||||
Vertex ne;
|
|
||||||
Vertex se;
|
|
||||||
Vertex sw;
|
|
||||||
Vertex nw;
|
|
||||||
public:
|
|
||||||
Carrefour(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
|
||||||
virtual bool subdivide();
|
|
||||||
virtual void triangulation();
|
|
||||||
// TODO : Carrefour::replacePoint (pour pouvoir transformer un carrefour 4 en carrefour 5 et +).
|
|
||||||
public:
|
|
||||||
friend std::ostream& operator<<(std::ostream& os, const Carrefour& c);
|
|
||||||
friend std::ostream& operator<<(std::ostream& os, const Carrefour* c);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,21 +0,0 @@
|
||||||
#ifndef _RULES_ROUTE_HH_
|
|
||||||
#define _RULES_ROUTE_HH_
|
|
||||||
|
|
||||||
#include "all_includes.hh"
|
|
||||||
|
|
||||||
class Route : public Chose {
|
|
||||||
public:
|
|
||||||
Vertex ne;
|
|
||||||
Vertex se;
|
|
||||||
Vertex sw;
|
|
||||||
Vertex nw;
|
|
||||||
public:
|
|
||||||
Route(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
|
||||||
virtual bool subdivide();
|
|
||||||
virtual void triangulation();
|
|
||||||
public:
|
|
||||||
friend std::ostream& operator<<(std::ostream& os, const Route& r);
|
|
||||||
friend std::ostream& operator<<(std::ostream& os, const Route* r);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
17
rules/route/routequadcarrefour.cpp
Normal file
17
rules/route/routequadcarrefour.cpp
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#include "all_includes.hh"
|
||||||
|
|
||||||
|
RouteQuadCarrefour::RouteQuadCarrefour(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose(), ne(ne), se(se), sw(sw), nw(nw) {
|
||||||
|
addEntropy(ne,se,sw,nw);
|
||||||
|
triangulation();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RouteQuadCarrefour::subdivide() {
|
||||||
|
// TODO
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RouteQuadCarrefour::triangulation() {
|
||||||
|
triangles.reserve(2);
|
||||||
|
addTriangle(new Triangle(ne, nw, sw, 0x36, 0x36, 0x36));
|
||||||
|
addTriangle(new Triangle(sw, se, ne, 0x36, 0x36, 0x36));
|
||||||
|
}
|
18
rules/route/routequadcarrefour.hh
Normal file
18
rules/route/routequadcarrefour.hh
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef _CARREFOUR_ROUTE_HH_
|
||||||
|
#define _CARREFOUR_ROUTE_HH_
|
||||||
|
|
||||||
|
#include "all_includes.hh"
|
||||||
|
|
||||||
|
class RouteQuadCarrefour : public Chose {
|
||||||
|
public:
|
||||||
|
Vertex ne;
|
||||||
|
Vertex se;
|
||||||
|
Vertex sw;
|
||||||
|
Vertex nw;
|
||||||
|
public:
|
||||||
|
RouteQuadCarrefour(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
||||||
|
virtual bool subdivide();
|
||||||
|
virtual void triangulation();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,30 +1,22 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
Route::Route(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose(), ne(ne), se(se), sw(sw), nw(nw) {
|
RouteQuadChaussee::RouteQuadChaussee(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose(), ne(ne), se(se), sw(sw), nw(nw) {
|
||||||
triangulation();
|
triangulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Route::subdivide() {
|
bool RouteQuadChaussee::subdivide() {
|
||||||
// TODO
|
// TODO
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const Route* r) {
|
void RouteQuadChaussee::triangulation() {
|
||||||
return os << *r;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const Route& r) {
|
|
||||||
return os << "Route " << r.ne << "-" << r.se << "-" << r.sw << "-" << r.nw;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Route::triangulation() {
|
|
||||||
triangles.reserve(2);
|
triangles.reserve(2);
|
||||||
addTriangle(new Triangle(ne, nw, sw, 0x36, 0x36, 0x36));
|
addTriangle(new Triangle(ne, nw, sw, 0x36, 0x36, 0x36));
|
||||||
addTriangle(new Triangle(sw, se, ne, 0x36, 0x36, 0x36));
|
addTriangle(new Triangle(sw, se, ne, 0x36, 0x36, 0x36));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Version avec trottoirs.
|
// Version avec trottoirs.
|
||||||
/*void Route::triangulation() {
|
/*void RouteQuadChaussee::triangulation() {
|
||||||
triangles.reserve(2);
|
triangles.reserve(2);
|
||||||
Vertex nne, nnw, nse, nsw; // Nouvel emplacement de la route.
|
Vertex nne, nnw, nse, nsw; // Nouvel emplacement de la route.
|
||||||
|
|
18
rules/route/routequadchaussee.hh
Normal file
18
rules/route/routequadchaussee.hh
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef _RULES_ROUTE_HH_
|
||||||
|
#define _RULES_ROUTE_HH_
|
||||||
|
|
||||||
|
#include "all_includes.hh"
|
||||||
|
|
||||||
|
class RouteQuadChaussee : public Chose {
|
||||||
|
public:
|
||||||
|
Vertex ne;
|
||||||
|
Vertex se;
|
||||||
|
Vertex sw;
|
||||||
|
Vertex nw;
|
||||||
|
public:
|
||||||
|
RouteQuadChaussee(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
||||||
|
virtual bool subdivide();
|
||||||
|
virtual void triangulation();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,6 +1,6 @@
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
TrottoirRoute::TrottoirRoute(Vertex ne, Vertex se, Vertex sw, Vertex nw, int height) {
|
TrottoirQuadNormal::TrottoirQuadNormal(Vertex ne, Vertex se, Vertex sw, Vertex nw, int height) {
|
||||||
this->ne = ne;
|
this->ne = ne;
|
||||||
this->nw = nw;
|
this->nw = nw;
|
||||||
this->se = se;
|
this->se = se;
|
||||||
|
@ -9,12 +9,12 @@ TrottoirRoute::TrottoirRoute(Vertex ne, Vertex se, Vertex sw, Vertex nw, int hei
|
||||||
triangulation();
|
triangulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TrottoirRoute::subdivide() {
|
bool TrottoirQuadNormal::subdivide() {
|
||||||
// TODO
|
// TODO
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrottoirRoute::triangulation() {
|
void TrottoirQuadNormal::triangulation() {
|
||||||
addTriangle(new Triangle(ne + Vertex(0,0,height), nw + Vertex(0,0,height) , sw + Vertex(0,0,height), 0x66, 0x66, 0x66));
|
addTriangle(new Triangle(ne + Vertex(0,0,height), nw + Vertex(0,0,height) , sw + Vertex(0,0,height), 0x66, 0x66, 0x66));
|
||||||
addTriangle(new Triangle(sw + Vertex(0,0,height), se + Vertex(0,0,height), ne + Vertex(0,0,height), 0x66, 0x66, 0x66));
|
addTriangle(new Triangle(sw + Vertex(0,0,height), se + Vertex(0,0,height), ne + Vertex(0,0,height), 0x66, 0x66, 0x66));
|
||||||
addTriangle(new Triangle(ne + Vertex(0,0,height), nw + Vertex(0,0,height), sw + Vertex(0,0,height), 0x66, 0x66, 0x66));
|
addTriangle(new Triangle(ne + Vertex(0,0,height), nw + Vertex(0,0,height), sw + Vertex(0,0,height), 0x66, 0x66, 0x66));
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "all_includes.hh"
|
#include "all_includes.hh"
|
||||||
|
|
||||||
class TrottoirRoute : public Chose {
|
class TrottoirQuadNormal : public Chose {
|
||||||
private :
|
private :
|
||||||
Vertex ne;
|
Vertex ne;
|
||||||
Vertex se;
|
Vertex se;
|
||||||
|
@ -12,7 +12,7 @@ class TrottoirRoute : public Chose {
|
||||||
int height;
|
int height;
|
||||||
|
|
||||||
public :
|
public :
|
||||||
TrottoirRoute(Vertex ne, Vertex se, Vertex sw, Vertex nw, int height);
|
TrottoirQuadNormal(Vertex ne, Vertex se, Vertex sw, Vertex nw, int height);
|
||||||
virtual bool subdivide();
|
virtual bool subdivide();
|
||||||
virtual void triangulation();
|
virtual void triangulation();
|
||||||
};
|
};
|
|
@ -1,15 +0,0 @@
|
||||||
#include "all_includes.hh"
|
|
||||||
|
|
||||||
QuadHerbe::QuadHerbe(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Quadrilatere(ne, se, sw, nw), red(0x11) {
|
|
||||||
triangulation();
|
|
||||||
}
|
|
||||||
|
|
||||||
QuadHerbe::QuadHerbe(int red, Vertex ne, Vertex se, Vertex sw, Vertex nw) : Quadrilatere(ne, se, sw, nw), red(red) {
|
|
||||||
triangulation();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QuadHerbe::triangulation() {
|
|
||||||
triangles.reserve(2);
|
|
||||||
addTriangle(new Triangle(corner[NE], corner[NW], corner[SW], red, 0xaa, 0x22));
|
|
||||||
addTriangle(new Triangle(corner[SW], corner[SE], corner[NE], red, 0xaa, 0x22));
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
#ifndef _RULES_QUAD_HERBE_HH_
|
|
||||||
#define _RULES_QUAD_HERBE_HH_
|
|
||||||
|
|
||||||
#include "all_includes.hh"
|
|
||||||
|
|
||||||
// Quad est un quadrilatère
|
|
||||||
class QuadHerbe : public Quadrilatere {
|
|
||||||
private:
|
|
||||||
int red;
|
|
||||||
public:
|
|
||||||
QuadHerbe(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
|
||||||
QuadHerbe(int red, Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
|
||||||
virtual void triangulation();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
29
rules/terrain/terrainquadherbe.cpp
Normal file
29
rules/terrain/terrainquadherbe.cpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#include "all_includes.hh"
|
||||||
|
|
||||||
|
TerrainQuadHerbe::TerrainQuadHerbe(Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose(), red(0x11) {
|
||||||
|
addEntropy(ne, se, sw, nw);
|
||||||
|
corner[NE] = ne;
|
||||||
|
corner[SE] = se;
|
||||||
|
corner[SW] = sw;
|
||||||
|
corner[NW] = nw;
|
||||||
|
triangulation();
|
||||||
|
}
|
||||||
|
|
||||||
|
TerrainQuadHerbe::TerrainQuadHerbe(int red, Vertex ne, Vertex se, Vertex sw, Vertex nw) : Chose(), red(red) {
|
||||||
|
addEntropy(ne, se, sw, nw);
|
||||||
|
corner[NE] = ne;
|
||||||
|
corner[SE] = se;
|
||||||
|
corner[SW] = sw;
|
||||||
|
corner[NW] = nw;
|
||||||
|
triangulation();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TerrainQuadHerbe::subdivide() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TerrainQuadHerbe::triangulation() {
|
||||||
|
triangles.reserve(2);
|
||||||
|
addTriangle(new Triangle(corner[NE], corner[NW], corner[SW], red, 0xaa, 0x22));
|
||||||
|
addTriangle(new Triangle(corner[SW], corner[SE], corner[NE], red, 0xaa, 0x22));
|
||||||
|
}
|
19
rules/terrain/terrainquadherbe.hh
Normal file
19
rules/terrain/terrainquadherbe.hh
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef _RULES_QUAD_HERBE_HH_
|
||||||
|
#define _RULES_QUAD_HERBE_HH_
|
||||||
|
|
||||||
|
#include "all_includes.hh"
|
||||||
|
|
||||||
|
// Quad est un quadrilatère
|
||||||
|
class TerrainQuadHerbe : public Chose {
|
||||||
|
private:
|
||||||
|
Vertex corner[4];
|
||||||
|
int red; // DEBUG
|
||||||
|
public:
|
||||||
|
TerrainQuadHerbe(Vertex ne, Vertex se, Vertex sw, Vertex nw);
|
||||||
|
TerrainQuadHerbe(int red, Vertex ne, Vertex se, Vertex sw, Vertex nw); // DEBUG
|
||||||
|
virtual bool subdivide();
|
||||||
|
virtual void triangulation();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user