-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
175 changed files
with
27,045 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef __CFRMHENOC_H__ | ||
#define __CFRMHENOC_H__ | ||
|
||
#include "ui_frmHenoc.h" | ||
#include<QtGui> | ||
#include<QtXml> | ||
#include<iostream> | ||
#include<henocUniverseI.h> | ||
|
||
|
||
using namespace std; | ||
|
||
using namespace Ui; | ||
|
||
class DiagramScene; | ||
class QGraphicsItem; | ||
class GLWidget; | ||
class QTimer; | ||
|
||
class CfrmHenoc : public QMainWindow, frmHenoc { | ||
Q_OBJECT | ||
public: | ||
CfrmHenoc(QWidget * parent = 0, Qt::WFlags flags = 0 ); | ||
public slots: | ||
void changeProperties(); | ||
void Delete(); | ||
void Stop(); | ||
void Save(); | ||
void Open(); | ||
void Play(); | ||
void AddBox(); | ||
void AddLine(); | ||
void AddCatapult(); | ||
void AddBall(); | ||
void itemInserted(QGraphicsItem *); | ||
private: | ||
void XkiAddLine(QDomElement &, int x1, int y1, int x2, int y2, float friction, int colMask, int frictionMask); | ||
void XkiAddBox(QDomElement &, int x, int y, int w, int h, float mass, float friction, float bounceFactor, float bounceVelocity, int colMask, int frictionMask, int rotation); | ||
void XkiAddBall(QDomElement &, int x, int y, int r, float mass, float friction, float bounceFactor, float bounceVelocity, int colMask, int frictionMask, int rotation); | ||
GLWidget *glWidget; | ||
DiagramScene *scene; | ||
QTimer *timer; | ||
HenocUniverseI::Whstc myWorldProp; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include<QtGui> | ||
#include<CfrmMundo.h> | ||
|
||
|
||
using namespace HenocUniverseI; | ||
|
||
CfrmMundo::CfrmMundo(Whstc *pW, QWidget *parent, Qt::WindowFlags f):QDialog(parent,f),mW(pW){ | ||
setupUi(this); | ||
connect(btnAceptar, SIGNAL(clicked()), this, SLOT(Aceptar())); | ||
connect(btnCancelar, SIGNAL(clicked()), this, SLOT(Cancelar())); | ||
connect(btnLimpiar, SIGNAL(clicked()), this, SLOT(Limpiar())); | ||
|
||
intfactorDeAnimacion->setValue( mW->fAnim ); | ||
fltdelta->setValue( mW->delta ); | ||
intCorrelacionMaximaDeVelocidad->setValue( mW->cmv ); | ||
fltFactorDeContactoSuperficial->setValue( mW->fcs ); | ||
intGravedad->setValue( mW->gravity ); | ||
fltUmbralDeLinealidad->setValue( mW->lin ); | ||
fltUmbralDeCorreccionDeErrores->setValue( mW->erp ); | ||
intCoaccion->setValue( mW->co ); | ||
|
||
} | ||
|
||
void CfrmMundo::Aceptar(){ | ||
mW->fAnim = intfactorDeAnimacion->value(); | ||
mW->delta = fltdelta->value(); | ||
mW->cmv = intCorrelacionMaximaDeVelocidad->value(); | ||
mW->fcs = fltFactorDeContactoSuperficial->value(); | ||
mW->gravity = intGravedad->value(); | ||
mW->lin = fltUmbralDeLinealidad->value(); | ||
mW->erp = fltUmbralDeCorreccionDeErrores->value(); | ||
mW->co = intCoaccion->value(); | ||
accept(); | ||
} | ||
|
||
void CfrmMundo::Limpiar(){ | ||
|
||
} | ||
|
||
void CfrmMundo::Cancelar(){ | ||
reject(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef __CFRMMUNDO_H__ | ||
#define __CFRMMUNDO_H__ | ||
|
||
#include "ui_frmMundo.h" | ||
#include <QtGui> | ||
#include <henocUniverseI.h> | ||
|
||
using namespace Ui; | ||
using namespace HenocUniverseI; | ||
|
||
class CfrmMundo : public QDialog, frmMundo{ | ||
Q_OBJECT | ||
public: | ||
CfrmMundo(Whstc *pW, QWidget * parent = 0, Qt::WindowFlags f = 0); | ||
public slots: | ||
void Aceptar(); | ||
void Limpiar(); | ||
void Cancelar(); | ||
private: | ||
Whstc *mW; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#include<QtGui> | ||
#include<QtCore> | ||
#include<CfrmPeCaLi.h> | ||
#include<diagramscene.h> | ||
|
||
#include<HObject.h> | ||
#include<HLine.h> | ||
#include<HBox.h> | ||
#include<HBall.h> | ||
|
||
|
||
CfrmPeCaLi::CfrmPeCaLi(HObject *_obj, QWidget *parent, Qt::WindowFlags f):QDialog(parent,f),mObj(_obj){ | ||
setupUi(this); | ||
|
||
intalto->setEnabled(true); | ||
intlargo->setEnabled(true); | ||
intRadio->setEnabled(true); | ||
intRotacion->setEnabled(true); | ||
connect(btnAceptar, SIGNAL(clicked()), this, SLOT(Aceptar())); | ||
connect(btnCancelar, SIGNAL(clicked()), this, SLOT(Cancelar())); | ||
connect(btnLimpiar, SIGNAL(clicked()), this, SLOT(Limpiar())); | ||
fltdensidad->setValue( mObj->getMass() ); | ||
fltfriccion->setValue( mObj->getFriction() ); | ||
fltfactorDeRebote->setValue( mObj->getBounceFactor() ); | ||
fltvelocidadDeRebote->setValue( mObj->getBounceVelocity() ); | ||
intcolisiones->setValue( mObj->getColMask() ); | ||
intmascaraDeFriccion->setValue( mObj->getFrictionMask() ); | ||
intRotacion->setValue( (int)mObj->getRotation() ); | ||
mObj->lastRotation = mObj->getRotation(); | ||
|
||
switch( mObj->getType() ){ | ||
case 1: | ||
intRadio->setEnabled(false); | ||
intalto->setValue( mObj->height() ); | ||
intlargo->setValue( mObj->width() ); | ||
break; | ||
case 2: | ||
intalto->setEnabled(false); | ||
intlargo->setEnabled(false); | ||
intRotacion->setEnabled(false); | ||
intRadio->setValue( mObj->width() ); | ||
break; | ||
case 3: | ||
intRadio->setEnabled(false); | ||
intalto->setEnabled(false); | ||
intalto->setEnabled(false); | ||
intRotacion->setEnabled(false); | ||
break; | ||
} | ||
|
||
} | ||
|
||
void CfrmPeCaLi::Aceptar(){ | ||
mObj->setMass( fltdensidad->value() ); | ||
mObj->setFriction( fltfriccion->value() ); | ||
mObj->setBounceFactor( fltfactorDeRebote->value() ); | ||
mObj->setBounceVelocity( fltvelocidadDeRebote->value() ); | ||
mObj->setColMask( intcolisiones->value() ); | ||
mObj->setFrictionMask( intmascaraDeFriccion->value() ); | ||
mObj->setRotation( intRotacion->value() ); | ||
|
||
switch( mObj->getType() ){ | ||
case 1: | ||
mObj->setWidth( intlargo->value() ); | ||
mObj->setHeight( intalto->value() ); | ||
break; | ||
case 2: | ||
mObj->setWidth( intRadio->value() ); | ||
mObj->setHeight( intRadio->value() ); | ||
break; | ||
} | ||
|
||
|
||
accept(); | ||
} | ||
|
||
|
||
void CfrmPeCaLi::Limpiar(){ | ||
|
||
} | ||
|
||
void CfrmPeCaLi::Cancelar(){ | ||
reject(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef __CFRMPECALI_H__ | ||
#define __CFRMPECALI_H__ | ||
|
||
#include "ui_frmPeCaLi.h" | ||
#include <QtGui> | ||
#include <HObject.h> | ||
|
||
using namespace Ui; | ||
|
||
class HLine; | ||
class HBox; | ||
class HBall; | ||
|
||
class CfrmPeCaLi : public QDialog, frmPeCaLi{ | ||
Q_OBJECT | ||
public: | ||
CfrmPeCaLi(HObject *, QWidget * parent = 0, Qt::WindowFlags f = 0); | ||
public slots: | ||
void Aceptar(); | ||
void Limpiar(); | ||
void Cancelar(); | ||
private: | ||
HObject *mObj; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <QtGui> | ||
|
||
#include "HBall.h" | ||
|
||
|
||
HBall::HBall(QGraphicsItem *parent):QGraphicsEllipseItem(parent){ | ||
setFlag(QGraphicsItem::ItemIsMovable, true); | ||
} | ||
|
||
|
||
HBall::HBall( qreal x, qreal y, qreal width, qreal height, QGraphicsItem * parent ):QGraphicsEllipseItem(x,y,width,height,parent){ | ||
setFlag(QGraphicsItem::ItemIsMovable, true); | ||
} | ||
|
||
void HBall::setWidth(int w){ | ||
QRectF fao = rect(); | ||
fao.setWidth(w); | ||
setRect(fao); | ||
obj.setWidth(w); | ||
} | ||
|
||
void HBall::setHeight(int h){ | ||
QRectF fao = rect(); | ||
fao.setHeight(h); | ||
setRect(fao); | ||
obj.setHeight(h); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef __HBALL_H__ | ||
#define __HBALL_H__ | ||
|
||
#include <QGraphicsEllipseItem> | ||
#include <QList> | ||
#include "HObject.h" | ||
|
||
class QPixmap; | ||
class QGraphicsItem; | ||
class QGraphicsScene; | ||
class QTextEdit; | ||
class QGraphicsSceneMouseEvent; | ||
class QMenu; | ||
class QGraphicsSceneContextMenuEvent; | ||
class QPainter; | ||
class QStyleOptionGraphicsItem; | ||
class QWidget; | ||
class QPolygonF; | ||
|
||
|
||
class HBall : public QGraphicsEllipseItem{ | ||
public: | ||
HBall(QGraphicsItem *parent = 0); | ||
HBall( qreal x, qreal y, qreal width, qreal height, QGraphicsItem * parent = 0 ); | ||
void setWidth(int); | ||
void setHeight(int); | ||
HObject obj; | ||
private: | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <QtGui> | ||
#include "HBox.h" | ||
|
||
|
||
HBox::HBox(QGraphicsItem *parent):QGraphicsRectItem(parent){ | ||
setFlag(QGraphicsItem::ItemIsMovable, true); | ||
} | ||
|
||
|
||
HBox::HBox( qreal x, qreal y, qreal width, qreal height, QGraphicsItem * parent ):QGraphicsRectItem(x,y,width,height,parent){ | ||
setFlag(QGraphicsItem::ItemIsMovable, true); | ||
} | ||
|
||
void HBox::setWidth(int w){ | ||
QRectF fao = rect(); | ||
fao.setWidth(w); | ||
setRect(fao); | ||
obj.setWidth(w); | ||
} | ||
|
||
void HBox::setHeight(int h){ | ||
QRectF fao = rect(); | ||
fao.setHeight(h); | ||
setRect(fao); | ||
obj.setHeight(h); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef __HBOX_H__ | ||
#define __HBOX_H__ | ||
|
||
#include <QGraphicsRectItem> | ||
#include <QList> | ||
#include "HObject.h" | ||
|
||
class QPixmap; | ||
class QGraphicsItem; | ||
class QGraphicsScene; | ||
class QTextEdit; | ||
class QGraphicsSceneMouseEvent; | ||
class QMenu; | ||
class QGraphicsSceneContextMenuEvent; | ||
class QPainter; | ||
class QStyleOptionGraphicsItem; | ||
class QWidget; | ||
class QPolygonF; | ||
|
||
|
||
class HBox : public QGraphicsRectItem{ | ||
public: | ||
HBox(QGraphicsItem *parent = 0); | ||
HBox( qreal x, qreal y, qreal width, qreal height, QGraphicsItem * parent = 0 ); | ||
void setWidth(int); | ||
void setHeight(int); | ||
HObject obj; | ||
private: | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <QtGui> | ||
#include "HLine.h" | ||
|
||
|
||
HLine::HLine(QGraphicsItem *parent):QGraphicsLineItem(parent){ | ||
//setFlag(QGraphicsItem::ItemIsMovable, true); | ||
} | ||
|
||
HLine::HLine( const QLineF & line, QGraphicsItem * parent):QGraphicsLineItem(line,parent){ | ||
//setFlag(QGraphicsItem::ItemIsMovable, true); | ||
} | ||
|
||
HLine::HLine( qreal x, qreal y, qreal width, qreal height, QGraphicsItem * parent ):QGraphicsLineItem(x,y,width,height,parent){ | ||
//setFlag(QGraphicsItem::ItemIsMovable, true); | ||
} | ||
|
||
void HLine::setLength(int w){ | ||
QLineF fao = line(); | ||
fao.setLength(w); | ||
setLine(fao); | ||
obj.setLength(w); | ||
} | ||
|
Oops, something went wrong.