PolygonKit

class HPS::PolygonKit : public HPS::Kit

The PolygonKit class is a user space object. It is a kit analog to a PolygonKey.

Public Functions

void Consume(PolygonKit &in_kit)

Copies the source PolygonKit into this LineKit and resets the source kit.

Parameters

in_kit – The source PolygonKit to consume.

PolygonKit &EditPointsByDeletion(size_t in_offset, size_t in_count)

Remove the specified number of points from this PolygonKit at the specified offset.

Parameters
  • in_offset – The offset into the points for PolygonKit at which to remove points.

  • in_count – The number of points to remove.

Returns

A reference to this PolygonKit.

PolygonKit &EditPointsByInsertion(size_t in_offset, PointArray const &in_points)

Add points to this PolygonKit at the specified offset.

Parameters
  • in_offset – The offset into the points for PolygonKit at which to add points.

  • in_points – The points to add to this PolygonKit.

Returns

A reference to this PolygonKit.

PolygonKit &EditPointsByInsertion(size_t in_offset, size_t in_count, Point const in_points[])

Add points to this PolygonKit at the specified offset.

Parameters
  • in_offset – The offset into the points for PolygonKit at which to add points.

  • in_count – Size of the following array.

  • in_points – The points to add to this PolygonKit.

Returns

A reference to this PolygonKit.

PolygonKit &EditPointsByReplacement(size_t in_offset, PointArray const &in_points)

Replace the specified number of points for this PolygonKit at the specified offset.

Parameters
  • in_offset – The offset into the points for PolygonKit at which to start replacing points.

  • in_points – The points to use to replace those on this PolygonKit.

Returns

A reference to this PolygonKit.

PolygonKit &EditPointsByReplacement(size_t in_offset, size_t in_count, Point const in_points[])

Replace the specified number of points for this PolygonKit at the specified offset.

Parameters
  • in_offset – The offset into the points for PolygonKit at which to start replacing points.

  • in_count – Size of the following array.

  • in_points – The points to use to replace those on this PolygonKit.

Returns

A reference to this PolygonKit.

virtual bool Empty() const

Indicates whether this PolygonKit has any values set on it.

Returns

true if no values are set on this PolygonKit, false otherwise.

bool Equals(PolygonKit const &in_kit) const

Check if the source PolygonKit is equivalent to this PolygonKit.

Parameters

in_kit – The source PolygonKit to compare to this PolygonKit.

Returns

true if the objects are equivalent, false otherwise.

size_t GetPointCount() const

Retrieves the number of points in this polygon.

Returns

The number of points in this polygon.

inline virtual HPS::Type ObjectType() const

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Returns

The declared type of the object in question, which may differ from the true, underlying type.

bool operator!=(PolygonKit const &in_kit) const

Check if the source PolygonKit is not equivalent to this PolygonKit.

Parameters

in_kit – The source PolygonKit to compare to this PolygonKit.

Returns

true if the objects are not equivalent, false otherwise.

PolygonKit &operator=(PolygonKit &&in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this PolygonKit thereby avoiding a copy.

Parameters

in_that – An rvalue reference to a PolygonKit to take the impl from.

Returns

A reference to this PolygonKit.

PolygonKit &operator=(PolygonKit const &in_kit)

Copies the source PolygonKit into this PolygonKit.

Parameters

in_kit – The source PolygonKit to copy.

Returns

A reference to this PolygonKit.

bool operator==(PolygonKit const &in_kit) const

Check if the source PolygonKit is equivalent to this PolygonKit.

Parameters

in_kit – The source PolygonKit to compare to this PolygonKit.

Returns

true if the objects are equivalent, false otherwise.

PolygonKit()

The default constructor creates an empty PolygonKit object.

PolygonKit(PolygonKit &&in_that)

The move constructor creates a PolygonKit by transferring the underlying impl of the rvalue reference to this PolygonKit thereby avoiding a copy and allocation.

Parameters

in_that – An rvalue reference to a PolygonKit to take the impl from.

PolygonKit(PolygonKit const &in_kit)

The copy constructor creates a new PolygonKit object that contains the same settings as the source PolygonKit.

Parameters

in_kit – The source PolygonKit to copy.

void Set(PolygonKit const &in_kit)

Copies the source PolygonKit into this PolygonKit.

Parameters

in_kit – The source PolygonKit to copy.

PolygonKit &SetPoints(PointArray const &in_points)

Sets the points for this PolygonKit.

Parameters

in_points – The points for this PolygonKit.

Returns

A reference to this PolygonKit.

PolygonKit &SetPoints(size_t in_count, Point const in_points[])

Sets the points for this PolygonKit.

Parameters
  • in_count – Size of the following array.

  • in_points – The points for this PolygonKit.

Returns

A reference to this PolygonKit.

PolygonKit &SetPriority(int in_priority)

Assigns a specific drawing priority value to the PolygonKit. It affects the order in which the contents of this segment are drawn if and only if the rendering algorithm is set to Priority.

See

SubwindowKit::SetPriority()

See

SubwindowKit::SetRenderingAlgorithm()

Parameters

in_priority – The drawing priority, higher priority items are drawn on top of lower priority items.

Returns

A reference to this object.

PolygonKit &SetUserData(intptr_t in_index, ByteArray const &in_data)

Sets user data on this kit.

Parameters
  • in_index – The index of the user data to set.

  • in_data – The bytes of user data to set.

Returns

A reference to this kit.

PolygonKit &SetUserData(intptr_t in_index, size_t in_bytes, byte const in_data[])

Sets user data on this kit.

Parameters
  • in_index – The index of the user data to set.

  • in_bytes – The number of bytes of user data to set.

  • in_data – The bytes of user data to set.

Returns

A reference to this kit.

PolygonKit &SetUserData(IntPtrTArray const &in_indices, ByteArrayArray const &in_data)

Sets user data on this kit.

Parameters
  • in_indices – An array of user data indices to set.

  • in_data – An array of bytes of user data to set.

Returns

A reference to this kit.

void Show(PolygonKit &out_kit) const

Copies this PolygonKit into the given PolygonKit.

Parameters

out_kit – The PolygonKit to populate with the contents of this PolygonKit.

bool ShowPoints(PointArray &out_points) const

Shows the points for this PolygonKit.

Parameters

out_points – The points for this PolygonKit.

Returns

true if points were set, false otherwise.

bool ShowPointsByList(size_t in_count, size_t const in_indices[], PointArray &out_points) const

Show a subset of the points for this PolygonKit by list.

Parameters
  • in_count – The number of points to show.

  • in_indices – The list of point indices to show.

  • out_points – The requested points for this PolygonKit.

Returns

true if all requested points were set, false otherwise.

bool ShowPointsByList(SizeTArray const &in_indices, PointArray &out_points) const

Show a subset of the points for this PolygonKit by list.

Parameters
  • in_indices – The list of point indices to show.

  • out_points – The requested points for this PolygonKit.

Returns

true if all requested points were set, false otherwise.

bool ShowPointsByRange(size_t in_start_index, size_t in_count, PointArray &out_points) const

Show a subset of the points for this PolygonKit by range.

Parameters
  • in_start_index – The first point to show.

  • in_count – The number of points to show.

  • out_points – The requested points for this PolygonKit.

Returns

true if all requested points were set, false otherwise.

bool ShowPriority(int &out_priority) const

Shows the drawing priority.

Parameters

out_priority – The drawing priority, higher priority items are drawn on top of lower priority items.

Returns

true if the setting is valid, false otherwise.

bool ShowUserData(intptr_t in_index, ByteArray &out_data) const

Shows the user data at a given index for this kit.

Parameters
  • in_index – The index of the user data to show.

  • out_data – The user data at the given index.

Returns

true if there is user data at the given index, false otherwise.

bool ShowUserData(IntPtrTArray &out_indices, ByteArrayArray &out_data) const

Shows all user data for this kit.

Parameters
  • out_indices – An array of all user data indices set on this kit.

  • out_data – An array of all user data set on this kit.

Returns

true if there is user data on this kit, false otherwise.

size_t ShowUserDataCount() const

Get the number of user data indices set on this kit.

bool ShowUserDataIndices(IntPtrTArray &out_indices) const

Shows the indices of all user data set on this kit.

Parameters

out_indices – The user data indices set on this kit.

Returns

The number of user data indices set on this kit.

PointArray Triangulate() const

Divides the polygon into triangles. Note that the data in this kit is left untouched. If the polygon is self-intersecting, the intersection points will be calculated and taken into account If an error is encountered while triangulating the polygon, the returned array will be empty.

Returns

An array of points. Each triplet of points represents one of the triangle that was computed. For example, the returned values 0th, 1st and 2nd points represent the first triangle, and the 3rd, 4th and 5th points represent second one, and so forth.

PolygonKit &UnsetAllUserData()

Removes all user data from this kit.

Returns

A reference to this kit.

PolygonKit &UnsetEverything()

Removes all settings from this PolygonKit.

Returns

A reference to this PolygonKit.

PolygonKit &UnsetPoints()

Removes the points for this PolygonKit.

Returns

A reference to this PolygonKit.

PolygonKit &UnsetPriority()

Removes a drawing priority setting.

Returns

A reference to this object.

PolygonKit &UnsetUserData(intptr_t in_index)

Removes the user data at the given index from this kit.

Parameters

in_index – The index of the user data to remove.

Returns

A reference to this kit.

PolygonKit &UnsetUserData(IntPtrTArray const &in_indices)

Removes the user data at the given indices from this kit.

Parameters

in_indices – The indices of the user data to remove.

Returns

A reference to this kit.

PolygonKit &UnsetUserData(size_t in_count, intptr_t const in_indices[])

Removes the user data at the given indices from this kit.

Parameters
  • in_count – The size of the following array.

  • in_indices – The indices of the user data to remove.

Returns

A reference to this kit.

virtual ~PolygonKit()

Public Static Attributes

static const HPS::Type staticType = HPS::Type::PolygonKit