/*
 * Go2PartBoundingBoxWidth.c
 * 
 * Gocator system communication library
 * Copyright (C) 2013 by LMI Technologies Inc.
 * 
 * Licensed under The MIT License.
 * Redistributions of files must retain the above copyright notice.
 */

#include <z/Go2Measurements/zGo2PartBoundingBoxWidth.h>
#include <z/zGo2PartTypes.h>
#include <z/zGo2System.h>
#include <string.h>

/*
 * Go2PartBoundingBoxWidth Class 
 */

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_Construct(Go2PartBoundingBoxWidth* measurement, Go2UInt32 id, Go2Object system)
{
    Go2PartBoundingBoxWidth output = zNIL; 
    Go2Status status = zOK; 

    zCHECK(zCalloc(&output, 1, sizeof(Go2PartBoundingBoxWidthClass))); 

    if (!zSUCCESS(status = Go2PartBoundingBoxWidth_Init(output, id, system)))
    {
        zCHECK(Go2Object_Destroy(output)); 
        return status; 
    }

    *measurement = output; 

    return GO2_OK; 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_Init(Go2PartBoundingBoxWidth measurement, Go2UInt32 id, Go2Object system)
{
    Go2PartBoundingBoxWidthClass* obj = zHANDLE_POINTER(measurement);

    zCHECK(Go2PartMeasurement_Init(measurement, GO2_TYPE_PART_BOUNDING_BOX_WIDTH, id, system)); 

    obj->Read = Go2PartBoundingBoxWidth_VRead; 
    obj->Write = Go2PartBoundingBoxWidth_VWrite; 

    return GO2_OK; 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_VRead(Go2PartBoundingBoxWidth measurement, zXml xml, zXmlItem item)
{
    Go2PartBoundingBoxWidthClass* obj = zHANDLE_POINTER(measurement);

    zCHECK(Go2PartMeasurement_VRead(measurement, xml, item)); 
    zCHECK(zXml_Child32s(xml, item, "RegionEnabled", &obj->regionEnabled)); 

    zCHECK(zXml_Child32s(xml, item, "RotationEnable", &obj->rotationEnabled)); 

    return GO2_OK; 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_VWrite(Go2PartBoundingBoxWidth  measurement, zXml xml, zXmlItem item)
{
    Go2PartBoundingBoxWidthClass* obj = zHANDLE_POINTER(measurement);

    zCHECK(Go2PartMeasurement_VWrite(measurement, xml, item)); 
    zCHECK(zXml_SetChild32s(xml, item, "RegionEnabled", obj->regionEnabled)); 

    zCHECK(zXml_SetChild32s(xml, item, "RotationEnable", obj->rotationEnabled)); 

    return GO2_OK; 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_SetId(Go2PartBoundingBoxWidth measurement, Go2UInt32 id)
{
    return Go2Measurement_SetId(measurement, id); 
}

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxWidth_Id(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_Id(measurement); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_SetName(Go2PartBoundingBoxWidth measurement, const Go2Char* name)
{
    return Go2Measurement_SetName(measurement, name); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_Name(Go2PartBoundingBoxWidth measurement, Go2Char* name, Go2UInt32 capacity)
{
    return Go2Measurement_Name(measurement, name, capacity); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_SetDecisionMin(Go2PartBoundingBoxWidth measurement, Go2Double min)
{
    return Go2Measurement_SetDecisionMin(measurement, min); 
}

GO2_EXPORT(Go2Double) Go2PartBoundingBoxWidth_DecisionMin(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_DecisionMin(measurement); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_SetDecisionMax(Go2PartBoundingBoxWidth measurement, Go2Double max)
{
    return Go2Measurement_SetDecisionMax(measurement, max); 
}

GO2_EXPORT(Go2Double) Go2PartBoundingBoxWidth_DecisionMax(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_DecisionMax(measurement); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_EnableHold(Go2PartBoundingBoxWidth measurement, Go2Bool enable)
{
    return Go2Measurement_EnableHold(measurement, enable);  
} 

GO2_EXPORT(Go2Bool) Go2PartBoundingBoxWidth_HoldEnabled(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_HoldEnabled(measurement);  
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_EnableSmoothing(Go2PartBoundingBoxWidth measurement, Go2Bool enable)
{
    return Go2Measurement_EnableSmoothing(measurement, enable);  
} 

GO2_EXPORT(Go2Bool) Go2PartBoundingBoxWidth_SmoothingEnabled(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_SmoothingEnabled(measurement);  
} 

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxWidth_SmoothingWindowMin(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_SmoothingWindowMin(measurement);  
} 

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxWidth_SmoothingWindowMax(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_SmoothingWindowMax(measurement);  
} 

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_SetSmoothingWindow(Go2PartBoundingBoxWidth measurement, Go2UInt32 window)
{
    return Go2Measurement_SetSmoothingWindow(measurement, window);  
} 

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxWidth_SmoothingWindow(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_SmoothingWindow(measurement);  
} 

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_EnableRotation(Go2PartBoundingBoxWidth measurement, Go2Bool enable)
{
    Go2PartBoundingBoxWidthClass* obj = zHANDLE_POINTER(measurement);

    zCHECK(Go2System_CheckConfigurable(obj->system));
    obj->rotationEnabled = enable;
    zCHECK(Go2System_SetModified(obj->system));

    return GO2_OK;
}
 
GO2_EXPORT(Go2Bool) Go2PartBoundingBoxWidth_RotationEnabled(Go2PartBoundingBoxWidth measurement)
{
    Go2PartBoundingBoxWidthClass* obj = zHANDLE_POINTER(measurement);
    return obj->rotationEnabled;
}



GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_SetScale(Go2PartBoundingBoxWidth measurement, Go2Double scale){
    return Go2Measurement_SetScale(measurement, scale);
}

GO2_EXPORT(Go2Double) Go2PartBoundingBoxWidth_Scale(Go2PartBoundingBoxWidth measurement){
    return Go2Measurement_Scale(measurement);
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_SetOffset(Go2PartBoundingBoxWidth measurement, Go2Double offset){
    return Go2Measurement_SetOffset(measurement, offset);
}

GO2_EXPORT(Go2Double) Go2PartBoundingBoxWidth_Offset(Go2PartBoundingBoxWidth measurement){
    return Go2Measurement_Offset(measurement);
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_EnableLink(Go2PartBoundingBoxWidth measurement, Go2Bool enable)  
{
    return Go2Measurement_EnableLink(measurement, enable);  
}

GO2_EXPORT(Go2Bool) Go2PartBoundingBoxWidth_LinkEnabled(Go2PartBoundingBoxWidth measurement)  
{
    return Go2Measurement_LinkEnabled(measurement);  
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_SetLink(Go2PartBoundingBoxWidth measurement, Go2UInt32 link) 
{
    return Go2Measurement_SetLink(measurement, link); 
}

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxWidth_Link(Go2PartBoundingBoxWidth measurement) 
{
    return Go2Measurement_Link(measurement); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxWidth_EnableRegion(Go2PartBoundingBoxWidth measurement, Go2Bool enable)  
{
    return Go2PartMeasurement_EnableRegion(measurement, enable);  
}

GO2_EXPORT(Go2Bool) Go2PartBoundingBoxWidth_RegionEnabled(Go2PartBoundingBoxWidth measurement)  
{
    return Go2PartMeasurement_RegionEnabled(measurement);  
}

GO2_EXPORT(Go2PartRegion3d) Go2PartBoundingBoxWidth_Region(Go2PartBoundingBoxWidth measurement)
{
    return Go2PartMeasurement_Region(measurement);
}

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxWidth_LinkOptionCount(Go2PartBoundingBoxWidth measurement)
{
    return Go2Measurement_LinkOptionCount(measurement);
}

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxWidth_LinkOptionAt(Go2PartBoundingBoxWidth measurement, Go2UInt32 index)
{
    return Go2Measurement_LinkOptionAt(measurement, index);
}
