setFormat

...

Syntax

//   Visual Studio for Windows
public:
void __declspec(dllexport) __stdcall setFormat(
            __int64 model,
            __int64 setting,
            __int64 mask
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
void setFormat(
            int64_t model,
            int64_t setting,
            int64_t mask
        );    

Property model

Size: 64 bit / 8 byte (value)
Handle of the model containing the IFC file, this handle is needed in many other calls and given when the model is created.

Property setting

Size: 64 bit / 8 byte (value)
...

Property mask

Size: 64 bit / 8 byte (value)
...

Examples

Here you can find code snippits that show how the API call setFormat can be used.

void    GenerateGeometry(__int64 model, __int64 ifcColumnInstance)
{
    __int64	setting = 0, mask = 0;
    mask += flagbit2;        //    PRECISION (32/64 bit)
    mask += flagbit3;        //    INDEX ARRAY (32/64 bit)
    mask += flagbit5;        //    NORMALS
    mask += flagbit8;        //    TRIANGLES
    mask += flagbit12;       //    WIREFRAME

    setting += 0;            //    SINGLE PRECISION (float)
    setting += 0;            //    32 BIT INDEX ARRAY (Int32)
    setting += flagbit5;     //    NORMALS ON
    setting += flagbit8;     //    TRIANGLES ON
    setting += 0;            //    WIREFRAME OFF
    setFormat(model, setting, mask);
    //  The setFormat call is not called for each column instance we are generating geometry for.
    //  This is not needed when the setting/mask are not changed, the latest setting always applies.

    __int64 noVertices = 0, noIndices = 0;
    initializeModellingInstance(model, &noVertices, &noIndices, 0, ifcColumnInstance);

    if  (noVertices  &&  noIndices) {
        float   * vertexArray = new float[noVertices * 6];    //    
        __int32 * indexArray = new __int32[noIndices];
        finalizeModelling(model, vertexArray, (__int64 *) indexArray, 0);

        __int64 mode = 0,
                startVertex = 0, startIndex = 0, primitiveCount = 0;
        getInstanceInModelling(model, ifcColumnInstance, mode, &startVertex, &startIndex, &primitiveCount);

        //
        //  Array's vertexArray and indexArray are filled with data.
        //
        //  startIndex points to the first index in the indexArray of relevance
        //  In total 3 * primitiveCount elements on the indexArray represent all the triangles of the object.
        //
        //  startVertex is a derived value and given as some applications can get performance gain from this information.
        //

        ...
    }
}

void    GetColumns(__int64 model)
{
    __int64 ifcColumnInstances = sdaiGetEntityExtentBN(model, "IFCCOLUMN"),
            noIfcColumnInstances = sdaiGetMemberCount(ifcColumnInstances);
    if  (noIfcColumnInstances) {
        for  (__int64 i = 0; i < noIfcColumnInstances; i++) {
            __int64 ifcColumnInstance = 0;
            engiGetAggrElement(ifcColumnInstances, i, sdaiINSTANCE, &ifcColumnInstance);

            GenerateGeometry(model, ifcColumnInstance);
        }
    }
}