From: Alexander B. Schmidt Date: Fri, 22 Feb 2013 21:05:58 +0000 (+0100) Subject: ... X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/77794fd69f839fbaefe813ea5ea45601aa056da0 ... --- diff --git a/culooks.cpp b/culooks.cpp index 0d0ebf2..6e7fded 100644 --- a/culooks.cpp +++ b/culooks.cpp @@ -42,7 +42,7 @@ culooks::culooks (const char* name, const int& xcubes, const int& ycubes, const Win->initialized = false; - Win->linewidth = 1; + //Win->linewidth = 1; Windows.push_back( pair(0, Win) ); @@ -107,7 +107,14 @@ void culooks::setWireColor(const float& r, const float& g, const float& b, const Windows[mywid].second->cubes[icube].setWireColor(r, g, b, a); } -void culooks::setLineWidth(float width) +void culooks::setFrameWidth(float width) { - Windows[mywid].second->linewidth = 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); } diff --git a/culooks.h b/culooks.h index 34466c1..66b3320 100644 --- a/culooks.h +++ b/culooks.h @@ -28,7 +28,8 @@ class culooks void hideLinks(); void setBgColor(const float& red, const float& green, const float& blue, const float& alpha); void setWireColor(const float& r, const float& g, const float& b, const float& a); - void setLineWidth(float width); + void setFrameWidth(float width); + void setLinkWidth(float width); private: @@ -56,6 +57,8 @@ class culooks void hidePlaqs(); void hideLinks(); void setWireColor(const float& r, const float& g, const float& b, const float& a); + void setFrameWidth(float width); + void setLinkWidth(float width); private: float wireColor[4]; void drawAll(); @@ -71,6 +74,8 @@ class culooks static int allid; bool hideplaquettes; bool hidelinks; + float framewidth; + float linkwidth; }; struct window { @@ -83,7 +88,6 @@ class culooks string name; float bgcolor[4]; bool redisplay; - float linewidth; }; class drawing diff --git a/culooks_cube.cpp b/culooks_cube.cpp index 2bf8804..890ff16 100644 --- a/culooks_cube.cpp +++ b/culooks_cube.cpp @@ -62,6 +62,7 @@ void culooks::cube::draw() glRotatef(az, 0, 1, 0); glRotatef(alt, 1, 0, 0); glColor4f(wireColor[0], wireColor[1], wireColor[2], wireColor[3]); + glLineWidth(framewidth); glutWireCube(2); glPopMatrix(); @@ -92,6 +93,8 @@ void culooks::cube::drawAll() glTranslatef(2.0*ix/l,2.0*iy/l,2.0*iz/l); glScalef(2.0/l,2.0/l,2.0/l); + glLineWidth(linkwidth); + /* draw links */ if (!hidelinks) { glBegin(GL_LINES); @@ -113,6 +116,8 @@ void culooks::cube::drawAll() glEnd(); } + glLineWidth(1); + /* draw plaquettes */ if (!hideplaquettes) { glBegin(GL_QUADS); @@ -180,3 +185,11 @@ void culooks::cube::setWireColor(const float& r, const float& g, const float& b, wireColor[2] = b; wireColor[3] = a; } + +void culooks::cube::setFrameWidth(float width) { + framewidth = width; +} + +void culooks::cube::setLinkWidth(float width) { + linkwidth = width; +} diff --git a/culooks_drawing.cpp b/culooks_drawing.cpp index cab01b5..65c7644 100644 --- a/culooks_drawing.cpp +++ b/culooks_drawing.cpp @@ -94,8 +94,6 @@ void culooks::drawing::displayFunc() { culooks::window *Win = getWin(); - glLineWidth(Win->linewidth); - glClearColor(Win->bgcolor[0], Win->bgcolor[1], Win->bgcolor[2], Win->bgcolor[3]); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);