LayOut C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Enumerations | Functions
rectangle.h File Reference
#include <LayOutAPI/common.h>
#include <LayOutAPI/geometry/geometry.h>
#include <LayOutAPI/model/defs.h>

Go to the source code of this file.

Enumerations

enum  LORectangleType {
  LORectangleType_Normal = 0, LORectangleType_Rounded, LORectangleType_Lozenge, LORectangleType_Bulged,
  LONumRectangleTypes
}
 Defines the shape of the rectangle within its boundaries. More...
 

Functions

LO_RESULT LORectangleCreate (LORectangleRef *rectangle, const LOAxisAlignedRect2D *bounds)
 Creates a 'normal' rectangle with 90 degree corners. More...
 
LO_RESULT LORectangleCreateRounded (LORectangleRef *rectangle, const LOAxisAlignedRect2D *bounds, double corner_radius)
 Creates a 'rounded' rectangle with arcs in each corner. More...
 
LO_RESULT LORectangleCreateLozenge (LORectangleRef *rectangle, const LOAxisAlignedRect2D *bounds)
 Creates a 'Lozenge' rectangle with the shorter side curved. More...
 
LO_RESULT LORectangleCreateBulged (LORectangleRef *rectangle, const LOAxisAlignedRect2D *bounds, double bulge_distance)
 Creates a 'bulged' rectangle with the vertical sides curved. More...
 
LO_RESULT LORectangleAddReference (LORectangleRef rectangle)
 Adds a reference to a rectangle object. More...
 
LO_RESULT LORectangleRelease (LORectangleRef *rectangle)
 Releases a rectangle object. The object will be invalidated if releasing the last reference. More...
 
LO_EXPORT LORectangleRef LORectangleFromEntity (LOEntityRef entity)
 Converts from a LOEntityRef to a LORectangleRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LORectangleRef. More...
 
LO_EXPORT LOEntityRef LORectangleToEntity (LORectangleRef rectangle)
 Converts from a LORectangleRef to a LOEntityRef. This is essentially an upcast operation. More...
 
LO_RESULT LORectangleGetTopLeftPoint (LORectangleRef rectangle, LOPoint2D *point)
 Gets the point that was originally defined as the upper left point. Transforms to this object may have moved it so that it is no longer the top left point geometrically on the page. More...
 
LO_RESULT LORectangleGetTopRightPoint (LORectangleRef rectangle, LOPoint2D *point)
 Gets the point that was originally defined as the upper right point. Transforms to this object may have moved it so that it is no longer the top right point geometrically on the page. More...
 
LO_RESULT LORectangleGetBottomLeftPoint (LORectangleRef rectangle, LOPoint2D *point)
 Gets the point that was originally defined as the bottom left point. Transforms to this object may have moved it so that it is no longer the bottom left point geometrically on the page. More...
 
LO_RESULT LORectangleGetBottomRightPoint (LORectangleRef rectangle, LOPoint2D *point)
 Gets the point that was originally defined as the bottom right point. Transforms to this object may have moved it so that it is no longer the bottom right point geometrically on the page. More...
 
LO_RESULT LORectangleGetRectangleType (LORectangleRef rectangle, LORectangleType *type)
 Gets the type of a rectangle. More...
 
LO_RESULT LORectangleSetRectangleType (LORectangleRef rectangle, LORectangleType type)
 Gets the type of a rectangle. More...
 
LO_RESULT LORectangleGetRadius (LORectangleRef rectangle, double *radius)
 Returns the radius that defines the shape of a bulged or rounded rectangle. More...
 
LO_RESULT LORectangleSetRadius (LORectangleRef rectangle, double radius)
 Sets the radius that defines the shape of a bulged or rounded rectangle. More...
 

Enumeration Type Documentation

Defines the shape of the rectangle within its boundaries.

Enumerator
LORectangleType_Normal 

Normal rectangle with 90 degree corners.

LORectangleType_Rounded 

Rectangle with rounded corners and a specified radius.

LORectangleType_Lozenge 

Rectangle with rounded corners and a radius equal to half the smaller of width or height.

LORectangleType_Bulged 

Rectangle whose left and right sides are arcs with a specified radius.

LONumRectangleTypes 

Function Documentation

LO_RESULT LORectangleAddReference ( LORectangleRef  rectangle)

Adds a reference to a rectangle object.

Parameters
[in]rectangleThe rectangle object.
Returns
SU_ERROR_NONE on success SU_ERROR_INVALID_INPUT if rectangle does not refer to a valid object
LO_RESULT LORectangleCreate ( LORectangleRef rectangle,
const LOAxisAlignedRect2D bounds 
)

