HitRecord Class Reference

#include <object.h>

Class Description

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

See also
Class HitLog, Class HitData
+ Inheritance diagram for HitRecord:

Public Member Functions

 HitRecord ()
 Default Constructor. More...
 
 HitRecord (INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat)
 Constructor. More...
 
 HitRecord (HitRecord *n, INode *nr, ModContext *mc, DWORD d, ulong inf, HitData *hitdat)
 Constructor. More...
 
HitRecordNext ()
 Each HitRecord maintains a pointer to another HitRecord. More...
 
CoreExport ~HitRecord ()
 Destructor. More...
 

Public Attributes

INodenodeRef
 Points to the node that was hit. More...
 
ModContextmodContext
 Points to the ModContext of the modifier. More...
 
DWORD distance
 The 'distance' of the hit. More...
 
ulong hitInfo
 A general unsigned long value. More...
 
HitDatahitData
 In case 4 bytes in hitInfo is not enough space to identity the sub-object element, this pointer is available. More...
 

Friends

class HitLog
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

HitRecord ( )
inline

Default Constructor.

Initializes all members to NULL.

5844 : nodeRef(NULL) { next = NULL; modContext = NULL; distance = 0; hitInfo = 0; hitData = NULL;}
INode * nodeRef
Points to the node that was hit.
Definition: object.h:5821
ModContext * modContext
Points to the ModContext of the modifier.
Definition: object.h:5823
#define NULL
Definition: autoptr.h:18
DWORD distance
The 'distance' of the hit.
Definition: object.h:5832
ulong hitInfo
A general unsigned long value.
Definition: object.h:5836
HitData * hitData
In case 4 bytes in hitInfo is not enough space to identity the sub-object element, this pointer is available.
Definition: object.h:5842
HitRecord ( INode nr,
ModContext mc,
DWORD  d,
ulong  inf,
HitData hitdat 
)
inline

Constructor.

The data members are initialized to the data passed.

5846  {
5847  next = NULL;
5848  nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
5849  }
INode * nodeRef
Points to the node that was hit.
Definition: object.h:5821
ModContext * modContext
Points to the ModContext of the modifier.
Definition: object.h:5823
#define NULL
Definition: autoptr.h:18
DWORD distance
The 'distance' of the hit.
Definition: object.h:5832
ulong hitInfo
A general unsigned long value.
Definition: object.h:5836
HitData * hitData
In case 4 bytes in hitInfo is not enough space to identity the sub-object element, this pointer is available.
Definition: object.h:5842
HitRecord ( HitRecord n,
INode nr,
ModContext mc,
DWORD  d,
ulong  inf,
HitData hitdat 
)
inline

Constructor.

The data members are initialized to the data passed.

5851  {
5852  next = n;
5853  nodeRef = nr; modContext = mc; distance = d; hitInfo = inf; hitData = hitdat;
5854  }
INode * nodeRef
Points to the node that was hit.
Definition: object.h:5821
ModContext * modContext
Points to the ModContext of the modifier.
Definition: object.h:5823
DWORD distance
The 'distance' of the hit.
Definition: object.h:5832
ulong hitInfo
A general unsigned long value.
Definition: object.h:5836
HitData * hitData
In case 4 bytes in hitInfo is not enough space to identity the sub-object element, this pointer is available.
Definition: object.h:5842

Destructor.

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

Member Function Documentation

HitRecord* Next ( )
inline

Each HitRecord maintains a pointer to another HitRecord.

This method returns the next hit record.

5857 { return next; }

Friends And Related Function Documentation

friend class HitLog
friend

Member Data Documentation

INode* nodeRef

Points to 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 wire frame 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 in hitInfo 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 by the system.