Exemplo n.º 1
0
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;
	
}
Exemplo n.º 4
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();
    }
}
Exemplo n.º 5
0
    ParseContext::ParseContext(const std::vector<std::pair<std::string , InputError::Action>>& initial) {
        initDefault();

        for (const auto& pair : initial)
            update( pair.first , pair.second );

        initEnv();
    }
Exemplo n.º 6
0
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();
}
Exemplo n.º 7
0
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;
}
Exemplo n.º 8
0
void Paper::init(bool ready)
{
    sdready = ready;
    if (sdready) {
        load(0);
    }
    else {
        initDefault();
    }
}
Exemplo n.º 9
0
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;
}
Exemplo n.º 10
0
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;
}
Exemplo n.º 11
0
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();
}
Exemplo n.º 12
0
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;
}
Exemplo n.º 13
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();

}
Exemplo n.º 14
0
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();

}
Exemplo n.º 15
0
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()));


}
Exemplo n.º 16
0
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;
    }


}
Exemplo n.º 17
0
VanDerPol2::VanDerPol2(char * name): CyclicAttractor(name) {
	// TODO Auto-generated constructor stub
	initDefault();
}
Exemplo n.º 18
0
ConductGOSettings::ConductGOSettings() {
    initDefault();
}
Exemplo n.º 19
0
 ParseContext::ParseContext() {
     initDefault();
     initEnv();
 }
Exemplo n.º 20
0
 SceneCache::SceneCache(const path& sceneRoot): 
     mSceneRoot(sceneRoot),
     mErrorCode("error") {
     initDefault();
 }
Exemplo n.º 21
0
CodeResource::CodeResource( const string &name, int flags ) :
	Resource( ResourceTypes::Code, name, flags )
{
	initDefault();
}
Exemplo n.º 22
0
YeastGlycosis::YeastGlycosis(char * name) : CyclicAttractor(name) {
	// TODO Auto-generated constructor stub
	initDefault();
}
Exemplo n.º 23
0
YeastGlycosis::YeastGlycosis() : CyclicAttractor("YeastGlycosis") {
	// TODO Auto-generated constructor stub
	initDefault();
}
Exemplo n.º 24
0
ShaderResource::ShaderResource( const string &name, int flags ) :
	Resource( ResourceTypes::Shader, name, flags )
{
	initDefault();
}
Exemplo n.º 25
0
YeastGlycosis::YeastGlycosis(double * myParam, char * name) : CyclicAttractor(2,4, myParam, name) {
	// TODO Auto-generated constructor stub
	initDefault();
}
Exemplo n.º 26
0
 ParseContext::ParseContext(InputError::Action default_action) {
     initDefault();
     update(default_action);
     initEnv();
 }
PositionSerieSelector::PositionSerieSelector(QWidget *parent) :
    QWidget(parent)
{
    initDefault();
}
Exemplo n.º 28
0
FieldInfo::FieldInfo()
{
    initDefault();
}
Exemplo n.º 29
0
VanDerPol2::VanDerPol2(): CyclicAttractor("VanDerPol2") {
	// TODO Auto-generated constructor stub
	initDefault();
}
Exemplo n.º 30
0
Peak2GeneSettings::Peak2GeneSettings() {
    initDefault();
}