// Load the values from the info structure into the form void RawImageForm::load(QString fileName, RawImageInfo *info ) { QString str; int ind = str.lastIndexOf('/'); if (ind < 0) ind = str.lastIndexOf('\\'); if (ind >= 0) str = str.right(str.length() - 1 - ind); str = str; fileLabel->setText(QString("File: ") + fileName); diaSetGroup(dataTypeGroup, info->type); xSizeSpinBox->setValue(info->nx); ySizeSpinBox->setValue(info->ny); zSizeSpinBox->setValue(info->nz); headerSpinBox->setValue(info->headerSize); swapCheckBox->setChecked(info->swapBytes); invertCheckBox->setChecked(info->yInverted); matchCheckBox->setChecked(info->allMatch); scanCheckBox->setChecked(info->scanMinMax); str.sprintf("%f", info->amin); minLineEdit->setText(str); str.sprintf("%f", info->amax); maxLineEdit->setText(str); manageState(); }
bool cube::getState ( byte x, byte y, byte z ) { /* * reads the state of the given position * calls the private manageState function to do the converting etc. */ return manageState( 0, x, y, z, 0); }
void cube::setState ( byte x, byte y, byte z, bool state ) { /* * changes the state of the given position * calls the private manageState function to do the converting etc. */ manageState( 1, x, y, z, state); return; }
void Hero::update() { cnt ++; manageState(); checkEvent(); itemCollision(); /* change the eye direction when hero takes damage */ if ( state == H_DAMAGE ) { direct = Vector( direct.x, 0.04, direct.z ); } else if ( 0 < heavyAtackCounter ) { direct = Vector( direct.x, 0.02, direct.z ); heavyAtackCounter --; } /* generate vivulation when hero gets great hits */ else if ( 0 ) //justAtack && state == H_ATACK && step == H_MAX_STEP-1 ) { double viv = -1; ( stateManager < H_FRAME_SPAN_ATACK/2 ) ? viv = -1 : viv = 1; direct = Vector( direct.x, 0.01 * viv, direct.z ); } else { direct = Vector( direct.x, 0, direct.z ); } /* 一周して歩行状態が更新されなければ音を止める */ if ( soundMap["walk"]->isPlaying() && isWalking == false ) { soundMap["walk"]->pause(); } isWalking = false; }