setFormat

...

Syntax

public const string IFCEngineDLL = @"IFCEngine.dll";

[DllImport(IFCEngineDLL, EntryPoint = "setFormat")]
public static extern void setFormat(Int32 model, Int32 setting, Int32 mask);    

Property model

Size: 32 bit / 4 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: 32 bit / 4 byte (value)
...

Property mask

Size: 32 bit / 4 byte (value)
...

Examples

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

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

    setting += 0;                          //    SINGLE PRECISION (float)
    setting += 0;                          //    32 BIT INDEX ARRAY (Int32)
    setting += IfcEngine.x86.flagbit5;     //    NORMALS ON
    setting += IfcEngine.x86.flagbit8;     //    TRIANGLES ON
    setting += 0;                          //    WIREFRAME OFF
    IfcEngine.x86.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.

    Int32 noVertices = 0, noIndices = 0;
    IfcEngine.x86.initializeModellingInstance(model, ref noVertices, ref noIndices, 0, ifcColumnInstance);

    if  (noVertices != 0  &&  noIndices != 0) {
        float[] vertexArray = new float[noVertices * 6];    //    
        Int32[] indexArray = new Int32[noIndices];
        IfcEngine.x86.finalizeModelling(model, vertexArray, indexArray, 0);

        Int32 mode = 0,
              startVertex = 0, startIndex = 0, primitiveCount = 0;
        IfcEngine.x86.getInstanceInModelling(model, ifcColumnInstance, mode, ref startVertex, ref startIndex, ref 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(Int32 model)
{
    Int32 ifcColumnInstances = IfcEngine.x86.sdaiGetEntityExtentBN(model, "IFCCOLUMN"),
          noIfcColumnInstances = IfcEngine.x86.sdaiGetMemberCount(ifcColumnInstances);
    if (noIfcColumnInstances != 0)
    {
        for (Int32 i = 0; i < noIfcColumnInstances; i++)
        {
            Int32 ifcColumnInstance = 0;
            IfcEngine.x86.engiGetAggrElement(ifcColumnInstances, i, IfcEngine.x86.sdaiINSTANCE, out ifcColumnInstance);

            GenerateGeometry(model, ifcColumnInstance);
        }
    }
}