Ejemplo n.º 1
0
char HAdaptiveField::load(AdaptiveField * fld)
{
    int nc = 1;
    readIntAttr(".ncells", &nc);

    float originSpan[4];
    readFloatAttr(".origin_span", originSpan);

    int ml = 7;
    readIntAttr(".max_level", &ml);

    fld->setBounding(originSpan);
    fld->setMaxLevel(ml);

    BaseBuffer dhash;
    dhash.create(nc * 16);
    readCharData(".cellHash", nc*16, dhash.data());

    IOCellHash * src = (IOCellHash *)dhash.data();
    std::cout<<"\n hadaptive field add n cells "<<nc;
    unsigned i = 0;
    for(; i<nc; i++) {
        fld->addCell(src->code, src->level, src->visited, src->index);
        src++;
    }
    std::cout<<"\n hadaptive field done load";
    return HField::load(fld);
}
Ejemplo n.º 2
0
bool HAttributeGroup::readNumericValueAsFlt(ANumericAttribute * data)
{
	if(!hasNamedAttr(".val")) return false;
	float v;
	readFloatAttr(".val", &v);
	data->setValue(v);
	return true;
}
Ejemplo n.º 3
0
char HFltAttributeEntry::load(float * dst)
{
    readFloatAttr(".def_val", dst);
    return 1;
}
Ejemplo n.º 4
0
char HFlt3AttributeEntry::load(Vector3F * dst)
{
    readFloatAttr(".def_val", (float *)dst);
    return 1;
}