-
Notifications
You must be signed in to change notification settings - Fork 0
/
jerarquico.h
125 lines (111 loc) · 3.57 KB
/
jerarquico.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include "malla.h"
#include "cubo.h"
#include "tetraedro.h"
#include "cono.h"
#include "cilindro.h"
#include "esfera.h"
#include "aux.h"
/*Modelo jerárquico 1 : Flor*/
class Petalo: public Malla3D{
public:
Petalo() ;
void draw(int modoDib, std::vector<bool> modos) ;
void draw() ;
void setColorPetalo(Tupla3f color) ;
void setColorPetaloInv(Tupla3f color) ;
protected:
Esfera * petEsfera = nullptr ;
};
class Tulipa: public Malla3D{
public:
Tulipa() ;
void draw(int modoDib, std::vector<bool> modos) ;
void draw() ;
void caerPetalo(float incremento_x, float incremento_y) ;
protected:
Petalo * tulPetaloAbajo = nullptr ;
Petalo * tulPetaloIzq = nullptr ;
Petalo * tulPetaloDer = nullptr ;
Petalo * tulPetaloArriba = nullptr ;
Esfera * tulCentro = nullptr ;
float caidaPetaloX, caidaPetaloY ;
};
class Flor: public Malla3D{
public:
Flor() ;
void draw(int modoDib, std::vector<bool> modos) ;
void draw() ;
void caerPetalo(float incremento_x, float incremento_y) ;
protected:
Tulipa * florTulipa = nullptr ;
Cilindro * florTallo = nullptr ;
Esfera * florHoja = nullptr ;
} ;
/*Modelo jerárquico 2 : Ganso */
class Pierna: public Malla3D{
public:
Pierna() ;
void draw(int modoDib, std::vector<bool> modos) ;
void draw() ;
protected:
Cubo * piePlanta = nullptr ;
Cilindro * pieCilindro = nullptr ;
Esfera * pieEsfera = nullptr ;
};
class Cuerpo: public Malla3D{
public:
Cuerpo();
void draw(int modoDib, std::vector<bool> modos) ;
void draw() ;
void rotarPiernaDerecha(float incremento_z) ;
void rotarPiernaIzquierda(float incremento_z) ;
protected:
Pierna * cuerPieDer = nullptr ;
Pierna * cuerPieIzq = nullptr ;
Esfera * cuerCentro = nullptr ;
Cono * cuerCola = nullptr ;
float rotacionAlfa, rotacionOmega ;
bool alfa, omega ;
};
class Cabeza: public Malla3D{
public:
Cabeza() ;
void draw(int modoDib, std::vector<bool> modos) ;
void draw() ;
void caerPetalo(float incremento_x, float incremento_y) ;
protected:
Esfera * cabCentro = nullptr ;
Esfera * cabOjoDer = nullptr ;
Esfera * cabOjoIzq = nullptr ;
Tetraedro * cabPico = nullptr ;
Flor * cabFlor = nullptr ;
};
class Cuello: public Malla3D{
public:
Cuello() ;
void draw(int modoDib, std::vector<bool> modos) ;
void draw() ;
void caerPetalo(float incremento_x, float incremento_y) ;
void rotarCabeza(float incremento_x, float incremento_y, float incremento_z) ;
protected:
Cabeza * cueCabeza = nullptr ;
Cilindro * cueCentro = nullptr ;
float rotacionDelta, rotacionEpsilon, rotacionChi ;
bool delta, epsilon, chi ;
};
class Ganso: public Malla3D{
public:
Ganso() ;
void draw(int modoDib, std::vector<bool> modos) ;
void draw() ;
void rotarCuello(float incremento_x , float incremento_y) ;
void rotarCabeza(float incremento_x, float incremento_y, float incremento_z) ;
void caerPetalo(float incremento_x, float incremento_y) ;
void rotarPiernaDerecha(float incremento_z) ;
void rotarPiernaIzquierda(float incremento_z) ;
protected:
Cuerpo * ganCuerpo = nullptr ;
Cuello * ganCuello = nullptr ;
float rotacionBeta, rotacionGamma ;
bool beta, gamma ;
} ;