-
Notifications
You must be signed in to change notification settings - Fork 0
/
C3DModelPane.h
executable file
·104 lines (73 loc) · 2.42 KB
/
C3DModelPane.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
/*
C3DModelPane.h
Author: Tom Naughton
Description: <describe the C3DModelPane class here>
*/
#ifndef C3DModelPane_H
#define C3DModelPane_H
#include "C3DPane.h"
#include "CModelInstance.h"
#include "DragAndDrop.h"
class CModelController;
class CGLImage;
class C3DModelPane:
public C3DPane
{
public:
enum { class_ID = 'MdlP' };
C3DModelPane();
C3DModelPane(const SPaneInfo& inPaneInfo, LStr255& desc);
C3DModelPane(LStream* inStream);
virtual ~C3DModelPane();
void SetModel(CModelInstance *inModel);
void SetModelController(CModelController *inController);
void SetRotationCorrection(float x, float y, float z);
void SetPosition(float x, float y, float z);
void DrawTexturePreview();
void CreateDragEvent(const SMouseDownEvent &inMouseDown);
// LPeriodical methods
virtual void SpendTime(const EventRecord &inMacEvent);
// LCommander methods
virtual void PutOnDuty(
LCommander* inNewTarget);
virtual void TakeOffDuty();
virtual Boolean ObeyCommand(
CommandT inCommand,
void* ioParam = nil);
virtual Boolean HandleKeyPress(
const EventRecord& inKeyEvent);
virtual void FindCommandStatus(
CommandT inCommand,
Boolean& outEnabled,
Boolean& outUsesMark,
UInt16& outMark,
Str255 outName);
virtual void ReshapeGL(int,int); // change size
void exportFormat(ExportFormatT format);
protected:
virtual void PickModel(int x, int y);
virtual string selectedModelTag(CModelInstance *&selectedModel);
// void ProcessHits (GLint hits, GLuint buffer[]);
virtual void MouseDown(const SMouseDownEvent& inMouseDown, const Point&);// Mouse down event
virtual void MouseDrag(const SMouseDownEvent& inMouseDown, const Point&);// mouse is being dragged
virtual void SetupRendering();
virtual void resetRendering();
virtual void DrawGL(); // GL Rendering
virtual void DrawHUD();
CModelController *_modelController;
UInt32 _lastPickedName;
float _textureScaleFactor;
float _textureScaleStartTime;
float _modelScaleFactor;
float _modelScaleStartTime;
Boolean _playedIntroSound;
Boolean _playedAnnounceSound;
CWav *_announceSound;
int _m_x, _m_y; //keep track of mouse movements
};
#endif // C3DModelPane_H
/*
float _rotAngleX, _rotAngleY; //rotation angles
// Point _mousePos;
*/
GLvoid glPrint(const char *fmt, ...); // Custom GL "Print" Routine