コード例 #1
0
ファイル: aiCamera.cpp プロジェクト: 22Turn/AlembicImporter
aiCamera::Sample* aiCamera::readSample(const abcSampleSelector& ss, bool &topologyChanged)
{
    DebugLog("aiCamera::readSample(t=%f)", time);
    
    Sample *ret = newSample();
    
    m_schema.get(ret->m_sample, ss);

    topologyChanged = false;

    return ret;
}
コード例 #2
0
ファイル: aiXForm.cpp プロジェクト: dgkae/AlembicImporter
aiXForm::Sample* aiXForm::readSample(float time, bool &topologyChanged)
{
    DebugLog("aiXForm::readSample(t=%f)", time);

    Sample *ret = newSample();

    m_schema.get(ret->m_sample, MakeSampleSelector(time));

    topologyChanged = false;

    return ret;
}
コード例 #3
0
ファイル: ClassificationData.cpp プロジェクト: sgrignard/grt
bool ClassificationData::addSample(const UINT classLabel,const VectorFloat &sample){
    
	if( sample.getSize() != numDimensions ){
        if( totalNumSamples == 0 ){
            warningLog << "addSample(const UINT classLabel, VectorFloat &sample) - the size of the new sample (" << sample.getSize() << ") does not match the number of dimensions of the dataset (" << numDimensions << "), setting dimensionality to: " << numDimensions << std::endl;
            numDimensions = sample.getSize();
        }else{
            errorLog << "addSample(const UINT classLabel, VectorFloat &sample) - the size of the new sample (" << sample.getSize() << ") does not match the number of dimensions of the dataset (" << numDimensions << ")" << std::endl;
            return false;
        }
    }

    //The class label must be greater than zero (as zero is used for the null rejection class label
    if( classLabel == GRT_DEFAULT_NULL_CLASS_LABEL && !allowNullGestureClass ){
        errorLog << "addSample(const UINT classLabel, VectorFloat &sample) - the class label can not be 0!" << std::endl;
        return false;
    }

    //The dataset has changed so flag that any previous cross validation setup will now not work
    crossValidationSetup = false;
    crossValidationIndexs.clear();

	ClassificationSample newSample(classLabel,sample);
	data.push_back( newSample );
	totalNumSamples++;

	if( classTracker.getSize() == 0 ){
		ClassTracker tracker(classLabel,1);
		classTracker.push_back(tracker);
	}else{
		bool labelFound = false;
		for(UINT i=0; i<classTracker.getSize(); i++){
			if( classLabel == classTracker[i].classLabel ){
				classTracker[i].counter++;
				labelFound = true;
				break;
			}
		}
		if( !labelFound ){
			ClassTracker tracker(classLabel,1);
			classTracker.push_back(tracker);
		}
	}

    //Update the class labels
    sortClassLabels();

	return true;
}
コード例 #4
0
void RttMeasure::receiveOobData(char *buf, int buf_len, result *r) {
	if(flags & REMOTE) {
		sendOobData(buf, buf_len);
	} else {
		result start, end;
		struct timeval tv_end;
		struct timeval *tv_start;

		tv_start = (struct timeval *) buf;

		start = tv_start->tv_sec + tv_start->tv_usec / 1000000.0;
		end = r[R_RECEIVE_TIME];

		newSample(end-start);
	}
}
コード例 #5
0
ファイル: cgnomelayout.c プロジェクト: icu-project/icu4c
int main (int argc, char *argv[])
{
    LEErrorCode   fontStatus = LE_NO_ERROR;
    poptContext   ptctx;
    GtkWidget    *app;
    const char   *defaultArgs[] = {"Sample.txt", NULL};
    const char  **args;
    int i;

    FT_Init_FreeType(&engine);

    gnome_init_with_popt_table("gnomelayout", "0.1", argc, argv, NULL, 0, &ptctx);

    guiSupport = gs_gnomeGuiSupportOpen();
    fontMap    = fm_gnomeFontMapOpen(engine, "FontMap.Gnome", 24, guiSupport, &fontStatus);
    font       = le_scriptCompositeFontOpen(fontMap);

    if (LE_FAILURE(fontStatus)) {
        FT_Done_FreeType(engine);
        return 1;
    }

    args = poptGetArgs(ptctx);
    
    if (args == NULL) {
        args = defaultArgs;
    }

    for (i = 0; args[i] != NULL; i += 1) {
       app = newSample(args[i]);
           
       gtk_widget_show_all(app);
    }
    
    poptFreeContext(ptctx);
    
    gtk_main();

    le_fontClose(font);
    gs_gnomeGuiSupportClose(guiSupport);

    FT_Done_FreeType(engine);

    exit(0);
}
コード例 #6
0
bool TimeSeriesClassificationData::addSample(const UINT classLabel,const MatrixFloat &trainingSample){
	
    if( trainingSample.getNumCols() != numDimensions ){
        errorLog << "addSample(UINT classLabel, MatrixFloat trainingSample) - The dimensionality of the training sample (" << trainingSample.getNumCols() << ") does not match that of the dataset (" << numDimensions << ")" << std::endl;
        return false;
    }
    
    //The class label must be greater than zero (as zero is used for the null rejection class label
    if( classLabel == GRT_DEFAULT_NULL_CLASS_LABEL && !allowNullGestureClass ){
        errorLog << "addSample(UINT classLabel, MatrixFloat sample) - the class label can not be 0!" << std::endl;
        return false;
    }

    TimeSeriesClassificationSample newSample(classLabel,trainingSample);
    data.push_back( newSample );
    totalNumSamples++;

    if( classTracker.size() == 0 ){
        ClassTracker tracker(classLabel,1);
        classTracker.push_back(tracker);
    }else{
        bool labelFound = false;
        for(UINT i=0; i<classTracker.size(); i++){
            if( classLabel == classTracker[i].classLabel ){
                classTracker[i].counter++;
                labelFound = true;
                break;
            }
        }
        if( !labelFound ){
            ClassTracker tracker(classLabel,1);
            classTracker.push_back(tracker);
        }
    }
    return true;
}
コード例 #7
0
ファイル: cgnomelayout.c プロジェクト: icu-project/icu4c
static void newapp(GtkObject *object, gpointer data)
{
  GtkWidget *app = newSample("Sample.txt");

  gtk_widget_show_all(app);
}