leocad/common/minifig.h

83 lines
1.3 KiB
C
Raw Normal View History

2011-09-07 21:06:51 +00:00
#ifndef _MINIFIG_H_
#define _MINIFIG_H_
2013-08-09 04:57:18 +00:00
#include "lc_glwidget.h"
2012-05-19 01:13:05 +00:00
#include "lc_math.h"
2013-08-15 23:43:18 +00:00
#include "lc_array.h"
2011-09-07 21:06:51 +00:00
enum LC_MFW_TYPES
{
LC_MFW_HATS,
LC_MFW_HATS2,
2011-09-07 21:06:51 +00:00
LC_MFW_HEAD,
LC_MFW_NECK,
LC_MFW_BODY,
LC_MFW_BODY2,
LC_MFW_BODY3,
LC_MFW_RARM,
LC_MFW_LARM,
LC_MFW_RHAND,
LC_MFW_LHAND,
LC_MFW_RHANDA,
LC_MFW_LHANDA,
LC_MFW_RLEG,
LC_MFW_LLEG,
LC_MFW_RLEGA,
LC_MFW_LLEGA,
2011-09-07 21:06:51 +00:00
LC_MFW_NUMITEMS
};
struct lcMinifigPieceInfo
{
char Description[128];
2011-09-07 21:06:51 +00:00
PieceInfo* Info;
2012-05-19 01:13:05 +00:00
lcMatrix44 Offset;
2011-09-07 21:06:51 +00:00
};
2013-08-09 04:57:18 +00:00
struct lcMinifig
{
PieceInfo* Parts[LC_MFW_NUMITEMS];
int Colors[LC_MFW_NUMITEMS];
float Angles[LC_MFW_NUMITEMS];
lcMatrix44 Matrices[LC_MFW_NUMITEMS];
};
class MinifigWizard : public lcGLWidget
2011-09-07 21:06:51 +00:00
{
public:
2016-08-01 03:44:15 +00:00
MinifigWizard();
~MinifigWizard();
2011-09-07 21:06:51 +00:00
2016-08-01 03:44:15 +00:00
void OnDraw();
2013-08-09 04:57:18 +00:00
void OnLeftButtonDown();
void OnLeftButtonUp();
void OnLeftButtonDoubleClick();
void OnRightButtonDown();
void OnRightButtonUp();
void OnMouseMove();
void OnInitialUpdate();
2011-09-07 21:06:51 +00:00
void Calculate();
int GetSelectionIndex(int Type) const;
void SetSelectionIndex(int Type, int Index);
void SetColor(int Type, int Color);
void SetAngle(int Type, float Angle);
2012-03-22 23:44:56 +00:00
void ParseSettings(lcFile& Settings);
2011-09-07 21:06:51 +00:00
2013-08-15 23:43:18 +00:00
lcArray<lcMinifigPieceInfo> mSettings[LC_MFW_NUMITEMS];
2011-09-07 21:06:51 +00:00
2016-08-01 03:44:15 +00:00
lcMinifig mMinifig;
2016-08-01 03:44:15 +00:00
int mTracking;
int mDownX;
int mDownY;
2016-08-01 03:44:15 +00:00
float mDistance;
float mRotateX;
float mRotateZ;
bool mAutoZoom;
2011-09-07 21:06:51 +00:00
};
#endif // _MINIFIG_H_