The HOpObjectTranslate class translates a selected object.
More...
#include <HOpObjectTranslate.h>
The HOpObjectTranslate class translates a selected object.
HOpObjectTranslates implements three of the mouse event handlers defined on the base class and maps the event information to HOOPS routines which translates the currently selected objects. This provides the basic functionality for applying a translation transform to an object (as opposed to a global panning of the camera which affects the entire scene). The operation consists of the following steps:
-
Left Button Down: The operation is initiated and an object is selected.
-
Left Button Down and Drag: The object is translated using spriting.
-
Left Button Up: The translation is finalized and the operation ends.
More Detailed Description: see event methods.
◆ HOpObjectTranslate()
HOpObjectTranslate::HOpObjectTranslate |
( |
HBaseView * |
view, |
|
|
int |
DoRepeat = 0 , |
|
|
int |
DoCapture = 1 |
|
) |
| |
Constructs an HOpObjectTranslate object.
- Parameters
-
view | A pointer to an HBaseView object, |
DoRepeat | An integer denoting whether this is a repeatable operator. This parameter has been deprecated. |
DoCapture | An integer denoting whether the mouse state should be captured, which means that all mouse events should be received after a mousedown, even if it leaves the window. This parameter has been deprecated. |
◆ Cleanup()
void HOpObjectTranslate::Cleanup |
( |
| ) |
|
|
protected |
This method cleans up the selected entities and turns off spriting if appropriate.
◆ Clone()
◆ GetMatrix()
int HOpObjectTranslate::GetMatrix |
( |
HEventInfo & |
hevent, |
|
|
int |
key_count, |
|
|
HC_KEY const * |
full_path_keys, |
|
|
float |
matrix_out[] |
|
) |
| |
|
protected |
For internal use only. This method does the computation work to compose a translation matrix that makes objects follow the mouse pointer. It copies the matrix contents into matrix_out so that they may be applied to arbitrary targets. It takes key as an argument because the required transformation can depend on segments' pre-existing modelling matrices. Currently, it assumes that the input key is a segment.
- Parameters
-
hevent | An HEventInfo object containing information about the current event. |
key_count | The number of keys in the full segment path. |
full_path_keys | The keys of each segment in the full segment path. |
matrix_out | A pointer to an array of 16 floats. Called by reference, returned to user. |
- Returns
- An integer value indicating success or failure.
◆ GetName()
virtual const char* HOpObjectTranslate::GetName |
( |
| ) |
|
|
virtual |
◆ Init()
void HOpObjectTranslate::Init |
( |
| ) |
|
|
protected |
This method initializes the selected entities and turns on spriting.
◆ OnLButtonDblClk()
virtual int HOpObjectTranslate::OnLButtonDblClk |
( |
HEventInfo & |
hevent | ) |
|
|
virtual |
OnLButtonDblClk translates the object back to its original location.
- Parameters
-
hevent | An HEventInfo object containing information about the current event. |
- Returns
- An HOperatorReturn indicating the status of the event.
Reimplemented from HBaseOperator.
◆ OnLButtonDown()
virtual int HOpObjectTranslate::OnLButtonDown |
( |
HEventInfo & |
hevent | ) |
|
|
virtual |
◆ OnLButtonDownAndMove()
virtual int HOpObjectTranslate::OnLButtonDownAndMove |
( |
HEventInfo & |
hevent | ) |
|
|
virtual |
OnLButtonDownAndMove computes the translation transform based on the distance between the first and current pointer positions, and translates the object accordingly.
- Parameters
-
hevent | An HEventInfo object containing information about the current event. |
- Returns
- An HOperatorReturn indicating the status of the event.
Reimplemented from HBaseOperator.
Reimplemented in HOpObjectClash.
◆ OnLButtonUp()
virtual int HOpObjectTranslate::OnLButtonUp |
( |
HEventInfo & |
hevent | ) |
|
|
virtual |
◆ UpdateKeyList()
virtual void HOpObjectTranslate::UpdateKeyList |
( |
void * |
data | ) |
|
|
virtual |
This method is used to update the list of keys to translate when the selection list changes.
Reimplemented in HOpObjectClash.
◆ UpdateMousePos()
int HOpObjectTranslate::UpdateMousePos |
( |
HEventInfo & |
hevent | ) |
|
|
protected |
For internal use only. This method updates the internal state needed for matrix calculations.
- Parameters
-
hevent | An HEventInfo object containing information about the current event. |
- Returns
- An integer value indicating success or failure.
◆ m_bInitialMatrix
bool HOpObjectTranslate::m_bInitialMatrix |
|
protected |
The initial modelling matrix.
◆ m_bTemporarySelection
bool HOpObjectTranslate::m_bTemporarySelection |
|
protected |
This boolean indicates whether object was temporarily selected.
◆ m_KeyList
HKeyList* HOpObjectTranslate::m_KeyList |
|
protected |
A List of keys to translate (copied from selection set).
◆ m_ptRecent
HPoint HOpObjectTranslate::m_ptRecent |
A pointer to the current position in world coordinates.
◆ m_ptRecentVP
HPoint HOpObjectTranslate::m_ptRecentVP |
A pointer to the current position in viewpoint (screen) coordinates.
The documentation for this class was generated from the following file: