X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/f9812559e766a409abfbd2d3bae519298339ab65..578c48ada63a6ea4f090728cf2b267fb3a731b78:/culooks.cpp diff --git a/culooks.cpp b/culooks.cpp index a1f386f..94b9aa9 100644 --- a/culooks.cpp +++ b/culooks.cpp @@ -7,6 +7,7 @@ vector< pair > culooks::Windows; pthread_t culooks::glThreadId; +culooks::comarg culooks::comArg; int culooks::windowid = 0; @@ -17,6 +18,8 @@ culooks::culooks (const char* name, const int& xcubes, const int& ycubes, const window *Win = new window; int winsize[2]; + XInitThreads(); + Win->layout[0] = xcubes; Win->layout[1] = ycubes; Win->aspect = (double)xcubes/ycubes; @@ -41,15 +44,15 @@ culooks::culooks (const char* name, const int& xcubes, const int& ycubes, const Win->initialized = false; + //Win->linewidth = 1; + Windows.push_back( pair(0, Win) ); - + if (windowid == 0) { - comarg comArg; comArg.argc = argc; comArg.argv = argv; pthread_create(&glThreadId, 0, &drawing::glutThread, &comArg); } - mywid = windowid; windowid++; } @@ -99,3 +102,21 @@ void culooks::setBgColor(const float& red, const float& green, const float& blue Windows[mywid].second->bgcolor[2] = blue; Windows[mywid].second->bgcolor[3] = alpha; } + +void culooks::setWireColor(const float& r, const float& g, const float& b, const float& a) +{ + for (int icube=0; icubecubes.size(); icube++) + Windows[mywid].second->cubes[icube].setWireColor(r, g, b, a); +} + +void culooks::setFrameWidth(float width) +{ + for (int icube=0; icubecubes.size(); icube++) + Windows[mywid].second->cubes[icube].setFrameWidth(width); +} + +void culooks::setLinkWidth(float width) +{ + for (int icube=0; icubecubes.size(); icube++) + Windows[mywid].second->cubes[icube].setLinkWidth(width); +}