/*
 * Go2PartTypes.h
 * 
 * Gocator system communication library
 * Copyright (C) 2010 by LMI Technologies Inc.
 * 
 * Licensed under The MIT License.
 * Redistributions of files must retain the above copyright notice.
 */
#ifndef LMITECH_GO2_PART_TYPES_H_INCLUDED
#define LMITECH_GO2_PART_TYPES_H_INCLUDED

#include <Go2Object.h>
#include <Go2ApiBegin.h>

#define GO2_MAX_REF_REGIONS                       4                     //Represents the maximum number of reference regions that can be returned in certain part measurements

#define GO2_MIN_PLANE_REGIONS                     1                     //The minimum number of regions permitted for part plane measurements.
#define GO2_MAX_PLANE_REGIONS                     2                     //The maximum number of regions permitted for part plane measurements.
#define GO2_DEFAULT_PLANE_REGION_COUNT            1                     //The default number of regions used for part plane measurements.

typedef enum Go2PartHeightType
{
    GO2_PART_HEIGHT_TYPE_MINIMUM                = 0,                    // Find the minimum height for a part
    GO2_PART_HEIGHT_TYPE_MAXIMUM                = 1,                    // Find the maximum height for a part
    GO2_PART_HEIGHT_TYPE_CENTROID_2D            = 2,                    // Find the height for a part at the centroid
    GO2_PART_HEIGHT_TYPE_CENTROID_3D            = 3,                    // Find the height for a part at the centroid
    GO2_PART_HEIGHT_TYPE_AVERAGE                = 4,                    // Find the height for a part based on an average of all the points in the part.
    GO2_PART_HEIGHT_TYPE_MEDIAN                 = 5                     // Find the height for a part based on the median of all the points in the part.
} Go2PartHeightType;                                                    // Represents a part height type. 

typedef enum Go2PartOpeningType
{
    GO2_PART_OPENING_TYPE_ROUNDED_SLOT    = 0,                          // For openings with rounded corners
    GO2_PART_OPENING_TYPE_RECTANGLE       = 1                           // For openings with right angled corners
} Go2PartOpeningType;                                                   // Represents a part opening type

typedef enum Go2PartOverlapType
{
    GO2_PART_OVERLAP_TYPE_EXTRA                 = 0,                    // Content present in object, but not in template.
    GO2_PART_OVERLAP_TYPE_MISSING               = 1,                    // Content present in template, but not in object.
    GO2_PART_OVERLAP_TYPE_DIFFERENT             = 2                     // Sum of exta and missing content.
} Go2PartOverlapType;                                                   // Represent the type of part overlap comparison.

typedef enum Go2PartFeature3dType
{
    GO2_PART_2D_CENTROID                        = 0,                    // Find the height for a part at the centroid
    GO2_PART_3D_CENTROID                        = 1,                    // Find the height for a part at the centroid
    GO2_PART_X_MIN                              = 2,                    // Find the height for a part at the minimum X position
    GO2_PART_X_MAX                              = 3,                    // Find the height for a part at the maximum X position
    GO2_PART_Y_MIN                              = 4,                    // Find the height for a part at the minimum Y position
    GO2_PART_Y_MAX                              = 5,                    // Find the height for a part at the maximum Y position
    GO2_PART_Z_MIN                              = 6,                    // Find the height for a part at the minimum Z position
    GO2_PART_Z_MAX                              = 7                     // Find the height for a part at the maximum Z position
} Go2PartFeature3dType;                                                 // Represents the type for a part feature.

typedef enum Go2PartHeightThresholdDirection
{
    GO2_PART_HEIGHT_THRESHOLD_DIRECTION_ABOVE = 0,                      //Points above the height threshold are considered a point in the part
    GO2_PART_HEIGHT_THRESHOLD_DIRECTION_BELOW = 1                       //Points below the height threshold are considered a point in the part
} Go2PartHeightThresholdDirection;

typedef enum Go2PartFrameOfReference
{
    GO2_PART_FOR_TYPE_SENSOR      = 0,                                  //Relevant to 3x00 sensors only - All measurement values will be relative to the sensor FOV in x and y.
    GO2_PART_FOR_TYPE_SCAN        = 0,                                  //Relevant to 2x00 sensors only - Most measurement values will be relative to the sensor FOV in x and y = 0 at the first row of the part. Bounding box measurements are always relative to the sensor's FOV.
    GO2_PART_FOR_TYPE_PART        = 1,                                  //Most measurement values are relative to the center of the bounding box of the part. The bounding box measurements always use the sensor's FOV.
} Go2PartFrameOfReference;


/*
 * Go2PartCircleRegion Class 
 */

typedef Go2Object Go2PartCircleRegion;       // Represents circular region settings used in some part measurements.

