PVS: fix several issues

This commit is contained in:
wmayer
2019-03-12 01:07:41 +01:00
parent 174b7143ef
commit 4e8a684a6d
3 changed files with 24 additions and 27 deletions

View File

@@ -392,33 +392,33 @@ void CmdTestProgress3::activated(int iMsg)
try
{
// level 1
unsigned long steps = 5;
Base::SequencerLauncher seq1("Starting progress bar", steps);
for (unsigned long i=0; i<steps;i++)
unsigned long level1 = 5;
Base::SequencerLauncher seq1("Starting progress bar", level1);
for (unsigned long i=0; i<level1;i++)
{
QWaitCondition().wait(&mutex, 200);
seq1.next(true);
// level 2
unsigned long steps = 6;
Base::SequencerLauncher seq2("Starting progress bar", steps);
for (unsigned long j=0; j<steps;j++)
unsigned long level2 = 6;
Base::SequencerLauncher seq2("Starting progress bar", level2);
for (unsigned long j=0; j<level2;j++)
{
QWaitCondition().wait(&mutex, 150);
seq2.next(true);
// level 3
unsigned long steps = 7;
Base::SequencerLauncher seq3("Starting progress bar", steps);
for (unsigned long k=0; k<steps;k++)
unsigned long level3 = 7;
Base::SequencerLauncher seq3("Starting progress bar", level3);
for (unsigned long k=0; k<level3;k++)
{
QWaitCondition().wait(&mutex, 100);
seq3.next(true);
// level 4
unsigned long steps = 8;
Base::SequencerLauncher seq4("Starting progress bar", steps);
for (unsigned long l=0; l<steps;l++)
unsigned long level4 = 8;
Base::SequencerLauncher seq4("Starting progress bar", level4);
for (unsigned long l=0; l<level4;l++)
{
QWaitCondition().wait(&mutex, 5);
seq4.next(true);

View File

@@ -218,8 +218,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::setCameraType(SoType type)
SbBool oldisperspective = cam ? cam->getTypeId().isDerivedFrom(perspectivetype) : false;
SbBool newisperspective = type.isDerivedFrom(perspectivetype);
if((oldisperspective && newisperspective) ||
(!oldisperspective && !newisperspective)) // Same old, same old..
if (oldisperspective == newisperspective) // Same old, same old..
return;

View File

@@ -323,8 +323,8 @@ const int texturewidth = 128;
const int textureheight = 128;
// Global variables
double cr = 0.33;
double ci = 0.43;
double global_cr = 0.33;
double global_ci = 0.43;
// Global pointer
//unsigned char * bitmap = new unsigned char[texturewidth*textureheight];
@@ -384,24 +384,24 @@ timersensorcallback(void * data, SoSensor *)
SoTexture2 * texnode = (SoTexture2*) data;
if (!direction) {
cr -= 0.0005;
ci += 0.0005;
global_cr -= 0.0005;
global_ci += 0.0005;
}
else {
cr += 0.0005;
ci -= 0.0005;
global_cr += 0.0005;
global_ci -= 0.0005;
}
if (ci<0.30)
if (global_ci<0.30)
direction = !direction;
else if (ci>0.83)
else if (global_ci>0.83)
direction = !direction;
SbVec2s size;
int nc;
unsigned char * image = texnode->image.startEditing(size, nc);
// Generate a julia set to use as a texturemap
julia(cr, ci, 2.5, size[0], size[1], 4, image, 64);
julia(global_cr, global_ci, 2.5, size[0], size[1], 4, image, 64);
texnode->image.finishEditing();
}
@@ -411,7 +411,7 @@ void AnimationTexture(SoSeparator * root)
if ( root == NULL ) return; // Shouldn't happen.
// Generate a julia set to use as a texturemap
julia(cr, ci, 2.5, texturewidth, textureheight, 4, bitmap, 64);
julia(global_cr, global_ci, 2.5, texturewidth, textureheight, 4, bitmap, 64);
SoTexture2 * texnode = texture();
@@ -434,6 +434,4 @@ void AnimationTexture(SoSeparator * root)
root->addChild(hints);
root->addChild(texnode);
root->addChild(new SoCube);
}
}