/*--------------------------------------------------------------------------*/ int *getAllTypesNumber(int *sizeArray) { int *TypeNumbers = NULL; int numberOfTypes = getNumberOfTypes(); *sizeArray = 0; if (numberOfTypes > 0) { TypeNumbers = (int*)MALLOC(sizeof(int) * numberOfTypes); if (TypeNumbers) { int i = 0; int j = 0; for (i = 0; i < MAX_SCILAB_DEFINED_TYPE; i++) { if ( C2F(typnams).ln[i] != 0) { TypeNumbers[j] = C2F(typnams).tp[i]; j++; } } *sizeArray = j; } } return TypeNumbers; }
File::Block* File::getBlocksByType(string typeName, unsigned int pos) { unsigned int maxNum = getNumberOfTypes(typeName); if(maxNum <= pos) { ofLogWarning(OFX_BLENDER) << typeName << " " << pos << " not found"; return NULL; } return getBlocksByType(typeName)[pos]; }
/** * Assuming the given R value represents only one lineage, returns the type of that lineage. * @return The type */ int getType() { if (n!= 1) throw "A type should only have one allele"; for (int i = 0; i < getNumberOfTypes();i++) { if (getNum(i) == 1) return i; } throw "Should be either red or green"; }
unsigned int File::getNumberOfObjects() { return getNumberOfTypes(BL_OBJECT); }
unsigned int File::getNumberOfScenes() { return getNumberOfTypes(BL_SCENE); }