8 vector< pair<int,culooks::window*> > culooks::Windows;
9 pthread_t culooks::glThreadId;
10 culooks::comarg culooks::comArg;
12 int culooks::windowid = 0;
16 culooks::culooks (const char* name, const int& xcubes, const int& ycubes, const int& l, int *argc, char **argv)
18 window *Win = new window;
21 Win->layout[0] = xcubes;
22 Win->layout[1] = ycubes;
23 Win->aspect = (double)xcubes/ycubes;
24 for (int icube=0; icube<xcubes*ycubes; icube++) {
26 Win->cubes.push_back(newCube);
29 if( Win->layout[0] >= Win->layout[1] ) {
31 winsize[1] = (640.0/Win->layout[0])*Win->layout[1];
35 winsize[0] = (640.0/Win->layout[1])*Win->layout[0];
43 Win->initialized = false;
45 Windows.push_back( pair<int,culooks::window*>(0, Win) );
50 pthread_create(&glThreadId, 0, &drawing::glutThread, &comArg);
56 void culooks::setLink (const int& cubeid, const int& posdir,
57 const float& red, const float& green, const float& blue, const float& alpha)
59 Windows[mywid].second->cubes[cubeid].setLink(posdir, red, green, blue, alpha);
62 void culooks::setPlaq (const int& cubeid, const int& posdir,
63 const float& red, const float& green, const float& blue, const float& alpha)
65 Windows[mywid].second->cubes[cubeid].setPlaq(posdir, red, green, blue, alpha);
68 void culooks::swapBuffers () {
69 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++) {
70 Windows[mywid].second->cubes[icube].swapLinkBuffer();
71 Windows[mywid].second->cubes[icube].swapPlaqBuffer();
73 Windows[mywid].second->redisplay = true;
76 void culooks::hidePlaqs (const int& cubeid) {
77 Windows[mywid].second->cubes[cubeid].hidePlaqs();
80 void culooks::hidePlaqs () {
81 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++)
82 Windows[mywid].second->cubes[icube].hidePlaqs();
85 void culooks::hideLinks (const int& cubeid) {
86 Windows[mywid].second->cubes[cubeid].hideLinks();
89 void culooks::hideLinks () {
90 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++)
91 Windows[mywid].second->cubes[icube].hideLinks();
94 void culooks::setBgColor(const float& red, const float& green, const float& blue, const float& alpha)
96 Windows[mywid].second->bgcolor[0] = red;
97 Windows[mywid].second->bgcolor[1] = green;
98 Windows[mywid].second->bgcolor[2] = blue;
99 Windows[mywid].second->bgcolor[3] = alpha;
102 void culooks::setWireColor(const float& r, const float& g, const float& b, const float& a)
104 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++)
105 Windows[mywid].second->cubes[icube].setWireColor(r, g, b, a);