HTCObjectRotate
-
class
HTCObjectRotate HTCObjectRotateis a reference implementation of a timer client. It is the first of what we hope will be a long list of objects to make use of the centralized timer service in MVO provided by theHTManagerclass. It is not necessarily meant to do anything useful except serve as an example of how it is possible to do animation in the context of MVO without completelyInherits from:
HBaseOperator,HTClient
Methods
-
HTCObjectRotate::HTCObjectRotate(HBaseView *view, int DoRepeat = 0, int DoCapture = 1) constructor
-
HTCObjectRotate::HTCObjectRotate(HTCObjectRotate *mommy) constructor that accepts pointer to a parent
HTCObjectRotateobject
-
HTCObjectRotate::~HTCObjectRotate()
-
int
HTCObjectRotate::OnLButtonDown(HEventInfo &hevent) virtual
Overrides
HBaseOperator
-
bool
HTCObjectRotate::Tick(float request_time, float actual_time) virtual
Overrides
HTClient.
-
void
HTCObjectRotate::SetDeleteOnUnRegister() Makes
HTCObjectRotateclean up after itself, as opposed to having a delete call required after everything is finished
-
void
HTCObjectRotate::UnRegister() Kills the animation (and possibly deletes *this, depending on the status of m_delete_on_unregister, as described above).
-
bool
HTCObjectRotate::OnSignal(int signal) Handles signals delivered from other objects
-
void
HTCObjectRotate::RotateSegmentLocally(HC_KEY key, HPoint *axis, HPoint *centroid, float theta) private
Adds a modelling matrix to rotate the given segment about the given axis and centroid by an angle of theta
Parameters
-
bool
HTCObjectRotate::GetSelection(HEventInfo &hevent, HC_KEY *key) private
Given the screen location described as part of event, get the most relevant object in the HOOPS scene graph
Parameters
hevent: Reference to an
HEventInfoobjectkey: is the most relevant scene graph object. Returned to user
Returns
true if a relevant selection has been found
-
void
HTCObjectRotate::Animate(HC_KEY key) private
Initiates the Animation. If the object described is geometry and has siblings in its current segment, it will be moved into a subsegment into which it is safe to append modelling matrices. In all other cases, however, segment structure is not changed.
Parameters
key: the segment to animate
-
bool
HTCObjectRotate::SearchAndDestroyHTCOR(HC_KEY key) private
Detects if the given key is currently undergoing an
HTCObjectRotateanimation. If it is, the managing operator is UnRegistered (causing the animation to stop).Returns
true if a relevant animation was detected
-
static bool
HTCObjectRotate::signal_callback(int hevent, void *signal_data, void *user_data) private static
A static function that can be registered as a callback, with a void * suitable for dispatching to a particular object instance. Simply returns user_data->OnEvent
Parameters
hevent: the type of the event getting passed in.
user_data: a “this” pointer passed back through the callback so that we may find our way to the class instance whose callback has been hit.
Variables
-
int
HTCObjectRotate::m_state protected
intAn identifier to describe the current state of the animation. Legal values are HTCOR_Resting and HTCOR_Animating.
-
float
HTCObjectRotate::m_angle protected
floatThe current rotation angle
-
float
HTCObjectRotate::m_duration protected
floatThe length of the animation
-
float
HTCObjectRotate::m_start_time protected
floatThe time at which the animation started, as reported by HC_Show_Time
-
HC_KEY
HTCObjectRotate::m_key protected
HC_KEYThe object getting rotated. Can be geometry or segment.
-
HC_KEY
HTCObjectRotate::m_segkey protected
HC_KEYThe key of the object’s owner segment, into which modelling matrices are put (or possibly the same as m_key, if m_key itself refers to a segment)
-
HPoint
HTCObjectRotate::m_centroid protected
Centroid of segment to be rotated in object space
-
bool
HTCObjectRotate::m_delete_on_unregister protected
boolIf true, object will delete(this) upon UnRegister
-
bool
HTCObjectRotate::m_original_matrix_valid protected
boolIf true, m_segkey contained a modelling matrix at the start that needs preserving
-
float
HTCObjectRotate::m_original_matrix[16] protected
floatThe original modelling matrix in the m_segkey segment, if applicable. Left uninitialized if !m_original_matrix_valid
-
int
HTCObjectRotate::m_cookie protected
intThe key that needs to be passed to HBaseView::UnSetEventNotify()