Public Member Functions

HitLog Class Reference

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


Search for all occurrences

Detailed Description

This class provides a data structure for keeping a log of hits during sub-object hit-testing.

It provides a list of HitRecords that may be added to and cleared. A developer may also request the 'closest' hit record in the list.

See also:
Class HitRecord, Class HitData

#include <object.h>

Inheritance diagram for HitLog:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  HitLog ()
  Constructor.
  ~HitLog ()
  Destructor.
CoreExport void  Clear ()
  Clears the log of hits by deleting the list of HitRecords.
CoreExport void  ClearHitIndex (bool ready=false)
CoreExport void  IncrHitIndex ()
HitRecord First ()
  Implemented by the System.
CoreExport HitRecord ClosestHit ()
  Implemented by the System.
CoreExport void  LogHit (INode *nr, ModContext *mc, DWORD dist, ulong info, HitData *hitdat=NULL)
  Implemented by the System.

Constructor & Destructor Documentation

HitLog ( ) [inline]

Constructor.

The list of HitRecords is set to NULL.

{ first = NULL; hitIndex = 0; hitIndexReady = false; }
~HitLog ( ) [inline]

Destructor.

Clears the hit log.

{ Clear(); }

Member Function Documentation

CoreExport void Clear ( )

Clears the log of hits by deleting the list of HitRecords.

CoreExport void ClearHitIndex ( bool  ready = false ) [inline]
{ hitIndex = 0; hitIndexReady = ready; }
CoreExport void IncrHitIndex ( ) [inline]
{ if (hitIndexReady) hitIndex++; else hitIndexReady = true; }
HitRecord* First ( ) [inline]

Implemented by the System.

Returns the first HitRecord.

{ return first; }
CoreExport HitRecord* ClosestHit ( )

Implemented by the System.

Returns the HitRecord that was 'closest' to the mouse position when hit testing was performed. This is the HitRecord with the minimum distance.

CoreExport void LogHit ( INode nr,
ModContext mc,
DWORD  dist,
ulong  info,
HitData hitdat = NULL 
)

Implemented by the System.

This method is called to log a hit. It creates a new HitRecord object using the data passed and adds it to the hit log.

Parameters:
nr The node that was hit.
mc The ModContext of the modifier.
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.
info Identifies the sub-object component that was hit.
hitdat If the info field is insufficient to indicate the sub-object component that was hit, pass an instance of the HitData class that contains the needed information.

HitLog HitLog HitLog HitLog HitLog HitLog HitLog HitLog HitLog HitLog
HitLog HitLog HitLog HitLog HitLog HitLog HitLog HitLog HitLog HitLog