bool Paper::load(char paper) { if (!sdready) { initDefault(); return false; } if(paper < FIRSTPAPER || paper > LASTPAPER) return false; String fileName = "/papers/"; fileName += (int) paper; fileName += ".ppr"; char buf[30]; fileName.toCharArray(buf, 30); File f = SD.open(buf, FILE_READ); if (f) { initFromFile(f); f.close(); return true; } else { initDefault(); } return false; }
void TrainingsController::load() { //movements std::ifstream confIn(rootPath + CONF_FILE); if (confIn.is_open()) { std::string name; while (std::getline(confIn, name)) { Properties prop(rootPath + name + ".txt"); Movement *movement = new Movement(prop.get("name"), prop.get("desc"), prop.getDouble("trans_x"), prop.getDouble("trans_y"), prop.getDouble("rotation"), prop.getDouble("compression")); addMovement(movement); } } else initDefault(); confIn.close(); //trainings confIn.open(rootPath + TRAININGS_FILE); int i = 0; if (confIn.is_open()) { std::string name; while (std::getline(confIn, name)) { std::ifstream in(rootPath + name + ".txt"); std::string mov; std::vector<Movement*> vec; while (std::getline(in, mov)) vec.push_back(getMovement(mov)); in.close(); trainings.push_back(new TrainingsProcedure(name, vec, i++)); } } confIn.close(); }
/* 메인함수 */ int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); glutInitWindowSize (WINDOW_WIDTH, WINDOW_HEIGHT); glutInitWindowPosition (100, 100); glutCreateWindow ("cg_prj2_2002570045"); glClearColor (0.0, 0.0, 0.0, 1.0); glEnable(GL_DEPTH_TEST); glEnable(GL_POLYGON_OFFSET_FILL); glPolygonOffset(1, 1); glViewport(0,0,(GLsizei)WINDOW_WIDTH,(GLsizei)WINDOW_HEIGHT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(40,(GLfloat)WINDOW_WIDTH/(GLfloat)WINDOW_HEIGHT, 1, 100); gluLookAt(0,15, 20, 0, 0, 0, 0, 1, 0); initDefault(); glutDisplayFunc(display); glutKeyboardFunc(keyboard); glutSpecialFunc(special); glutReshapeFunc(reshape); glutTimerFunc(10, timer, 0); glutMainLoop(); return 0; }
Settings::Settings(QWidget *parent) : QDialog(parent), ui(new Ui::Settings) { ui->setupUi(this); ui->txtVideoFrame->setValidator(new QIntValidator(0, 50 , this)); ui->txtVideoFrame->setFixedWidth(30); ui->txtFrameToSkip->setValidator(new QIntValidator(1, 9999, this)); ui->txtFrameToSkip->setFixedWidth(40); //Set the settings filename QSettings env(QSettings::UserScope, "Microsoft", "Windows"); env.beginGroup("CurrentVersion/Explorer/Shell Folders"); this->FileName = env.value("Personal").toString() + "/Human Detect and Track/settings.ini"; // myProgSetting = new Settings(this); //Fill the combobox video codec connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(close())); connect(ui->btnSave, SIGNAL(clicked(bool)), this, SLOT(saveSetting(bool))); connect(ui->btnReset, SIGNAL(clicked()), this, SLOT(resetDefault())); connect(ui->btnBrowseSnap, SIGNAL(clicked()), this, SLOT(browseSnap())); connect(ui->btnBrowseExport, SIGNAL(clicked()), this, SLOT(browseExport())); //Load the application setting file if(QFile::exists(this->FileName)){ initUserSetting(); } else { initDefault(); } }
ParseContext::ParseContext(const std::vector<std::pair<std::string , InputError::Action>>& initial) { initDefault(); for (const auto& pair : initial) update( pair.first , pair.second ); initEnv(); }
SoundResource::SoundResource( const std::string &name, int flags ) : Resource( RST_SoundResource, name, flags ) { alGenBuffers( 1, &_buffer ); SoundManager::instance()->checkALError( "generating buffer for Sound resource '%s'", _name.c_str() ); initDefault(); }
bool SoundResource::raiseError( const std::string &msg ) { //reset release(); initDefault(); Modules::log().writeError( "Sound resource '%s': %s", _name.c_str(), msg.c_str() ); return false; }
void Paper::init(bool ready) { sdready = ready; if (sdready) { load(0); } else { initDefault(); } }
bool ShaderResource::raiseError( const string &msg, int line ) { // Reset release(); initDefault(); if( line < 0 ) Modules::log().writeError( "Shader resource '%s': %s", _name.c_str(), msg.c_str() ); else Modules::log().writeError( "Shader resource '%s' in line %i: %s", _name.c_str(), line, msg.c_str() ); return false; }
TimeZone* U_EXPORT2 TimeZone::createDefault() { /* This is here to prevent race conditions. */ UBool needsInit; UMTX_CHECK(&LOCK, (DEFAULT_ZONE == NULL), needsInit); if (needsInit) { initDefault(); } Mutex lock(&LOCK); // In case adoptDefault is called return (DEFAULT_ZONE != NULL) ? DEFAULT_ZONE->clone() : NULL; }
TimeZone* TimeZone::createDefault() { umtx_init(&LOCK); /* This is here to prevent race conditions. */ umtx_lock(&LOCK); UBool f = (DEFAULT_ZONE != 0); umtx_unlock(&LOCK); if (!f) { initDefault(); } Mutex lock(&LOCK); // In case adoptDefault is called return DEFAULT_ZONE->clone(); }
int HttpMime::inherit(HttpMime *pParent, int existedOnly) { if (!pParent) return 0; if (m_pMIMEMap->inherit(pParent->m_pMIMEMap, existedOnly, NULL)) return LS_FAIL; //inheritSuffix(pParent); if (!existedOnly) { if (pParent->m_pDefault) initDefault((char *)pParent->getDefault()->getMIME()->c_str()); } return 0; }
Camera::Camera(unsigned int width, unsigned int height, double fov) : factor_((double(height)/2)/tan(fov*M_PI/360.0)), apertureRadius_(0), sensor_(width, height), gamma_(1.0), subSampler_(1), apertureSampler_(1), eye_(0.0, 0.0, 0.0), view_(0.0, 0.0, -1.0), up_(0.0, 1.0, 0.0), viewToWorld_(initInvViewMatrix(eye_, view_, up_)) { initDefault(); }
Camera::Camera(unsigned int width, unsigned int height, Point3D const& eye, Vector3D const& view, Vector3D const& up, double fov) : factor_((double(height)/2)/tan(fov*M_PI/360.0)), apertureRadius_(0), sensor_(width, height), gamma_(1.0), subSampler_(1), apertureSampler_(1), eye_(eye), view_(view), up_(up), viewToWorld_(initInvViewMatrix(eye, view, up)) { initDefault(); }
SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SettingsDialog) { ui->setupUi(this); presets << "Standard" << "Hero" << "Flames"; initDefault(); presetChanged(); connect(ui->sldScale, SIGNAL(valueChanged(int)), this, SLOT(settingChanged())); connect(ui->chkMagnitude, SIGNAL(stateChanged(int)), this, SLOT(settingChanged())); connect(ui->chkMovingCamera, SIGNAL(stateChanged(int)), this, SLOT(settingChanged())); //connect(ui->sldFloorX, SIGNAL(valueChanged(int)),this,SLOT(settingChanged())); connect(ui->sldStepZ,SIGNAL(valueChanged(int)), this, SLOT(settingChanged())); connect(ui->chkFlashlight,SIGNAL(stateChanged(int)),this, SLOT(settingChanged())); connect(ui->sldObjectSlices,SIGNAL(valueChanged(int)), this, SLOT(settingChanged())); }
void SettingsDialog::loadPreset(int pos) { cout << "NastyFFT: Loading PresetIndex: " << pos << endl; initDefault(); switch (pos) { case 1: //Hero // priv.cam_coords.y = 4.0f; // priv.cam_coords.z = 15; priv.scale=1; priv.flatten = true; priv.step_z = 1.3f; priv.shiness = 1.0; priv.name = "Hero"; preset_index = 1; break; case 2: // priv.cam_coords.y = 4.0f; // priv.cam_coords.z = 15; priv.flatten = false; priv.step_z = 0.1f; priv.shiness = 1.0; priv.name = "Flames"; preset_index = 2; break; } }
VanDerPol2::VanDerPol2(char * name): CyclicAttractor(name) { // TODO Auto-generated constructor stub initDefault(); }
ConductGOSettings::ConductGOSettings() { initDefault(); }
ParseContext::ParseContext() { initDefault(); initEnv(); }
SceneCache::SceneCache(const path& sceneRoot): mSceneRoot(sceneRoot), mErrorCode("error") { initDefault(); }
CodeResource::CodeResource( const string &name, int flags ) : Resource( ResourceTypes::Code, name, flags ) { initDefault(); }
YeastGlycosis::YeastGlycosis(char * name) : CyclicAttractor(name) { // TODO Auto-generated constructor stub initDefault(); }
YeastGlycosis::YeastGlycosis() : CyclicAttractor("YeastGlycosis") { // TODO Auto-generated constructor stub initDefault(); }
ShaderResource::ShaderResource( const string &name, int flags ) : Resource( ResourceTypes::Shader, name, flags ) { initDefault(); }
YeastGlycosis::YeastGlycosis(double * myParam, char * name) : CyclicAttractor(2,4, myParam, name) { // TODO Auto-generated constructor stub initDefault(); }
ParseContext::ParseContext(InputError::Action default_action) { initDefault(); update(default_action); initEnv(); }
PositionSerieSelector::PositionSerieSelector(QWidget *parent) : QWidget(parent) { initDefault(); }
FieldInfo::FieldInfo() { initDefault(); }
VanDerPol2::VanDerPol2(): CyclicAttractor("VanDerPol2") { // TODO Auto-generated constructor stub initDefault(); }
Peak2GeneSettings::Peak2GeneSettings() { initDefault(); }