From da9df250d530f28be7a3e87f297313ba0d38cbe0 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Mon, 14 Nov 2011 18:17:54 +0000 Subject: [PATCH] opengl improvements and fixes --- libsrc/visualization/vssolution.cpp | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/libsrc/visualization/vssolution.cpp b/libsrc/visualization/vssolution.cpp index 46298a46..8ea46ddf 100644 --- a/libsrc/visualization/vssolution.cpp +++ b/libsrc/visualization/vssolution.cpp @@ -3833,34 +3833,34 @@ namespace netgen &jacobi[0](0), &jacobi[1](0)-&jacobi[0](0), &mvalues[0], sol->components); + // cout << "have multivalues, comps = " << sol->components << endl; + if (!drawelem) ok = false; - if (usetexture != 2) + if (usetexture != 2 || !sol->iscomplex) for (int ii = 0; ii < nlp; ii++) vals[ii] = ExtractValue(sol, scalcomp, &mvalues[ii*sol->components]); + else + for (int ii = 0; ii < nlp; ii++) + valsc[ii] = complex (mvalues[ii*sol->components], + mvalues[ii*sol->components+1]); } - - for (int j = 0; ok && j < 3; j++) - { - p[j] = points[trig.points[j].pnr].p; - Point<3> ploc = points[trig.points[j].pnr].lami; - - if (deform) - p[j] += GetDeformation (trig.elnr, ploc); - - if (usetexture == 2 && sol->iscomplex) - { - ok = GetValueComplex (sol, trig.elnr, ploc(0), ploc(1), ploc(2), - scalcomp, valc[j]); - } - } - + if(ok) for(int j=0; j<3; j++) { if (usetexture != 2 || !sol->iscomplex) SetOpenGlColor (vals[trig.points[j].locpnr]); else - glTexCoord2f ( valc[j].real(), valc[j].imag() ); + glTexCoord2f ( valsc[trig.points[j].locpnr].real(), + valsc[trig.points[j].locpnr].imag() ); + + p[j] = points[trig.points[j].pnr].p; + + if (deform) + { + Point<3> ploc = points[trig.points[j].pnr].lami; + p[j] += GetDeformation (trig.elnr, ploc); + } glVertex3dv (p[j]); }