33 m_pos_x =
new QDoubleSpinBox(
this);
36 m_pos_y =
new QDoubleSpinBox(
this);
39 m_pos_z =
new QDoubleSpinBox(
this);
51 m_ks =
new QDoubleSpinBox(
this);
53 m_kd =
new QDoubleSpinBox(
this);
55 m_nd =
new QSpinBox(
this);
58 m_OK =
new QPushButton(
"Valider",
this);
59 m_Anuller =
new QPushButton(
"Annuller",
this);
64 connect(
m_OK,SIGNAL(clicked()),
this,SLOT(
clickOK()));
66 connect(
m_Anuller,SIGNAL(clicked()),
this,SLOT(close()));
69 QVBoxLayout *layoutglobal =
new QVBoxLayout(
this);
70 this->setLayout(layoutglobal);
72 QHBoxLayout *layoutfichier =
new QHBoxLayout();
76 QHBoxLayout *layouttranslation =
new QHBoxLayout();
77 layouttranslation->addWidget(
m_pos_x);
78 layouttranslation->addWidget(
m_pos_y);
79 layouttranslation->addWidget(
m_pos_z);
81 QHBoxLayout *layoutrotation =
new QHBoxLayout();
86 QHBoxLayout *layoutscale =
new QHBoxLayout();
91 QHBoxLayout *layoutcolor =
new QHBoxLayout();
96 QHBoxLayout *layoutlum =
new QHBoxLayout();
97 layoutlum->addWidget(
m_ks);
98 layoutlum->addWidget(
m_kd);
99 layoutlum->addWidget(
m_nd);
101 QHBoxLayout *layoutbouton =
new QHBoxLayout();
102 layoutbouton->addWidget(
m_OK);
106 layoutglobal->addLayout(layoutfichier);
109 layoutglobal->addLayout(layouttranslation);
112 layoutglobal->addLayout(layoutrotation);
115 layoutglobal->addLayout(layoutscale);
118 layoutglobal->addLayout(layoutcolor);
121 layoutglobal->addLayout(layoutlum);
123 layoutglobal->addLayout(layoutbouton);
164 QFileDialog fen(
this,
"Open PLY", QDir::currentPath(),
"PLY Files (*.ply)");
165 fen.setWindowModality(Qt::ApplicationModal);
167 m_chemin->setText(fen.getOpenFileName());
181 QMessageBox::warning(
this, tr(
"Erreur"),
"Erreur lors du chargement du fichier", QMessageBox::Ok);
200 rotate.
mul(temps,temps2);
204 rotate.
mul(temps2,temps);
208 instance.
world.
mul(translation,rotate);
210 temps = instance.
world;
void mul(matrice44 &M1, matrice44 &M2)
M.mul(M1,M2) multiplication de 2 matrices 4x4.
QDoubleSpinBox * m_Scale_z
void rotationZ(float th)
M.rotationZ(th), construit la matrice de transformation 4x4 associé à une rotation d'axe Z et d'angle...
void rotationY(float th)
M.rotationY(th), construit la matrice de transformation 4x4 associé à une rotation d'axe Y et d'angle...
void rotationX(float th)
M.rotationX(th), construit la matrice de transformation 4x4 associé à une rotation d'axe X et d'angle...
QDoubleSpinBox * m_rotate_z
ObjectInstance & getInstance(unsigned int i)
QDoubleSpinBox * m_rotate_x
void clickgetPath()
AddObject::clickgetPath() C'est un Slot qui ouvre une fenetre afin de selectionner un fichier PLY...
void view()
M.view(), affichage de la matrice.
unsigned int getNbInstance()
Material material
caractéristique du matériau de l'instance
AddObject(QVector< BaseObject * > *obj, QWidget *parent=0)
AddObject::AddObject() Constructeur de la fenetre pour ajouter un object a la scene.
float kd
coefficient de réflexion diffuse
QDoubleSpinBox * m_Scale_y
Math::matrice44 world
matrice de transformation globale de l'instance
rgb col
couleur de l'objet
bool LoadPLY(std::string PlyFilename, bool bInvertNormal=false)
BaseObject::LoadPLY(std::string PlyFilename, bool bInvertNormal) Charge un fichier PLY dans la memoir...
~AddObject()
AddObject::~AddObject() Destructeur de la fenetre pour ajouter un object a la scene.
float ks
coefficient de réflexion spéculaire
QLabel * name_luminositer
QDoubleSpinBox * m_rotate_y
QDoubleSpinBox * m_Scale_x
void translate(vecteur3d v)
M.translate(V), construit la matrice de transformation 4x4 associée à une translation de vecteur V...
structure pour les matrices 4x4
void clickOK()
AddObject::clickOK() C'est un Slot qui crée un object et l'ajoute a la liste des object et pour finir...
void scale(float a, float b, float c)
M.scale(a,b,c), construit une matrice de mise à l'échelle de facteur (a,b,c) respectivement pour les ...