home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
MEDIT.LZH
/
ANIM.H
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-18
|
4KB
|
195 lines
#ifndef _ANIM_
#define _ANIM_
#include "matrix.h"
#include "motion.h"
#include "seltype.h"
static const int markersize = 4;
static const int filenamedirlength = 256;
static const int filenamebodylength = 32;
//const double scrollstep = 16;
//const double limitdim = 100000;
#define scrollstep (double)16
#define limitdim (double)(100000.0)
#define scalespacingfactor (double)(1000.0)
static const int buttons = 4;
enum OperationStatus { OpDefault, OpLight, OpSelZoom, OpPlay};
enum DrawMode {DrawWire, DrawPlane, DrawPlaneObject};
class TWinFrame;
class TWinDisplay;
class TWinPers;
class TWinStatus;
class TScrollBar;
class THSlider;
class TBMPButton;
class TButton;
class TTimeBar;
class Motion;
class CameraMotion;
class Mechanic;
class Bezier;
class PolyData;
struct LineSegment {
short x1, y1;
short x2, y2;
void *id;
};
struct WireFrame {
LineSegment *line;
int lines;
};
class TStatusBar;
class TTextGadget;
#define FrontView View[0]
#define SideView View[1]
#define TopView View[2]
class AnimationData {
public:
TWinFrame *Frame;
TWinDisplay *View[3];
TWinPers *PersView;
TWinStatus *Status;
TScrollBar *scrollX, *scrollY, *scrollZ;
TBMPButton *button[buttons];
TButton *button_ok, *button_cancel;
TTimeBar *frameCounter;
TStatusBar *statusbar;
// TTextGadget *statusbar_mode;
TTextGadget *statusbar_time;
SelectType ViewType[3];
int editflag;
double displayscale;
Vector displayoffset;
int zoomflag;
double backup_displayscale;
Vector backup_displayoffset;
int meshflag;
int meshspacing;
int gridflag;
int gridspacing;
int rotspacing;
int scalespacing;
int hiddenremove;
DrawMode drawmode;
char filedir[filenamedirlength];
char filename[filenamebodylength];
char lastopenmechadir[filenamedirlength];
OperationStatus opstat;
SelectType drawflag;
WireFrame wireframe;
Motion *motion;
Motion *select;
CameraMotion *camera;
Vector light;
int maxframe;
int selectframe;
TPoint drag_point;
int drag_count;
Vector org_point, org_vector;
Matrix viewmat;
Matrix drag_mat;
Matrix drag_scale, drag_rot, drag_move;
double drag_px[2], drag_py[2];
double drag_rx, drag_ry;
SelectType selectstatus;
BOOL HelpState;
AnimationData();
void SetScrollLimit(int flag = FALSE);
void ScaleUp(void);
void ScaleDown(void);
int ScaleUpLimitCheck(void);
int ScaleDownLimitCheck(void);
void DeleteMotion(Motion *p);
void CopyMotion(Motion *p);
void AddMotion(Mechanic *m, Bezier *b);
int GetMechaName(char *filename);
void AddMechanicFix(char *filename);
void AddMechanicMove(char *filename);
void ExchangeMechanic(char *filename);
void Redraw(SelectType t = SelAll, int flag = FALSE);
// void ShowMotion(Motion *mot, SelectType type, int flag);
// void ShowBezier(Motion *mot, SelectType type, int flag);
void ShowCube(Matrix& omat, Matrix& nmat);
void ShowLight(Vector& ovec, Vector& nvec);
void DrawBezier(Bezier *b);
Matrix GetMatrix(Motion *mot, int frame);
Matrix GetMatrix(Motion *mot);
void GetCubeMatrix(Motion *m, Matrix& move, Matrix& rot, Matrix& scal);
Matrix GetCubeMatrix(Motion *mot);
void CalcViewMatrix(void);
void CalcView(Motion *mot);
void CalcViewAll(void);
void CalcPoints(Motion *mot);
void CalcPointsAll(void);
void SetDrawMode(DrawMode mode);
void ExpandFrame(int frame);
void SelectFrame(int frame);
void SelectMotion(Motion *m = NULL);
void WriteFile(char *filename = NULL);
void ReadFile(char *filename);
void InitMotion(void);
void NewFile(void);
void SetCaption(void);
void OpModeDefault(void);
void OpModeLight(void);
void OpModeZoom(void);
void OpModePlay(void);
void SelectAxis(SelectType t[3], Matrix& m);
TStatusBar *InitStatusBar(void);
int GetLines(int frame, LineSegment *line);
int GetLinesNoBackFace(int frame, LineSegment **line, PolyData *polydata);
void BuildWireFrame(int frame);
void WinHelp(UINT fuCommand,DWORD dwData);
};
#endif