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;
47 Windows.push_back( pair<int,culooks::window*>(0, Win) );
52 pthread_create(&glThreadId, 0, &drawing::glutThread, &comArg);
58 void culooks::setLink (const int& cubeid, const int& posdir,
59 const float& red, const float& green, const float& blue, const float& alpha)
61 Windows[mywid].second->cubes[cubeid].setLink(posdir, red, green, blue, alpha);
64 void culooks::setPlaq (const int& cubeid, const int& posdir,
65 const float& red, const float& green, const float& blue, const float& alpha)
67 Windows[mywid].second->cubes[cubeid].setPlaq(posdir, red, green, blue, alpha);
70 void culooks::swapBuffers () {
71 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++) {
72 Windows[mywid].second->cubes[icube].swapLinkBuffer();
73 Windows[mywid].second->cubes[icube].swapPlaqBuffer();
75 Windows[mywid].second->redisplay = true;
78 void culooks::hidePlaqs (const int& cubeid) {
79 Windows[mywid].second->cubes[cubeid].hidePlaqs();
82 void culooks::hidePlaqs () {
83 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++)
84 Windows[mywid].second->cubes[icube].hidePlaqs();
87 void culooks::hideLinks (const int& cubeid) {
88 Windows[mywid].second->cubes[cubeid].hideLinks();
91 void culooks::hideLinks () {
92 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++)
93 Windows[mywid].second->cubes[icube].hideLinks();
96 void culooks::setBgColor(const float& red, const float& green, const float& blue, const float& alpha)
98 Windows[mywid].second->bgcolor[0] = red;
99 Windows[mywid].second->bgcolor[1] = green;
100 Windows[mywid].second->bgcolor[2] = blue;
101 Windows[mywid].second->bgcolor[3] = alpha;
104 void culooks::setWireColor(const float& r, const float& g, const float& b, const float& a)
106 for (int icube=0; icube<Windows[mywid].second->cubes.size(); icube++)
107 Windows[mywid].second->cubes[icube].setWireColor(r, g, b, a);
110 void culooks::setLineWidth(float width)
112 Windows[mywid].second->linewidth = width;