a2dHit Struct Reference

struct for how a single object on one layer was hit More...

#include <polyver.h>

Collaboration diagram for a2dHit:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Hit {
  hit_none = 0x00, hit_stroke = 0x01, hit_fill = 0x02, hit_child = 0x04,
  hit_member = 0x08, hit_captured = 0x10
}
 Basic hit type. More...
enum  Stroke1 { stroke1_none, stroke1_outside, stroke1_inside }
 How the point is on the stroke ( in stroke perpendicular direction ).
enum  Stroke2 {
  stroke2_none, stroke2_vertex, stroke2_edgehor, stroke2_edgevert,
  stroke2_edgeother
}
 How the point is on the stroke ( in stroke parallel direction ).

Public Member Functions

 a2dHit ()
 Default constructor.
 a2dHit (Hit hit, Stroke1 stroke1, Stroke2 stroke2, unsigned int index, float distance)
 Standard constructor.
bool IsHit () const
 true if this is a hit
bool IsStrokeHit () const
 true if this is a stroke hit (parent or child/member stroke)
bool IsFillHit () const
 true if this is a fill hit (parent or child/member fill)
bool IsInsideHit () const
 true if this is a fill hit or an inside stroke hit (parent or child/member)
bool IsDirectStrokeHit () const
 true if this is a direct stroke hit (not a member or child object stroke hit )
bool IsDirectFillHit () const
 true if this is a direct fill hit (not a member or child object fill hit )
bool IsChildHit () const
 true if this is child hit
bool IsMemberdHit () const
 true if this is member object hit (e.g. line begin/end object)
bool IsEdgeHit () const
 true if this is a stroke hit on an edge

Public Attributes

enum a2dHit::Hit m_hit
enum a2dHit::Stroke1 m_stroke1
enum a2dHit::Stroke2 m_stroke2
unsigned int m_index
 For edge/vertex hits the index of the edge / vertex.
float m_distance
 For margin hits, the distance from the stroke center in fractions of the margin.

Static Public Attributes

static a2dHit stock_nohit
 Stock object for no hit.
static a2dHit stock_fill
 Stock object for a fill hit.
static a2dHit stock_strokeoutside
 Stock object for an outer stroke hit on objects without vertices/edges (like circles).
static a2dHit stock_strokeinside
 Stock object for an inner stroke hit on objects without vertices/edges (like circles).

Friends

Hit operator| (Hit a, Hit b)


Detailed Description

struct for how a single object on one layer was hit

Definition at line 38 of file polyver.h.


Member Enumeration Documentation

Basic hit type.

For a object without childs, this is either hit_none, hit_stroke or hit_fill. A stroke hit is also given if the test-point has a margin distance from the strokes fill. This way 0-width strokes can also be hit. A distinction between a true stroke hit and a stroke margin hit is currently not possible. If the stroke or fill of a child or member is hit, the hit_child or hit_member flag is also set. Note: a2dHit is only used temporarily, so there is no need to save memory using bitfields.

Enumerator:
hit_none  The object is not hit. This should not happen, because the parent should include hit childs.
hit_stroke  The point is on the stroke or stroke margin.
hit_fill  The point is in the fill area.
hit_child  The point hits a child of the object.
hit_member  The point hits a member of the object (e.g. line begin/end object).
hit_captured  a hit which resulted into a captured object, and may now not hit the object itself, still the object will recieve mouse events.

Definition at line 49 of file polyver.h.


Member Data Documentation

For margin hits, the distance from the stroke center in fractions of the margin.

Note: using a fraction of the margin makes the distance independent of local scaling

Definition at line 93 of file polyver.h.


The documentation for this struct was generated from the following files:
a2dHit Struct Reference -- Tue Aug 31 18:28:09 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation