Remove some elbeem debug functions

Some elbeem debug functions had old gl drawing calls. I removed the
functions instead of converting, because Blender doesn't even build
with them enabled anymore, because some elbeem debug libs got removed
at some point.

Part of T49043
This commit is contained in:
Luca Rood 2017-04-12 15:24:42 +02:00
parent 5a5f1dc8e4
commit 8458ffcf5b
2 changed files with 0 additions and 369 deletions

@ -873,156 +873,4 @@ LbmFsgrSolver::handleCpdata()
// warning, may return before
}
#if LBM_USE_GUI==1
#define USE_GLUTILITIES
#include "../gui/gui_utilities.h"
void LbmFsgrSolver::cpDebugDisplay(int dispset)
{
for(int cpssi=0; cpssi<(int)mpControl->mCons.size(); cpssi++) {
ControlParticles *cparts = mpControl->mCons[cpssi]->mCparts;
//ControlParticles *cpmotion = mpControl->mCons[cpssi]->mCpmotion;
// display cp parts
const bool cpCubes = false;
const bool cpDots = true;
const bool cpCpdist = true;
const bool cpHideIna = true;
glShadeModel(GL_FLAT);
glDisable( GL_LIGHTING ); // dont light lines
// dot influence
if((mpControl->mDebugCpscale>0.) && cpDots) {
glPointSize(mpControl->mDebugCpscale * 8.);
glBegin(GL_POINTS);
for(int i=0; i<cparts->getSize(); i++) {
if((cpHideIna)&&( (cparts->getParticle(i)->influence<=0.) || (cparts->getParticle(i)->size<=0.) )) continue;
ntlVec3Gfx org( vec2G(cparts->getParticle(i)->pos ) );
//LbmFloat halfsize = 0.5;
LbmFloat scale = cparts->getParticle(i)->densityWeight;
//glColor4f( scale,scale,scale,scale );
glColor4f( 0.,scale,0.,scale );
glVertex3f( org[0],org[1],org[2] );
//errMsg("lbmDebugDisplay","CP "<<i<<" at "<<org); // DEBUG
}
glEnd();
}
// cp positions
if((mpControl->mDebugCpscale>0.) && cpDots) {
glPointSize(mpControl->mDebugCpscale * 3.);
glBegin(GL_POINTS);
glColor3f( 0,1,0 );
}
for(int i=0; i<cparts->getSize(); i++) {
if((cpHideIna)&&( (cparts->getParticle(i)->influence<=0.) || (cparts->getParticle(i)->size<=0.) )) continue;
ntlVec3Gfx org( vec2G(cparts->getParticle(i)->pos ) );
LbmFloat halfsize = 0.5;
LbmFloat scale = cparts->getRadiusAtt() * cparts->getParticle(i)->densityWeight;
if(cpCubes){ glLineWidth( 1 );
glColor3f( 1,1,1 );
ntlVec3Gfx s = org-(halfsize * (scale));
ntlVec3Gfx e = org+(halfsize * (scale));
drawCubeWire( s,e ); }
if((mpControl->mDebugCpscale>0.) && cpDots) {
glVertex3f( org[0],org[1],org[2] );
}
}
if(cpDots) glEnd();
if(mpControl->mDebugAvgVelScale>0.) {
const float scale = mpControl->mDebugAvgVelScale;
glColor3f( 1.0,1.0,1 );
glBegin(GL_LINES);
for(int i=0; i<cparts->getSize(); i++) {
if((cpHideIna)&&( (cparts->getParticle(i)->influence<=0.) || (cparts->getParticle(i)->size<=0.) )) continue;
ntlVec3Gfx org( vec2G(cparts->getParticle(i)->pos ) );
//errMsg("CPAVGVEL","i"<<i<<" pos"<<org<<" av"<<cparts->getParticle(i)->avgVel);// DEBUG
float dx = cparts->getParticle(i)->avgVel[0];
float dy = cparts->getParticle(i)->avgVel[1];
float dz = cparts->getParticle(i)->avgVel[2];
dx *= scale; dy *= scale; dz *= scale;
glVertex3f( org[0],org[1],org[2] );
glVertex3f( org[0]+dx,org[1]+dy,org[2]+dz );
}
glEnd();
} // */
if( (LBMDIM==2) && (cpCpdist) ) {
// debug, for use of e.g. LBMGET_FORCE LbmControlData *mpControl = this;
# define TESTGET_FORCE(lev,i,j,k) mpControl->mCpForces[lev][ ((k*mLevel[lev].lSizey)+j)*mLevel[lev].lSizex+i ]
glBegin(GL_LINES);
//const int lev=0;
for(int lev=0; lev<=mMaxRefine; lev++) {
FSGR_FORIJK_BOUNDS(lev) {
LbmVec pos = LbmVec(
((mvGeoEnd[0]-mvGeoStart[0])/(LbmFloat)mLevel[lev].lSizex) * ((LbmFloat)i+0.5) + mvGeoStart[0],
((mvGeoEnd[1]-mvGeoStart[1])/(LbmFloat)mLevel[lev].lSizey) * ((LbmFloat)j+0.5) + mvGeoStart[1],
((mvGeoEnd[2]-mvGeoStart[2])/(LbmFloat)mLevel[lev].lSizez) * ((LbmFloat)k+0.5) + mvGeoStart[2] );
if(LBMDIM==2) pos[2] = ((mvGeoEnd[2]-mvGeoStart[2])*0.5 + mvGeoStart[2]);
if((mpControl->mDebugMaxdScale>0.) && (TESTGET_FORCE(lev,i,j,k).weightAtt<=0.) )
if(TESTGET_FORCE(lev,i,j,k).maxDistance>=0.)
if(TESTGET_FORCE(lev,i,j,k).maxDistance<CPF_MAXDINIT ) {
const float scale = mpControl->mDebugMaxdScale*10001.;
float dx = TESTGET_FORCE(lev,i,j,k).forceMaxd[0];
float dy = TESTGET_FORCE(lev,i,j,k).forceMaxd[1];
float dz = TESTGET_FORCE(lev,i,j,k).forceMaxd[2];
dx *= scale; dy *= scale; dz *= scale;
glColor3f( 0,1,0 );
glVertex3f( pos[0],pos[1],pos[2] );
glVertex3f( pos[0]+dx,pos[1]+dy,pos[2]+dz );
} // */
if((mpControl->mDebugAttScale>0.) && (TESTGET_FORCE(lev,i,j,k).weightAtt>0.)) {
const float scale = mpControl->mDebugAttScale*100011.;
float dx = TESTGET_FORCE(lev,i,j,k).forceAtt[0];
float dy = TESTGET_FORCE(lev,i,j,k).forceAtt[1];
float dz = TESTGET_FORCE(lev,i,j,k).forceAtt[2];
dx *= scale; dy *= scale; dz *= scale;
glColor3f( 1,0,0 );
glVertex3f( pos[0],pos[1],pos[2] );
glVertex3f( pos[0]+dx,pos[1]+dy,pos[2]+dz );
} // */
// why check maxDistance?
if((mpControl->mDebugVelScale>0.) && (TESTGET_FORCE(lev,i,j,k).maxDistance+TESTGET_FORCE(lev,i,j,k).weightVel>0.)) {
float scale = mpControl->mDebugVelScale*1.;
float wvscale = TESTGET_FORCE(lev,i,j,k).weightVel;
float dx = TESTGET_FORCE(lev,i,j,k).forceVel[0];
float dy = TESTGET_FORCE(lev,i,j,k).forceVel[1];
float dz = TESTGET_FORCE(lev,i,j,k).forceVel[2];
scale *= wvscale;
dx *= scale; dy *= scale; dz *= scale;
glColor3f( 0.2,0.2,1 );
glVertex3f( pos[0],pos[1],pos[2] );
glVertex3f( pos[0]+dx,pos[1]+dy,pos[2]+dz );
} // */
if((mpControl->mDebugCompavScale>0.) && (TESTGET_FORCE(lev,i,j,k).compAvWeight>0.)) {
const float scale = mpControl->mDebugCompavScale*1.;
float dx = TESTGET_FORCE(lev,i,j,k).compAv[0];
float dy = TESTGET_FORCE(lev,i,j,k).compAv[1];
float dz = TESTGET_FORCE(lev,i,j,k).compAv[2];
dx *= scale; dy *= scale; dz *= scale;
glColor3f( 0.2,0.2,1 );
glVertex3f( pos[0],pos[1],pos[2] );
glVertex3f( pos[0]+dx,pos[1]+dy,pos[2]+dz );
} // */
} // att,maxd
}
glEnd();
}
} // cpssi
//fprintf(stderr,"BLA\n");
glEnable( GL_LIGHTING ); // dont light lines
glShadeModel(GL_SMOOTH);
}
#else // LBM_USE_GUI==1
void LbmFsgrSolver::cpDebugDisplay(int dispset) { }
#endif // LBM_USE_GUI==1

