yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00569
[svn] r1463 - eudoxos
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Wed, 20 Aug 2008 12:00:56 +0200
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
------------------------------------------------------------------------
r1463 | eudoxos | 2008-08-12 17:44:10 +0200 (wto, 12 sie 2008) | 4 lines
Changed paths:
M /trunk/extra/Brefcom.cpp
M /trunk/gui/qt3/QtFileGenerator.cpp
M /trunk/gui/qt3/SimulationController.cpp
M /trunk/gui/qt3/YadeQtMainWindow.cpp
1. Fix refresh period: use it for regular GL rendering as well
2. Make "open automatically" open generated simulation even if a simulation is already loaded
3. Fix crasher (on some machines) the close() was emitted 2× for QtFileGenerato
------------------------------------------------------------------------
Index: extra/Brefcom.cpp
===================================================================
--- extra/Brefcom.cpp (revision 1462)
+++ extra/Brefcom.cpp (revision 1463)
@@ -252,7 +252,7 @@
if(omega>omegaThreshold){
I->isReal=false;
if(BC->isCohesive){rbp1->numBrokenCohesive+=1; rbp2->numBrokenCohesive+=1;}
- LOG_INFO("Contact #"<<id1<<"=#"<<id2<<" is damaged over thershold ("<<omega<<">"<<omegaThreshold<<") and has been deleted (isReal="<<I->isReal<<")");
+ LOG_DEBUG("Contact #"<<id1<<"=#"<<id2<<" is damaged over thershold ("<<omega<<">"<<omegaThreshold<<") and has been deleted (isReal="<<I->isReal<<")");
continue;
}
@@ -303,11 +303,13 @@
Vector3r lineColor(BC->omega,1-BC->omega,0.0); /* damaged links red, undamaged green */
Real epsTransNegAbs=-max(0.,BC->epsTrans);
- if(colorStrain) lineColor=Vector3r(min(1.,max(0.,epsTransNegAbs/BC->epsCrackOnset-1)),min(1.,epsTransNegAbs/BC->epsCrackOnset),1);
+ if(colorStrain) lineColor=Vector3r(
+ min(1.,max(0.,abs(BC->epsTrans)/BC->epsCrackOnset-1)),
+ min(1.,epsTransNegAbs/BC->epsCrackOnset),1);
- if(contactLine) Shop::GLDrawLine(b1->physicalParameters->dispSe3.position,b2->physicalParameters->dispSe3.position);
+ if(contactLine) Shop::GLDrawLine(b1->physicalParameters->dispSe3.position,b2->physicalParameters->dispSe3.position,lineColor);
if(dmgLabel){ Shop::GLDrawNum(BC->omega,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor); }
- if(epsNLabel){ Shop::GLDrawNum(BC->epsN,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor); }
+ else if(epsNLabel){ Shop::GLDrawNum(BC->epsN,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor); }
const Vector3r& cp=static_pointer_cast<SpheresContactGeometry>(i->interactionGeometry)->contactPoint;
if(epsT){
Index: gui/qt3/YadeQtMainWindow.cpp
===================================================================
--- gui/qt3/YadeQtMainWindow.cpp (revision 1462)
+++ gui/qt3/YadeQtMainWindow.cpp (revision 1463)
@@ -90,7 +90,8 @@
}
void YadeQtMainWindow::redrawAll(bool force){
- if(renderer && (force || (controller && !controller->syncRunning) || (!controller))){
+ // controller has its own timer -- and will update instead of us periodically
+ if(renderer && (force /* || (controller && !controller->syncRunning ) */ || (!controller))){
FOREACH(const shared_ptr<GLViewer>& glv,glViews){ if(glv) glv->updateGL(); }
}
}
@@ -208,7 +209,7 @@
case EVENT_GENERATOR: createGenerator(); break;
case EVENT_RESIZE_VIEW: {
vector<int>* d=(vector<int>*)e->data();
- if(glViews.size()<d->at(0)+1 || !glViews[d->at(0)]) LOG_ERROR("No view #"+lexical_cast<string>(d->at(0))+", resize request ignored");
+ if(glViews.size()<(size_t)(d->at(0)+1) || !glViews[d->at(0)]) LOG_ERROR("No view #"+lexical_cast<string>(d->at(0))+", resize request ignored");
glViews[d->at(0)]->resize(d->at(1),d->at(2));
delete d;
}
Index: gui/qt3/SimulationController.cpp
===================================================================
--- gui/qt3/SimulationController.cpp (revision 1462)
+++ gui/qt3/SimulationController.cpp (revision 1463)
@@ -222,12 +222,9 @@
void SimulationController::cbSyncToggled(bool b){ sync=b; if(sync && refreshTime<20) refreshTime=20; pbStopClicked(); pbStartClicked(); }
void SimulationController::timerEvent( QTimerEvent* ){
doUpdate(); /* update the controller, like iteration number etc */
- if(sync && syncRunning){
- /* update GLViews */
- //LOG_DEBUG("Sync: iter "<<Omega::instance().getCurrentIteration());
- YadeQtMainWindow::self->redrawAll(true);
- Omega::instance().spawnSingleSimulationLoop();
- }
+ /* update GLViews */
+ YadeQtMainWindow::self->redrawAll(true);
+ if(sync && syncRunning){ Omega::instance().spawnSingleSimulationLoop(); }
}
void SimulationController::pbResetClicked()
Index: gui/qt3/QtFileGenerator.cpp
===================================================================
--- gui/qt3/QtFileGenerator.cpp (revision 1462)
+++ gui/qt3/QtFileGenerator.cpp (revision 1463)
@@ -234,7 +234,7 @@
* 3. no simulation is open already (by checking Omega's simulationFileName) */
if(cbOpenAutomatically->isChecked()
&& successfullyGenerated //filesystem::exists(filesystem::path((const char*)(leOutputFileName->text())))
- && Omega::instance().getSimulationFileName()=="")
+ )
{
//Omega::instance().setSimulationFileName((const char*)(leOutputFileName->text()));
YadeQtMainWindow::self->loadSimulation((const char*)(leOutputFileName->text()));