8 vector< pair<int,culooks::window*> > culooks::Windows;
9 pthread_t culooks::glThreadId;
11 int culooks::windowid = 0;
15 culooks::culooks (const char* name, const int& xcubes, const int& ycubes, const int& l, int *argc, char **argv)
17 window *Win = new window;
20 Win->layout[0] = xcubes;
21 Win->layout[1] = ycubes;
22 Win->aspect = (double)xcubes/ycubes;
23 for (int icube=0; icube<xcubes*ycubes; icube++) {
25 Win->cubes.push_back(newCube);
28 if( Win->layout[0] >= Win->layout[1] ) {
30 winsize[1] = (640.0/Win->layout[0])*Win->layout[1];
34 winsize[0] = (640.0/Win->layout[1])*Win->layout[0];
42 Win->initialized = false;
44 Windows.push_back( pair<int,culooks::window*>(0, Win) );
50 pthread_create(&glThreadId, 0, &drawing::glutThread, &comArg);
57 void culooks::setLink (const int& cubeid, const int& posdir,
58 const float& red, const float& green, const float& blue, const float& alpha)
60 Windows[mywid].second->cubes[cubeid].setLink(posdir, red, green, blue, alpha);
63 void culooks::setPlaq (const int& cubeid, const int& posdir,
64 const float& red, const float& green, const float& blue, const float& alpha)
66 Windows[mywid].second->cubes[cubeid].setPlaq(posdir, red, green, blue, alpha);
69 void culooks::swapBuffers () {
70 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++) {
71 Windows[mywid].second->cubes[icube].swapLinkBuffer();
72 Windows[mywid].second->cubes[icube].swapPlaqBuffer();
74 Windows[mywid].second->redisplay = true;
77 void culooks::hidePlaqs (const int& cubeid) {
78 Windows[mywid].second->cubes[cubeid].hidePlaqs();
81 void culooks::hidePlaqs () {
82 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++)
83 Windows[mywid].second->cubes[icube].hidePlaqs();
86 void culooks::hideLinks (const int& cubeid) {
87 Windows[mywid].second->cubes[cubeid].hideLinks();
90 void culooks::hideLinks () {
91 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++)
92 Windows[mywid].second->cubes[icube].hideLinks();
95 void culooks::setBgColor(const float& red, const float& green, const float& blue, const float& alpha)
97 Windows[mywid].second->bgcolor[0] = red;
98 Windows[mywid].second->bgcolor[1] = green;
99 Windows[mywid].second->bgcolor[2] = blue;
100 Windows[mywid].second->bgcolor[3] = alpha;