@ -1673,223 +1673,6 @@ LbmFloat& LbmFsgrSolver::debRAC(LbmFloat* s,int l) {
* GUI&debugging functions
*****************************************************************************/
#if LBM_USE_GUI==1
#define USE_GLUTILITIES
#include "../gui/gui_utilities.h"
//! display a single node
void LbmFsgrSolver::debugDisplayNode(int dispset, CellIdentifierInterface* cell ) {
//debugOut(" DD: "<<cell->getAsString() , 10);
ntlVec3Gfx org = this->getCellOrigin( cell );
ntlVec3Gfx halfsize = this->getCellSize( cell );
int set = this->getCellSet( cell );
//debugOut(" DD: "<<cell->getAsString()<<" "<< (dispset->type) , 10);
bool showcell = true;
int linewidth = 1;
ntlColor col(0.5);
LbmFloat cscale = 1.0; //dispset->scale;
#define DRAWDISPCUBE(col,scale) \
{ glLineWidth( linewidth ); \
glColor3f( (col)[0], (col)[1], (col)[2]); \
ntlVec3Gfx s = org-(halfsize * (scale)); \
ntlVec3Gfx e = org+(halfsize * (scale)); \
drawCubeWire( s,e ); }
CellFlagType flag = this->getCellFlag(cell, set );
// always check types
if(flag& CFInvalid ) { if(!guiShowInvalid ) return; }
if(flag& CFUnused ) { if(!guiShowInvalid ) return; }
if(flag& CFEmpty ) { if(!guiShowEmpty ) return; }
if(flag& CFInter ) { if(!guiShowInterface) return; }
if(flag& CFNoDelete ) { if(!guiShowNoDelete ) return; }
if(flag& CFBnd ) { if(!guiShowBnd ) return; }
// only dismiss one of these types
if(flag& CFGrFromCoarse) { if(!guiShowCoarseInner ) return; } // inner not really interesting
else
if(flag& CFGrFromFine) { if(!guiShowCoarseBorder ) return; }
else
if(flag& CFFluid ) { if(!guiShowFluid ) return; }
switch(dispset) {
case FLUIDDISPNothing: {
showcell = false;
} break;
case FLUIDDISPCelltypes: {
cscale = 0.5;
if(flag& CFNoDelete) { // debug, mark nodel cells
ntlColor ccol(0.7,0.0,0.0);
DRAWDISPCUBE(ccol, 0.1);
}
if(flag& CFPersistMask) { // mark persistent flags
ntlColor ccol(0.5);
DRAWDISPCUBE(ccol, 0.125);
}
if(flag& CFNoBndFluid) { // mark persistent flags
ntlColor ccol(0,0,1);
DRAWDISPCUBE(ccol, 0.075);
}
if(flag& CFInvalid) {
cscale = 0.50;
col = ntlColor(0.0,0,0.0);
}
else if(flag& CFBnd) {
cscale = 0.59;
col = ntlColor(0.4);
}
else if(flag& CFInter) {
cscale = 0.55;
col = ntlColor(0,1,1);
} else if(flag& CFGrFromCoarse) {
// draw as - with marker
ntlColor col2(0.0,1.0,0.3);
DRAWDISPCUBE(col2, 0.1);
cscale = 0.5;
showcell=false; // DEBUG
}
else if(flag& CFFluid) {
cscale = 0.5;
if(flag& CFGrToFine) {
ntlColor col2(0.5,0.0,0.5);
DRAWDISPCUBE(col2, 0.1);
col = ntlColor(0,0,1);
}
if(flag& CFGrFromFine) {
ntlColor col2(1.0,1.0,0.0);
DRAWDISPCUBE(col2, 0.1);
col = ntlColor(0,0,1);
} else if(flag& CFGrFromCoarse) {
// draw as fluid with marker
ntlColor col2(0.0,1.0,0.3);
DRAWDISPCUBE(col2, 0.1);
col = ntlColor(0,0,1);
} else {
col = ntlColor(0,0,1);
}
}
else if(flag& CFEmpty) {
showcell=false;
}
} break;
case FLUIDDISPVelocities: {
// dont use cube display
LbmVec vel = this->getCellVelocity( cell, set );
glBegin(GL_LINES);
glColor3f( 0.0,0.0,0.0 );
glVertex3f( org[0], org[1], org[2] );
org += vec2G(vel * 10.0 * cscale);
glColor3f( 1.0,1.0,1.0 );
glVertex3f( org[0], org[1], org[2] );
glEnd();
showcell = false;
} break;
case FLUIDDISPCellfills: {
cscale = 0.5;
if(flag& CFFluid) {
cscale = 0.75;
col = ntlColor(0,0,0.5);
}
else if(flag& CFInter) {
cscale = 0.75 * this->getCellMass(cell,set);
col = ntlColor(0,1,1);
}
else {
showcell=false;
}
if( ABS(this->getCellMass(cell,set)) < 10.0 ) {
cscale = 0.75 * this->getCellMass(cell,set);
} else {
showcell = false;
}
if(cscale>0.0) {
col = ntlColor(0,1,1);
} else {
col = ntlColor(1,1,0);
}
// TODO
} break;
case FLUIDDISPDensity: {
LbmFloat rho = this->getCellDensity(cell,set);
cscale = rho*rho * 0.25;
col = ntlColor( MIN(0.5+cscale,1.0) , MIN(0.0+cscale,1.0), MIN(0.0+cscale,1.0) );
cscale *= 2.0;
} break;
case FLUIDDISPGrid: {
cscale = 0.59;
col = ntlColor(1.0);
} break;
default: {
cscale = 0.5;
col = ntlColor(1.0,0.0,0.0);
} break;
}
if(!showcell) return;
if(cscale==0.0) return; // dont draw zero values
DRAWDISPCUBE(col, cscale);
}
//! debug display function
// D has to implement the CellIterator interface
void LbmFsgrSolver::lbmDebugDisplay(int dispset) {
// DEBUG always display testdata
#if LBM_INCLUDE_TESTSOLVERS==1
if(mUseTestdata){
cpDebugDisplay(dispset);
mpTest->testDebugDisplay(dispset);
}
#endif // LBM_INCLUDE_TESTSOLVERS==1
if(dispset<=FLUIDDISPNothing) return;
//if(!dispset->on) return;
glDisable( GL_LIGHTING ); // dont light lines
#if LBM_INCLUDE_TESTSOLVERS==1
if((!mUseTestdata)|| (mUseTestdata)&&(mpTest->mFarfMode<=0)) {
#endif // LBM_INCLUDE_TESTSOLVERS==1
LbmFsgrSolver::CellIdentifier cid = this->getFirstCell();
for(; this->noEndCell( cid );
this->advanceCell( cid ) ) {
this->debugDisplayNode(dispset, cid );
}
delete cid;
#if LBM_INCLUDE_TESTSOLVERS==1
} // 3d check
#endif // LBM_INCLUDE_TESTSOLVERS==1
glEnable( GL_LIGHTING ); // dont light lines
}
//! debug display function
// D has to implement the CellIterator interface
void LbmFsgrSolver::lbmMarkedCellDisplay() {
//fluidDispSettings dispset;
// trick - display marked cells as grid displa -> white, big
int dispset = FLUIDDISPGrid;
glDisable( GL_LIGHTING ); // dont light lines
LbmFsgrSolver::CellIdentifier cid = this->markedGetFirstCell();
while(cid) {
this->debugDisplayNode(dispset, cid );
cid = this->markedAdvanceCell();
}
delete cid;
glEnable( GL_LIGHTING ); // dont light lines
}
#endif // LBM_USE_GUI==1
//! display a single node
void LbmFsgrSolver::debugPrintNodeInfo(CellIdentifierInterface* cell, int forceSet) {
//string printInfo,