GO2_EXPORT(Go2Status) Go2PartCircleRegion_SetX(Go2PartCircleRegion region, Go2Double x); //
//
//  Description:
//      Sets the region x origin.
//  Arguments:
//      region - Go2PartCircleRegion object. 
//      x - X origin value.
//  Returns:
//      Operation status.

GO2_EXPORT(Go2Double) Go2PartCircleRegion_X(Go2PartCircleRegion region); //
//
//  Description:
//      Gets the region x origin.
//  Arguments:
//      region - Go2PartCircleRegion object. 
//  Returns:
//      X value.
 
GO2_EXPORT(Go2Status) Go2PartCircleRegion_SetY(Go2PartCircleRegion region, Go2Double y); //
//
//  Description:
//      Sets the region y origin.
//  Arguments:
//      region - Go2PartCircleRegion object. 
//      y - Y origin value.
//  Returns:
//      Operation status.
 
GO2_EXPORT(Go2Double) Go2PartCircleRegion_Y(Go2PartCircleRegion region); //
//
//  Description:
//      Gets the region y origin.
//  Arguments:
//      region - Go2PartCircleRegion object. 
//  Returns:
//      Y value.

GO2_EXPORT(Go2Status) Go2PartCircleRegion_SetRadius(Go2PartCircleRegion region, Go2Double radius); //
//
//  Description:
//      Sets the circle region radius.
//  Arguments:
//      region - Go2PartCircleRegion object. 
//      width - Width value.
//  Returns:
//      Operation status.
 
GO2_EXPORT(Go2Double) Go2PartCircleRegion_Radius(Go2PartCircleRegion region); //
//
//  Description:
//      Gets the circle region radius.
//  Arguments:
//      region - Go2PartCircleRegion object. 
//  Returns:
//      Width value.

/*
 * Go2PartRegion2d Class 
 */

typedef Go2Object Go2PartRegion2d;       // Represents rectangular region settings used in part measurement.

GO2_EXPORT(Go2Status) Go2PartRegion2d_SetX(Go2PartRegion2d area, Go2Double x); //
//
//  Description:
//      Sets the region x origin.
//  Arguments:
//      region - Go2PartRegion2d object. 
//      x - X origin value.
//  Returns:
//      Operation status.

GO2_EXPORT(Go2Double) Go2PartRegion2d_X(Go2PartRegion2d area); //
//
//  Description:
//      Gets the region x origin.
//  Arguments:
//      region - Go2PartRegion2d object. 
//  Returns:
//      X value.
 
GO2_EXPORT(Go2Status) Go2PartRegion2d_SetY(Go2PartRegion2d area, Go2Double y); //
//
//  Description:
//      Sets the region y origin.
//  Arguments:
//      region - Go2PartRegion2d object. 
//      y - Y origin value.
//  Returns:
//      Operation status.
 
GO2_EXPORT(Go2Double) Go2PartRegion2d_Y(Go2PartRegion2d area); //
//
//  Description:
//      Gets the region y origin.
//  Arguments:
//      region - Go2PartRegion2d object. 
//  Returns:
//      Y value.

GO2_EXPORT(Go2Status) Go2PartRegion2d_SetWidth(Go2PartRegion2d area, Go2Double width); //
//
//  Description:
//      Sets the region width.
//  Arguments:
//      region - Go2PartRegion2d object. 
//      width - Width value.
//  Returns:
//      Operation status.
 
GO2_EXPORT(Go2Double) Go2PartRegion2d_Width(Go2PartRegion2d area); //
//
//  Description:
//      Gets the region width.
//  Arguments:
//      region - Go2PartRegion2d object. 
//  Returns:
//      Width value.

GO2_EXPORT(Go2Status) Go2PartRegion2d_SetLength(Go2PartRegion2d area, Go2Double length); //
//
//  Description:
//      Sets the region length.
//  Arguments:
//      region - Go2PartRegion2d object. 
//      length - Length value.
//  Returns:
//      Operation status.
  
GO2_EXPORT(Go2Double) Go2PartRegion2d_Length(Go2PartRegion2d area); //
//
//  Description:
//      Gets the region length.
//  Arguments:
//      region - Go2PartRegion2d object. 
//  Returns:
//      Length value.



/*
 * Go2PartRegion3d Class 
 */

typedef Go2Object Go2PartRegion3d;       // Represents box region settings used in part measurement.

GO2_EXPORT(Go2Status) Go2PartRegion3d_SetX(Go2PartRegion3d area, Go2Double x); //
//
//  Description:
//      Sets the region x origin.
//  Arguments:
//      region - Go2PartRegion3d object. 
//      x - X origin value.
//  Returns:
//      Operation status.

GO2_EXPORT(Go2Double) Go2PartRegion3d_X(Go2PartRegion3d area); //
//
//  Description:
//      Gets the region x origin.
//  Arguments:
//      region - Go2PartRegion3d object. 
//  Returns:
//      X value.
 
