-
Notifications
You must be signed in to change notification settings - Fork 0
/
CollageGraphics.h
130 lines (96 loc) · 3.53 KB
/
CollageGraphics.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Name: CollageGraphics.h
//
// Author: David Borland
//
// Description: Graphics for Collage application.
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Mod History
//
//--------------------------------------------------------------------------
// Mike Conway 7/10/2008
// Added layout manager factory and simple layouts
//--------------------------------------------------------------------------
//
///////////////////////////////////////////////////////////////////////////////////////////////
#ifndef COLLAGEGRAPHICS_H
#define COLLAGEGRAPHICS_H
#include <RenciGraphics.h>
#include <VideoStream.h>
#include "CollageImage.h"
#include "CollageLayoutManagerFactory.h"
#include "SceneManager.h"
#include "CollageItemMetadata.h"
#include <string>
#include <vector>
#include <wx/filesys.h>
//#include <FTGL/ftgl.h>
//#include <ft2build.h>
// Forward declarations
class CollageLayoutManager;
class CollageGraphics : public RenciGraphics {
public:
CollageGraphics(Image::Behavior imageBehaviorType = Image::Normal);
virtual ~CollageGraphics();
void SetSceneManager(SceneManager* manager);
// Get required render attributes
virtual int* GetAttribList();
// Update videos
virtual void Update();
// Render the scene
virtual void PreRender();
virtual void Render();
virtual void RenderStereo();
virtual void OnKey(wxKeyEvent& e);
virtual void OnMouse(wxMouseEvent& e);
void LoadImage(const std::string& fileName);
void LoadVideo(const std::string& fileName, bool quickTime = false);
bool IsShowTitle();
bool IsRenderLeft();
std::vector<CollageImage*> GetImages();
void DoLayout(unsigned int start = 0);
SceneManager* GetSceneManager();
void SetLayoutManager(CollageLayoutManagerFactory::LayoutType layoutType);
void LoadImagesFromMetadataTextFile(std::string metadataTextFileName);
void SetBackgroundColor(float r, float g, float b);
// FTFont* GetFont();
private:
// The last images will be the most current image
std::vector<CollageImage*> images;
std::vector<CollageImage*> currentImages;
std::vector<VideoStream*> videos;
wxFileSystem fs;
// FTFont* font;
unsigned int imageLoadCounter;
Image::Behavior imageBehavior;
// For wxGLCanvas
int* attribList;
Vec2 oldEventPosition;
bool showTitle;
bool renderLeft;
CollageLayoutManagerFactory* layoutManagerFactory;
CollageLayoutManager* layoutManager;
// Not created here, but should be deleted here
SceneManager* sceneManager;
bool checkForClear;
virtual bool InitGL();
// Handle currently selected image list
bool InCurrent(CollageImage* image);
void ClearCurrent();
void AddToCurrent(int i);
void RemoveFromCurrent(CollageImage* image);
void Delete();
void SortDisplay(MetadataSortOption option);
// methods are called by collage when rendering the left and right screens, facilitating any code that
// needs to act on individual openGL canvases
// virtual void RenderExitRight();
// virtual void RenderExitLeft();
};
// image sort binary predicates
bool CompareFileName(CollageImage* imageA, CollageImage* imageB);
bool ComparePath(CollageImage* imageA, CollageImage* imageB);
bool CompareTimestamp(CollageImage* imageA, CollageImage* imageB);
#endif