Public Member Functions

CtrlHitLog Class Reference

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


Search for all occurrences

Detailed Description

class CtrlHitLog

Description:
This class provides a data structure for keeping a log of hits during controller gizmo hit-testing. It provides a list of CtrlHitRecords that may be added to and cleared. A developer may also request the 'closest' hit record in the list. All methods are implemented by the system.

#include <control.h>

Inheritance diagram for CtrlHitLog:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  CtrlHitLog ()
  ~CtrlHitLog ()
CoreExport void  Clear ()
CoreExport void  ClearHitIndex (bool ready=false)
CoreExport void  IncrHitIndex ()
CtrlHitRecord First ()
CoreExport CtrlHitRecord ClosestHit ()
CoreExport void  LogHit (INode *nr, DWORD dist, ulong info, DWORD infoExtra)

Constructor & Destructor Documentation

CtrlHitLog ( ) [inline]
Remarks:
Constructor.
{ first = NULL; hitIndex = 0; hitIndexReady = false; }
~CtrlHitLog ( ) [inline]
{ Clear(); }

Member Function Documentation

CoreExport void Clear ( )
Remarks:
Clears the list of hits.
CoreExport void ClearHitIndex ( bool  ready = false ) [inline]
{ hitIndex = 0; hitIndexReady = ready; }
CoreExport void IncrHitIndex ( ) [inline]
{ if (hitIndexReady) hitIndex++; else hitIndexReady = true; }
CtrlHitRecord* First ( ) [inline]
Remarks:
Returns the first hit record in the list.
{ return first; }
CoreExport CtrlHitRecord* ClosestHit ( )
Remarks:
Returns the CtrlHitRecord that was 'closest' to the mouse position when hit testing was performed.
CoreExport void LogHit ( INode nr,
DWORD  dist,
ulong  info,
DWORD  infoExtra 
)
Remarks:
This method is called to log a hit. It creates a new CtrlHitRecord object using the data passed and adds it to the hit log.
Parameters:
INode *nr

The node whose gizmo was hit.

DWORD dist

The 'distance' of the hit. What the distance actually represents depends on the rendering level of the viewport. For wireframe modes, it refers to the distance in the screen XY plane from the mouse to the sub-object component. In a shaded mode, it refers to the Z depth of the sub-object component. In both cases, smaller values indicate that the sub-object component is 'closer' to the mouse cursor.

ulong hitInfo;

A general unsigned long value. Most controllers will just need this to identity the sub-object element. The meaning of this value (how it is used to identify the element) is up to the plug-in.

DWORD infoExtra;

If the above hitInfo data member is not sufficient to describe the sub-object element this data member may be used as well.

CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog
CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog CtrlHitLog