Creates a 'normal' rectangle with 90 degree corners.

Parameters
[out]rectangleThe rectangle object.
[in]boundsThe starting dimensions of the rectangle.
Returns
LO_RESULT LORectangleCreateBulged ( LORectangleRef rectangle,
const LOAxisAlignedRect2D bounds,
double  bulge_distance 
)

Creates a 'bulged' rectangle with the vertical sides curved.

Parameters
[out]rectangleThe rectangle object.
[in]boundsThe starting dimensions of the rectangle.
[in]bulge_distanceThe size of the bulge, from the outer edge of the rectangle in.
Returns
LO_RESULT LORectangleCreateLozenge ( LORectangleRef rectangle,
const LOAxisAlignedRect2D bounds 
)

Creates a 'Lozenge' rectangle with the shorter side curved.

Parameters
[out]rectangleThe rectangle object.
[in]boundsThe starting dimensions of the rectangle.
Returns
LO_RESULT LORectangleCreateRounded ( LORectangleRef rectangle,
const LOAxisAlignedRect2D bounds,
double  corner_radius 
)

Creates a 'rounded' rectangle with arcs in each corner.

Parameters
[out]rectangleThe rectangle object.
[in]boundsThe starting dimensions of the rectangle.
[in]corner_radiusThe radius of the circles in the corners in inches.
Returns
LO_EXPORT LORectangleRef LORectangleFromEntity ( LOEntityRef  entity)

Converts from a LOEntityRef to a LORectangleRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LORectangleRef.

Parameters
[in]entityThe entity object.
Returns
  • The converted LORectangleRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
LO_RESULT LORectangleGetBottomLeftPoint ( LORectangleRef  rectangle,
LOPoint2D point 
)

Gets the point that was originally defined as the bottom left point. Transforms to this object may have moved it so that it is no longer the bottom left point geometrically on the page.

Parameters
[in]rectangleThe rectangle object.
[out]pointThe position of the original bottom left point.
Returns
LO_RESULT LORectangleGetBottomRightPoint ( LORectangleRef  rectangle,
LOPoint2D point 
)

Gets the point that was originally defined as the bottom right point. Transforms to this object may have moved it so that it is no longer the bottom right point geometrically on the page.

Parameters
[in]rectangleThe rectangle object.
[out]pointThe position of the original bottom right point.
Returns
LO_RESULT LORectangleGetRadius ( LORectangleRef  rectangle,
double *  radius 
)

Returns the radius that defines the shape of a bulged or rounded rectangle.

Parameters
[in]rectangleThe rectangle object.
[out]radiusThe radius for bulged and rounded rectangles.
Returns
LO_RESULT LORectangleGetRectangleType ( LORectangleRef  rectangle,
LORectangleType type 
)

Gets the type of a rectangle.

Parameters
[in]rectangleThe rectangle object.
[out]typeThe type of the rectangle.
Returns
LO_RESULT LORectangleGetTopLeftPoint ( LORectangleRef  rectangle,
LOPoint2D point 
)

Gets the point that was originally defined as the upper left point. Transforms to this object may have moved it so that it is no longer the top left point geometrically on the page.

Parameters
[in]rectangleThe rectangle object.
[out]pointThe position of the original top left point.
Returns
LO_RESULT LORectangleGetTopRightPoint ( LORectangleRef  rectangle,
LOPoint2D point 
)

Gets the point that was originally defined as the upper right point. Transforms to this object may have moved it so that it is no longer the top right point geometrically on the page.

Parameters
[in]rectangleThe rectangle object.
[out]pointThe position of the original top right point.
Returns
LO_RESULT LORectangleRelease ( LORectangleRef rectangle)

Releases a rectangle object. The object will be invalidated if releasing the last reference.

Parameters
[in]rectangleThe rectangle object.
Returns
LO_RESULT LORectangleSetRadius ( LORectangleRef  rectangle,
double  radius 
)

Sets the radius that defines the shape of a bulged or rounded rectangle.

Parameters
[in]rectangleThe rectangle object.
[out]radiusThe radius for bulged and rounded rectangles.
Returns
LO_RESULT LORectangleSetRectangleType ( LORectangleRef  rectangle,
LORectangleType  type 
)

Gets the type of a rectangle.

Parameters
[in]rectangleThe rectangle object.
[in]typeThe type of the rectangle.
Returns
LO_EXPORT LOEntityRef LORectangleToEntity ( LORectangleRef  rectangle)

Converts from a LORectangleRef to a LOEntityRef. This is essentially an upcast operation.

Parameters
[in]rectangleThe rectangle object.
Returns
  • The converted LOEntityRef if rectangle is a valid object
  • If not, the returned reference will be invalid