changen wire and hiddenlines draw modes
This commit is contained in:
parent
ea756467ea
commit
dc9c863f3a
|
|
@ -53,7 +53,7 @@ public:
|
||||||
case DMSmallTetra: _DrawSmallTetra<cm>();break;
|
case DMSmallTetra: _DrawSmallTetra<cm>();break;
|
||||||
case DMFlat:_DrawSurface<dm,nm,cm>();break;
|
case DMFlat:_DrawSurface<dm,nm,cm>();break;
|
||||||
case DMWire:_DrawSurface<dm,nm,cm>();break;
|
case DMWire:_DrawSurface<dm,nm,cm>();break;
|
||||||
case DMHidden:break;//DrawSurface<dm,nm,cm>();break;
|
case DMHidden:_DrawSurface<dm,nm,cm>();break;
|
||||||
case DMFlatWire:_DrawFlatWire<nm,cm>(); break;
|
case DMFlatWire:_DrawFlatWire<nm,cm>(); break;
|
||||||
case DMTransparent:break;
|
case DMTransparent:break;
|
||||||
}
|
}
|
||||||
|
|
@ -96,27 +96,38 @@ void _DrawSurface(){
|
||||||
CONT_TETRA::iterator it;
|
CONT_TETRA::iterator it;
|
||||||
|
|
||||||
glPushAttrib(0xffffffff);
|
glPushAttrib(0xffffffff);
|
||||||
|
|
||||||
|
if((dm == DMWire)||(dm ==DMHidden))
|
||||||
|
{
|
||||||
|
glDisable(GL_LIGHTING);
|
||||||
|
glDisable(GL_NORMALIZE);
|
||||||
|
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
glEnable(GL_NORMALIZE);
|
glEnable(GL_NORMALIZE);
|
||||||
if(dm == DMWire)
|
|
||||||
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
|
|
||||||
else
|
|
||||||
glPolygonMode(GL_FRONT,GL_FILL);
|
glPolygonMode(GL_FRONT,GL_FILL);
|
||||||
|
}
|
||||||
|
|
||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
for( it = tetra.begin(); it != tetra.end(); ++it)
|
for( it = tetra.begin(); it != tetra.end(); ++it)
|
||||||
_DrawTetra<nm,cm>((*it));
|
_DrawTetra<dm,nm,cm>((*it));
|
||||||
glEnd();
|
glEnd();
|
||||||
glPopAttrib();
|
glPopAttrib();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <NormalMode nm,ColorMode cm >
|
template <DrawMode dm,NormalMode nm,ColorMode cm >
|
||||||
void _DrawTetra(TetraType &t)
|
void _DrawTetra(TetraType &t)
|
||||||
{
|
{
|
||||||
if(!(t.IsD()))
|
if(!(t.IsD()))
|
||||||
{
|
{
|
||||||
_ChooseColorTetra<cm>(t);
|
_ChooseColorTetra<cm>(t);
|
||||||
for(int i = 0; i < 4; ++i){
|
for(int i = 0; i < 4; ++i){
|
||||||
|
if (dm == DMWire)
|
||||||
|
_DrawFace<cm>(t,i);
|
||||||
|
else
|
||||||
|
{
|
||||||
if (t.IsBorderF(i))
|
if (t.IsBorderF(i))
|
||||||
{
|
{
|
||||||
if(nm==NMSmooth)
|
if(nm==NMSmooth)
|
||||||
|
|
@ -128,6 +139,7 @@ void _DrawTetra(TetraType &t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <ColorMode cm >
|
template <ColorMode cm >
|
||||||
void _ChooseColorTetra(TetraType &t)
|
void _ChooseColorTetra(TetraType &t)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue