Public Member Functions | Public Attributes

HitRegion Class Reference

This reference page is linked to from the following overview topics: Hit Regions.


Search for all occurrences

Detailed Description

Describes the properties of a region used for built-in hit testing of items in the interactive renderer.

#include <gfx.h>

Inheritance diagram for HitRegion:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  HitRegion ()

Public Attributes

int  type
  The region type.
int  dir
  Region direction.
int  crossing
  If nonzero, elements that are contained within or that cross the region boundary are hit.
int  epsilon
  Specifies the distance in pixels outside the pick point within which elements may be and still be hit.
union {
   POINT   pt
   RECT   rect
   CIRCLE   circle
   POINT *   pts
}; 

Constructor & Destructor Documentation

HitRegion ( ) [inline]
{ dir = RGN_DIR_UNDEF; size = sizeof(HitRegion);}

Member Data Documentation

int type

The region type.

One of the following values

  • POINT_RGN A single point.
  • RECT_RGN A rectangular region.
  • CIRCLE_RGN A circular region.
  • FENCE_RGN An arbitrary multi-point polygon region.
int dir

Region direction.

RGN_DIR_UNDEF by default.

int crossing

If nonzero, elements that are contained within or that cross the region boundary are hit.

If zero, only those elements entirely within the boundary are hit. This is not used for point hit testing.

int epsilon

Specifies the distance in pixels outside the pick point within which elements may be and still be hit.

This is not used for rect or circle testing, is sometimes used with fence hit testing, where it doubles the size of the region, especially when selecting subobject edges or vertices and is always used for point hit testing.

POINT pt
RECT rect
POINT* pts
union { ... }

HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion
HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion HitRegion