#include <HOpObjectClash.h>
Public Member Functions | |
virtual HBaseOperator * | Clone () |
virtual const char * | GetName () |
HOpObjectClash (HBaseView *view, int doRepeat=0, int doCapture=1) | |
virtual int | OnKeyDown (HEventInfo &hevent) |
virtual int | OnLButtonDown (HEventInfo &hevent) |
virtual int | OnLButtonDownAndMove (HEventInfo &hevent) |
virtual int | OnLButtonUp (HEventInfo &hevent) |
virtual void | UpdateKeyList (void *data) |
virtual | ~HOpObjectClash () |
The destructor restores the HBaseView's HSelectionSet to its state before this operator was initialized. | |
![]() | |
HOpObjectTranslate (HBaseView *view, int DoRepeat=0, int DoCapture=1) | |
virtual int | OnLButtonDblClk (HEventInfo &hevent) |
![]() | |
int | Capture () |
Returns whether we are currently in mouse capture mode. See this class' constructor for a more detailed description of what this means. This method has been deprecated. | |
HPoint const | GetFirstPoint () |
Returns the initial selection point. | |
HPoint const | GetNewPoint () |
Returns the current selection point. | |
HBaseView * | GetView () |
Returns a pointer to the view that this operator is associated with. | |
HBaseOperator (HBaseView *view, int DoRepeat=0, int DoCapture=1) | |
virtual int | OnKeyUp (HEventInfo &hevent) |
virtual int | OnLRButtonDownAndMove (HEventInfo &hevent) |
virtual int | OnMButtonDblClk (HEventInfo &hevent) |
virtual int | OnMButtonDown (HEventInfo &hevent) |
virtual int | OnMButtonDownAndMove (HEventInfo &hevent) |
virtual int | OnMButtonUp (HEventInfo &hevent) |
virtual int | OnMouseMove (HEventInfo &hevent) |
virtual int | OnMouseWheel (HEventInfo &hevent) |
virtual int | OnNoButtonDownAndMove (HEventInfo &hevent) |
virtual int | OnRButtonDblClk (HEventInfo &hevent) |
virtual int | OnRButtonDown (HEventInfo &hevent) |
virtual int | OnRButtonDownAndMove (HEventInfo &hevent) |
virtual int | OnRButtonUp (HEventInfo &hevent) |
virtual int | OnTimer (HEventInfo &hevent) |
virtual int | OnTouchesDown (HEventInfo &hevent) |
virtual int | OnTouchesMove (HEventInfo &hevent) |
virtual int | OnTouchesUp (HEventInfo &hevent) |
virtual bool | OperatorStarted () |
Operator has been started if true, and has not been started if false. | |
int | Repeat () |
Returns whether the operation is repeatable. This method has been deprecated. | |
void | SetFirstPoint (HPoint const &new_point) |
Sets the initial selection point. | |
void | SetMapTouchesToMouseEvents (bool val) |
Touch Events are mapped to mouse events if true, and are not if false. | |
void | SetNewPoint (HPoint const &new_point) |
Sets the current selection point. | |
void | SetOperatorStarted (bool val) |
Operator has been started if true, and has not been started if false. | |
void | SetView (HBaseView *new_view) |
Sets the view that this operator is associated with. | |
Protected Types | |
enum | HOOC_Result { HOOC_Unknown = -1, HOOC_In = 1, HOOC_Out = 2, HOOC_Clash = 3 } |
enum | HOOC_SelectMode { HOOC_World = 1, HOOC_Screen = 2, HOOC_Shell = 3, HOOC_Enclosure = 4 } |
Protected Member Functions | |
void | ClashDetect (HEventInfo &hevent) |
int | GetScreenVolume (HC_KEY seg, HPoint &min, HPoint &max) |
int | GetWorldVolume (HC_KEY seg, HPoint &min, HPoint &max) |
void | GrabSelectionSet () |
int | IntersectPolyline (HC_KEY key1, float *transformed_points1) |
void | ProcessSelectionResults (HC_KEY current_shell=HC_ERROR_KEY, float *transformed_points=0) |
void | RestoreSelectionSet () |
virtual int | SelectByEnclosure (HSmartSelItem *sel_item) |
virtual int | SelectByScreenVolume (HSmartSelItem *sel_item) |
virtual int | SelectByShell (HSmartSelItem *sel_item) |
virtual int | SelectByWorldVolume (HSmartSelItem *sel_item) |
void | SetSelectMode (int mode) |
int | TestEnclosure (HC_KEY current_shell_key, float *transformed_points) |
![]() | |
void | Cleanup () |
int | GetMatrix (HEventInfo &hevent, int key_count, HC_KEY const *full_path_keys, float *matrix_out) |
void | Init () |
int | UpdateMousePos (HEventInfo &hevent) |
![]() | |
bool | IsSpecialKey (HC_KEY key) |
Protected Attributes | |
int | m_IntersectPolylinesVisible |
HSelectionSet * | m_pClashSelection |
bool | m_save_spriting_mode |
int | m_SelectMode |
HC_KEY | m_TempSegKey |
![]() | |
bool | m_bInitialMatrix |
bool | m_bTemporarySelection |
HKeyList * | m_KeyList |
HPoint | m_ptLast |
![]() | |
bool | m_bMapTouchesToMouseEvents |
Indicates if touch events are mapped to mouse events. | |
bool | m_bOpStarted |
Indicates whether the operator has already 'started'. More... | |
int | m_doCapture |
Integer indicating whether to capture mouse on button down and release on button up. This parameter has been deprecated. | |
int | m_doRepeat |
Integer indicating if the operator is repeatable . This parameter has been deprecated. | |
HPoint | m_ptFirst |
Initial selection point. | |
HPoint | m_ptNew |
Current selection point. | |
HBaseView * | m_pView |
The HOOPS view corresponding to this operator. | |
HCutGeometryVisibility | m_TempCutGeometryVisibility |
stores original cut geometry visibility | |
HShadowMode | m_TempShadowMode |
stores original shadow mode | |
Additional Inherited Members | |
![]() | |
HPoint | m_ptRecent |
HPoint | m_ptRecentVP |
The HOpObjectClash class detects and highlights objects that intersect a set of translated objects. The set of objects to be translated, a.k.a. "the part", is assumed to be selected at the segment level prior to activating this operator. The computation can be done in several ways as described in HOOC_SelectMode but the most important mode that this operator demonstrates is HOOC_Shell. In that mode, shells from the scene, a.k.a "the environment", are selected and highlighted if their faces cross the part's faces.
This operator currently makes the (sometimes false) assumption that shells in the part are affected only by modelling matrices in their ancestry, as opposed to via some include path.
HOpObjectClash employs the transform functionality of HOpObjectTranslate to move an object around a scene, and extends two of the mouse event handlers defined on HOpObjectTranslate to perform clash detection. The operation consists of the following steps:
More Detailed Description: see event methods.
|
protected |
HOOC_Result is the result code for the object clash calculation.
|
protected |
The selection can be computed in several different ways.
Enumerator | |
---|---|
HOOC_World |
This selection mode computes the selection in world coordinates prior to the camera transformation and then looks for bounding box intersections. Use this mode for speed. |
HOOC_Screen |
This selection mode computes the selection in screen coordinates and looks for bounding box intersections. |
HOOC_Shell |
This selection mode looks for shells that intersect the faces of the current selection set in HBaseView. This is the default mode and is most accurate. |
HOOC_Enclosure |
This selection mode detects if the selection is completely enclosed by the translated object. |
HOpObjectClash::HOpObjectClash | ( | HBaseView * | view, |
int | doRepeat = 0 , |
||
int | doCapture = 1 |
||
) |
Constructs an HOpObjectClash object.
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. |
|
protected |
This method performs a translation on the selected objects and then highlights objects that intersected with them.
hevent | An HEventInfo object containing information about the current event. |
|
virtual |
Creates a new operator which is a copy of the current operator. The user is responsible for deleting the newly created operator.
Reimplemented from HOpObjectTranslate.
|
virtual |
Reimplemented from HOpObjectTranslate.
This method gets the screen space volume of the given segment, as seen by driver in the current view.
seg | The key of segment in which you want to compute the bounding box. |
min | Returns the minimum point of the bounding box volume. |
max | Returns the maximum point of the bounding box volume. |
This method gets the world space volume of the given segment. This is a helper function to SelectByWorldVolume.
seg | The key of segment in which you want to compute the bounding box. |
min | Returns the minimum point of the bounding box volume. |
max | Returns the maximum point of the bounding box volume. |
|
protected |
This method temporary "steals" the selection set from the HBaseView and replaces it with a new empty one.
|
protected |
This method computes the polyline of intersection between two shells.
key1 | The key of the shell to find intersection with the selection shell. |
transformed_points1 | The point list of the shell. |
|
virtual |
This method grabs the following hot keys and then passes the rest to HBaseOperator.
hevent | An HEventInfo object containing information about the current event. |
Reimplemented from HBaseOperator.
|
virtual |
OnLButtonDown records the first pointer position and initializes the translation mechanism. It then calls through to ClashDetect. It "steals" the view's selection set and sets it as a member variable so that the objects with which collisions are detected can be put there.
hevent | An HEventInfo object containing information about the current event. |
Reimplemented from HOpObjectTranslate.
|
virtual |
This method calls through to ClashDetect to do most of its work.
hevent | An HEventInfo object containing information about the current event. |
Reimplemented from HOpObjectTranslate.
|
virtual |
OnLButtonUp deselects the highlighted objects.
hevent | An HEventInfo object containing information about the current event. |
Reimplemented from HOpObjectTranslate.
|
protected |
This method loops through the selected object and all of the results from HC_Find_Related_Selection, and send them to the appropriate HSelectionSet.
current_shell | The key of the shell we want to highlight. |
transformed_points | The point list of the shell. |
|
protected |
This method restores the selection set back to the HBaseView.
|
protectedvirtual |
This method find if a given segment is fully enclosed by any other objects and then selects them. The selected items will be added to the current view's selection list and highlighted as usual.
seg | The key of the segment to select. |
|
protectedvirtual |
This method finds if a given segment in screen space clashes with any other objects in the scene and then selects them. The selected items will be added to the current view's selection list and highlighted as usual.
seg | The key of the segment to perform clash detection on. |
|
protectedvirtual |
This method finds if a given shell clashes with any other shells and selects them. After selection, the selection list will contain all shells in the model that intersect the faces of the shells in the segment given by "seg".
seg | The key of the segment to check for clashes with other shells. |
|
protectedvirtual |
This method finds if a given segment in world space clashes with any other object in the scene and then selects them. The selected items will be added to the current view's selection list and highlighted as usual.
seg | The key of the segment to select. |
|
protected |
This method sets the type of computing selection described in HOOC_SelectMode enum. HOOC_Shell is the default.
mode | The mode in which you would like to perform selection and clash detection. |
|
protected |
This is a helper function for ProcessSelectionResults(). It tests if the hit object encloses the shell.
current_shell_key | The key of the shell that we want to test if it is enclosed by another object. |
transformed_points | The point list of the shell. |
|
virtual |
This method is used to update the list of keys to translate when the selection list changes.
Reimplemented from HOpObjectTranslate.
|
protected |
A boolean to indicate whether or not to calculate the polylines of intersection between objects that we find clashing.
|
protected |
The set of objects being dragged around.
|
protected |
The spriting mode before this operator started up which is restored on deletion.
|
protected |
The type of computing selection described in HOOC_SelectMode enum. HOOC_Shell is the default.
|
protected |
The key to the segment into which the text overlay, with a transparent window, is put.