SUShape Class Reference

Handles a shape object in ShapeUp. More...

#include <ShapeUpAPI.h>

Inheritance diagram for SUShape:

SUObject List of all members.

Public Member Functions

 SUShape ()
 SUShape (SUHANDLE hShape)
bool IsSelected (SUHANDLE hTheme) const
void Select (SUHANDLE hTheme, bool bSelect)
ShapeType GetShapeType () const
void GetBounds (SURectf &r) const
size_t GetPartCount () const
size_t GetCoordinateCount (size_t part) const
void GetCoordinate (size_t part, size_t coordIndex, SUPointf &coord) const
void GetClosestPoint (const SUPointf &ref, SUPointf &closest) const
std::string GetAttribute (SUHANDLE hTheme, size_t index) const
void SetAttribute (SUHANDLE hTheme, size_t index, const char *data)
void SetAttributes (SUHANDLE hTheme, size_t count, const char *data[])
size_t GetShapeSizeBytes () const
void GetShapeBytes (unsigned char *buffer, size_t bufferSize) const

Detailed Description

The SUShape class represents a shape object in ShapeUp. A shape can be a point, polyline or a polygon.
Examples:

example_loadergpi.cpp.


Constructor & Destructor Documentation

SUShape::SUShape (  )  [inline]

Default constructor.

SUShape::SUShape ( SUHANDLE  hShape  )  [inline]

Constructor.

Parameters:
hShape = handle to a ShapeUp shape.
See also:
SUTheme::GetShape(), Theme_GetShape()


Member Function Documentation

bool SUShape::IsSelected ( SUHANDLE  hTheme  )  const [inline]

Checks whether a shape is selected or not.

Parameters:
hTheme = handle to a ShapeUp theme, or a SUTheme object, in which to find this object. Note: A shape can be contained in more than one theme under certain circumstances.
Returns:
true if the shape is selected in the theme hTheme, and false otherwise.
See also:
SUTheme, Shape_IsSelected()

void SUShape::Select ( SUHANDLE  hTheme,
bool  bSelect 
) [inline]

Selects or deselects the shape object.

Parameters:
hTheme = handle to a ShapeUp theme, or a SUTheme object, in which to find this object. Note: A shape can be contained in more than one theme under certain circumstances.
bSelect = if true, the shape will be selected, else deselected.
See also:
SUTheme, Shape_Select()

ShapeType SUShape::GetShapeType (  )  const [inline]

Gets the shape type of this shape.

Returns:
the ShapeType value of this shape.
See also:
Shape_GetShapeType()

void SUShape::GetBounds ( SURectf r  )  const [inline]

Gets the shapes bounding box.

Parameters:
r [out] = a rectangle that will receive the shape bounds.
See also:
Shape_GetBounds()

size_t SUShape::GetPartCount (  )  const [inline]

Gets the count of all parts in this shape.

Returns:
the number of parts in this shape.
See also:
Shape_GetPartCount()

size_t SUShape::GetCoordinateCount ( size_t  part  )  const [inline]

Gets the count of all coordinates in a part for this shape.

Parameters:
part [in] = zero based index of the part to query.
Returns:
the number of coordinates for the given part.
See also:
Shape_GetCoordinateCount()

void SUShape::GetCoordinate ( size_t  part,
size_t  coordIndex,
SUPointf coord 
) const [inline]

Gets a coordinate from this shape.

Parameters:
part [in] = zero based index of the part to query.
coordIndex [in] = zero based index of the coordinate of the part to query.
coord [out] = the coordinate at the specified index.
See also:
Shape_GetCoordinate()

void SUShape::GetClosestPoint ( const SUPointf ref,
SUPointf closest 
) const [inline]

Gets the coordinate of this shape closest to a reference point.

Parameters:
ref [in] = reference point.
closest [out] = the coordinate on this shape closest to ref.
See also:
Shape_GetClosestPoint()

std::string SUShape::GetAttribute ( SUHANDLE  hTheme,
size_t  index 
) const [inline]

Queries this shape for one of its attributes.

Parameters:
hTheme = handle to a ShapeUp theme, or a SUTheme object, in which to find this object. Note: A shape can be contained in more than one theme under certain circumstances.
index = zero-based index of the attribute column to query.
Returns:
an attribute value of this shape.
See also:
SUTheme, Shape_GetAttribute()

void SUShape::SetAttribute ( SUHANDLE  hTheme,
size_t  index,
const char *  data 
) [inline]

Sets an attribute for this shape.

Parameters:
hTheme = handle to a ShapeUp theme, or a SUTheme object, in which to find this object. Note: A shape can be contained in more than one theme under certain circumstances.
index = zero-based index of the attribute column to set.
data = null-terminated string containing the attribute data.
See also:
SUTheme, Shape_SetAttribute()
Examples:
example_loadergpi.cpp.

void SUShape::SetAttributes ( SUHANDLE  hTheme,
size_t  count,
const char *  data[] 
) [inline]

Sets multiple attribute values of a shape within a theme.

Parameters:
hTheme is an SUHANDLE to the theme containing the shape.
count is the number of attribute values in data.
data is an array of null-terminated strings that contains the new values. The data array may contain fewer attributes than the theme can handle. To avoid affecting an attribute value, set the appropriate field to NULL. To clear an attribute, set the field to an empty string, "".
Returns:
This function returns the SURESULT value that ShapeUp returns from the SUExport::ShapeUp_Call() function.
See also:
Shape_SetAttributes(), SetAttribute()

size_t SUShape::GetShapeSizeBytes (  )  const [inline]

Queries this shape for how many bytes are required to store the underlying binary shape object.

Returns:
The number of bytes required to store the binary shape object.
See also:
Shape_GetShapeBytes()

void SUShape::GetShapeBytes ( unsigned char *  buffer,
size_t  bufferSize 
) const [inline]

Retrieves the underlying binary shape object.

Parameters:
buffer = a byte buffer larege enough to store the binary shape object. To get the size needed, first query the shape using the GetShapeSizeBytes() method.
bufferSize = the size in bytes of buffer.
See also:
GetShapeSizeBytes(), Shape_GetShapeBytes()


The documentation for this class was generated from the following file:
Generated on Thu Apr 15 10:55:35 2010 for ShapeUp API by  doxygen 1.5.2