GO2_EXPORT(Go2Status) Go2PartRegion3d_SetY(Go2PartRegion3d area, Go2Double y); //
//
//  Description:
//      Sets the region y origin.
//  Arguments:
//      region - Go2PartRegion3d object. 
//      y - Y origin value.
//  Returns:
//      Operation status.
 
GO2_EXPORT(Go2Double) Go2PartRegion3d_Y(Go2PartRegion3d area); //
//
//  Description:
//      Gets the region y origin.
//  Arguments:
//      region - Go2PartRegion3d object. 
//  Returns:
//      Y value.

GO2_EXPORT(Go2Status) Go2PartRegion3d_SetZ(Go2PartRegion3d area, Go2Double z); //
//
//  Description:
//      Sets the region z origin.
//  Arguments:
//      region - Go2PartRegion3d object. 
//      z - Z origin value.
//  Returns:
//      Operation status.

GO2_EXPORT(Go2Double) Go2PartRegion3d_Z(Go2PartRegion3d area); //
//
//  Description:
//      Gets the region z origin.
//  Arguments:
//      region - Go2PartRegion3d object. 
//  Returns:
//      Z value.

GO2_EXPORT(Go2Status) Go2PartRegion3d_SetWidth(Go2PartRegion3d area, Go2Double width); //
//
//  Description:
//      Sets the region width.
//  Arguments:
//      region - Go2PartRegion3d object. 
//      width - Width value.
//  Returns:
//      Operation status.
 
GO2_EXPORT(Go2Double) Go2PartRegion3d_Width(Go2PartRegion3d area); //
//
//  Description:
//      Gets the region width.
//  Arguments:
//      region - Go2PartRegion3d object. 
//  Returns:
//      Width value.

GO2_EXPORT(Go2Status) Go2PartRegion3d_SetLength(Go2PartRegion3d area, Go2Double length); //
//
//  Description:
//      Sets the region length.
//  Arguments:
//      region - Go2PartRegion3d object. 
//      length - Length value.
//  Returns:
//      Operation status.
  
GO2_EXPORT(Go2Double) Go2PartRegion3d_Length(Go2PartRegion3d area); //
//
//  Description:
//      Gets the region length.
//  Arguments:
//      region - Go2PartRegion3d object. 
//  Returns:
//      Length value.
 
GO2_EXPORT(Go2Status) Go2PartRegion3d_SetHeight(Go2PartRegion3d area, Go2Double height); //
//
//  Description:
//      Sets the region height.
//  Arguments:
//      region - Go2PartRegion3d object. 
//      height - Height value.
//  Returns:
//      Operation status.

GO2_EXPORT(Go2Double) Go2PartRegion3d_Height(Go2PartRegion3d area); //
//
//  Description:
//      Gets the region height.
//  Arguments:
//      region - Go2PartRegion3d object. 
//  Returns:
//      Height value.

/*
 * Go2PartFeature3d Class 
 */

typedef Go2Object Go2PartFeature3d;    // Represents settings for a box region with a feature type used in some part measurements.

GO2_EXPORT(Go2Status) Go2PartFeature3d_SetFeatureType(Go2PartFeature3d feature, Go2PartFeature3dType type); //
//
//  Description:
//      Sets the feature 3d type.
//  Arguments:
//      feature - Go2PartFeature3d object. 
//      type - Feature 3d type.
//  Returns:
//      Operation status.

GO2_EXPORT(Go2PartFeature3dType) Go2PartFeature3d_FeatureType(Go2PartFeature3d featureType); //
//
//  Description:
//      Gets the feature 3d type.
//  Arguments:
//      feature - Go2PartFeature3d object. 
//  Returns: 
//      Feature point type.

GO2_EXPORT(Go2PartRegion3d) Go2PartFeature3d_Region(Go2PartFeature3d feature); //
//
//  Description:
//      Gets the volume associated with the feature.
//  Arguments:
//      feature - Go2PartFeature3d object. 
//  Returns: 
//      The 3d part region.

GO2_EXPORT(Go2Bool) Go2PartFeature3d_RegionEnabled(Go2PartFeature3d feature); //
//
//  Description:
//      Returns a boolean representing whether the given feature's region is enabled.
//  Arguments:
//      feature - Go2PartFeature3d object. 
//  Returns: 
//      GO2_TRUE if the region is enabled. GO2_FALSE otherwise.

GO2_EXPORT(Go2Bool) Go2PartFeature3d_EnableRegion(Go2PartFeature3d feature, Go2Bool enable); //
//
//  Description:
//      Returns a boolean representing whether the given feature's region is enabled.
//  Arguments:
//      feature - Go2PartFeature3d object. 
//      enable - A boolean where GO2_TRUE enables the region. GO2_FALSE otherwise.
//  Returns: 
//      Operation status.

#include <Go2ApiEnd.h>

#endif      /* #ifndef LMITECH_GO2_PART_TYPES_H_INCLUDED */
