Public Member Functions | Public Attributes | Friends

HitRecord Class Reference

This reference page is linked to from the following overview topics: Sub-Object Hit Testing, Modifier Selection Methods.


Search for all occurrences

Detailed Description

This class provides a data structure used during sub-object hit-testing.

Data Members:
INode *nodeRef;

Points the node that was hit.

ModContext *modContext;

Points to the ModContext of the modifier.

DWORD distance;

The 'distance' of the hit. To classify as a hit, the sub-object component must be within some threshold distance of the mouse. This distance is recorded in the hit record so that the closest of all the hits can be identified. 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 modifiers will just need this to identity the sub-object element. The edit mesh modifier uses the value to store the index of the vertex or face that was hit for example.

HitData *hitData;

In case 4 bytes is not enough space to identity the sub-object element, this pointer is available. To use this, a developer would define a class derived from HitData that would contain the necessary data. The HitData class has one member function, a virtual destructor, so the derived class can be properly deleted when the HitRecord instance is deleted.
See also:
Class HitLog, Class HitData

#include <object.h>

Inheritance diagram for HitRecord:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  HitRecord ()
  Constructor.
  HitRecord (INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat)
  Constructor.
  HitRecord (HitRecord *n, INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat)
  Constructor.
HitRecord Next ()
  Implemented by the System.
CoreExport  ~HitRecord ()
  Implemented by the System.

Public Attributes

INode nodeRef
ModContext modContext
DWORD  distance
ulong  hitInfo
HitData hitData

Friends

class  HitLog

Constructor & Destructor Documentation

HitRecord ( ) [inline]

Constructor.

The following initialization is performed: next = NULL; modContext = NULL; distance = 0; hitInfo = 0; hitData = NULL;

{ next = NULL; modContext = NULL; distance = 0; hitInfo = 0; hitData = NULL;}
HitRecord ( INode nr,
ModContext mc,
DWORD  d,
ulong  inf,
HitData hitdat 
) [inline]

Constructor.

The data members are initialized to the data passed.

                                                                              {
        next = NULL;
        nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
    }               
HitRecord ( HitRecord n,
INode nr,
ModContext mc,
DWORD  d,
ulong  inf,
HitData hitdat 
) [inline]

Constructor.

The data members are initialized to the data passed.

                                                                                           {
        next = n;
        nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
    }               
CoreExport ~HitRecord ( )

Implemented by the System.



Destructor. If HitData has been allocated, it is deleted as well.


Member Function Documentation

HitRecord* Next ( ) [inline]

Implemented by the System.



Each HitRecord maintains a pointer to another HitRecord. This method returns the next hit record.

{ return next; }

Friends And Related Function Documentation

friend class HitLog [friend]

Member Data Documentation

DWORD distance
ulong hitInfo

HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord
HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord HitRecord