AfrSelection Interface CATI3DCompass

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATI3DCompass

Interface to access and manipulate the compass through software coding.

Role: The compass object implements the CATI3DCompass interface. To retrieve a pointer to the compass object that implements CATI3DCompass use method.


Method Index


o GetAutoSnapState(int*)
Retrieves the compass auto snap state.
o GetBeginDragPreviewEvent(CATCallbackEvent*)
Retrieves the event emitted when compass starts being moved to another location.
o GetBeginMoveEvent(CATCallbackEvent*)
Retrieves the event emitted when user start dragging the compass.
o GetCorner(int*)
Retreives the position of compass in the viewer.
o GetCurrentTransformation(CATMathTransformation**)
Retrieves the current compass transformation.
o GetDragPreviewEvent(CATCallbackEvent*)
Retrieves the event emitted when compass is being moved to another location.
o GetDragPreviewPosition(CATPathElement**,CATMathAxis**)
Retreive compass preview informations.
o GetEndDragPreviewEvent(CATCallbackEvent*)
Retrieves the event emitted when compass ends being moved to another location.
o GetEndMoveEvent(CATCallbackEvent*)
Retrieves the event emitted when user finish dragging the compass.
o GetEventPublisher(CATBaseUnknown**)
Retreives the compass event publisher.
o GetMoveEvent(CATCallbackEvent*)
Retrieves the event emitted when user is dragging the compass.
o GetPosition(CATMathAxis*)
Retreive the position and orientation of the compass.
o GetPrivilegedPlane(int*)
Retreives the privileged plane definition.
o GetPrivilegedPlaneModifiedEvent(CATCallbackEvent*)
Retreives the privileged plane modification event.
o GetScaleFactor(float*)
Retreives the current scale factor.
o GetState(CATCompassState*)
Retrieve the state of the compass.
o GetVisibility(int*)
Retrieve the compass visibility.
o Hide()
Hides the compass from the screen.
o SetAutoSnapState(int*)
Sets the auto snap state of the compass.
o SetCorner(int*)
o SetDefaultPosition()
Defines the default position of compass in the viewer.
o SetLook(CATCompassLook*)
Look management.
o SetPosition(CATMathAxis*)
Sets the position and orientation of the compass.
o SetPrivilegedPlane(int*)
Sets the privileged plane definition.
o SetScaleFactor(float*)
Sets the current scale factor.
o SetState(CATCompassState*)
Sets the state of the compass.
o Show()
Shows the compass on the screen.

Methods


o GetAutoSnapState
public virtual GetAutoSnapState( oEnabled)
Retrieves the compass auto snap state.
Parameters:
oEnabled
Parameter is set to TRUE if compass is in auto snap mode, FALSE otherwise
Returns:
S_OK if operation is successful
o GetBeginDragPreviewEvent
public virtual GetBeginDragPreviewEvent( oBeginDragPreviewEvent)
Retrieves the event emitted when compass starts being moved to another location.
Role: This event is emitted at the first mouse interaction when user is moving the compass to another location by dragging its center. This event is not emitted when select command is running.
Parameters:
oBeginDragPreviewEvent
A pointer to the published event. See
Returns:
S_OK if operation is successful
o GetBeginMoveEvent
public virtual GetBeginMoveEvent( oBeginMoveEvent)
Retrieves the event emitted when user start dragging the compass.
Role: This event is emitted at the first mouse interaction after clicking one of the compass handle. Subscribe to this event to react on compass start of manipulation by the user. This event is not emitted when select command is running.
Parameters:
oBeginMoveEvent
A pointer to the published event. See
Returns:
S_OK if operation is successful
o GetCorner
public virtual GetCorner( oCorner)
Retreives the position of compass in the viewer.
Parameters:
oCorner
The oCorner value is equal to either
1
if the position of compass is defined as Top-Left
2
if the position of compass is defined as Top-Right
3
if the position of compass is defined as Bottom-Left
4
if the position of compass is defined as Bottom-Right
Returns:
S_OK if operation is successful
E_INVALIDARG if argument is NULL
E_FAIL if compass representation is destroyed or being destroyed
o GetCurrentTransformation
public virtual GetCurrentTransformation( oTransformation)
Retrieves the current compass transformation.
Role: This method should be called in the callback method of the BeginMove, Move or EndMove event to know the current transformation that is being applied to the compass. The current transformation is computed between the current position (when Move event is sent) and the initial position (when BeginMove event is sent). The returned value can be modified to override the standard behaviour of the compass, thus permitting to take into account an applicative displacement constraint.
Parameters:
oTransformation
The current compass transformation.
Returns:
S_OK if operation is successful
o GetDragPreviewEvent
public virtual GetDragPreviewEvent( oDragPreviewEvent)
Retrieves the event emitted when compass is being moved to another location.
Role: This event is emitted at the second and every following mouse interaction when user is moving the compass to another location by dragging its center. This event is not emitted when select command is running.
Parameters:
oDragPreviewEvent
A pointer to the published event. See
Returns:
S_OK if operation is successful
o GetDragPreviewPosition
public virtual GetDragPreviewPosition( oElementUnder,
oPreviewPosition)
Retreive compass preview informations.
Role: This method should be called in the callback method of the BeginDragPreview, DragPreview and EndDragPreview events to retrieve the current preview position of the compass and, if any, the current model object under the mouse. The preview position of the compass can be modified thus allowing application to implement such behaviour as compass snapping to the object that is under the mouse.
Parameters:
oElementUnder
A pointer to a
representing the model objects under the mouse
oPreviewPosition
A pointer to the current preview position
Returns:
S_OK if operation is successful
o GetEndDragPreviewEvent
public virtual GetEndDragPreviewEvent( oEndDragPreviewEvent)
Retrieves the event emitted when compass ends being moved to another location.
Role: This event is emitted when the mouse button is released after dragging the compass to another location by using its center.
Parameters:
oEndDragPreviewEvent
A pointer to the published event. See
Returns:
S_OK if operation is successful
o GetEndMoveEvent
public virtual GetEndMoveEvent( oEndMoveEvent)
Retrieves the event emitted when user finish dragging the compass.
Role: This event is emitted when the mouse button is released after dragging one of the compass handle. Subscribe to this event to react compass end of manipulation by the user. This event is not emitted when select command is running.
Parameters:
oBeginMoveEvent
A pointer to the published event. See
Returns:
S_OK if operation is successful
o GetEventPublisher
public virtual GetEventPublisher( oCompassEventPublisher)
Retreives the compass event publisher.
Parameters:
oCompassEventPublisher
The event publisher used by the compass to publish events. For usage of event publisher see
Returns:
S_OK if operation is successful
o GetMoveEvent
public virtual GetMoveEvent( oMoveEvent)
Retrieves the event emitted when user is dragging the compass.
Role: This event is emitted at the second and every following mouse interaction when user is dragging one of the compass handle. Subscribe to this event to react on compass direct manipulation by the user. This event is not emitted when select command is running.
Parameters:
oBeginMoveEvent
A pointer to the published event. See
Returns:
S_OK if operation is successful
o GetPosition
public virtual GetPosition( oAxis)
Retreive the position and orientation of the compass.
Parameters:
oAxis
The returned compass position and orientation in the absolute coordinates systems.
Returns:
S_OK if operation is successful
E_FAIL if compass representation is destroyed or being destroyed
o GetPrivilegedPlane
public virtual GetPrivilegedPlane( oPrivilegedPlane)
Retreives the privileged plane definition.
Parameters:
oPrivilegedPlane
The oPrivileged plane value is equal to either
1
if the privileged plane is defined as (X,Y) or (U,V)
2
if the privileged plane is defined as (Y,Z) or (V,W)
3
if the privileged plane is defined as (Z,X) or (W,U)

To get the privileged plane coordinates use the
method.
Returns:
S_OK if operation is successful
E_FAIL if compass representation is destroyed or being destroyed
o GetPrivilegedPlaneModifiedEvent
public virtual GetPrivilegedPlaneModifiedEvent( oPrivilegedPlaneModifiedEvent)
Retreives the privileged plane modification event.
Parameters:
oPrivilegedPlaneModifiedEvent
The oProvilegedPlaneModifiedEvent is emitted each time the privileged plane definition changes. This might happen through code or user interaction.
Returns:
S_OK if operation is successful
E_FAIL if compass representation is destroyed or being destroyed
o GetScaleFactor
public virtual GetScaleFactor( oScaleFactor)
Retreives the current scale factor.
Parameters:
oScaleFactor
The current scale factor.
Returns:
S_OK if operation is successful
E_INVALIDARG if argument is NULL
E_FAIL if compass representation is destroyed or being destroyed
o GetState
public virtual GetState( oCompassState)
Retrieve the state of the compass.
Parameters:
CompassState
The compass state can either be:
CatCompass
if the compass is docked on top right screen corner and manipulates viewpoint.
CatGlider
if the compass is located in the 3D scene and manipulates objects.
Returns:
S_OK if operation is successful
E_FAIL if compass representation is destroyed or being destroyed
o GetVisibility
public virtual GetVisibility( oVisible)
Retrieve the compass visibility.
Parameters:
oVisible
Paremeter is set to TRUE if compass is visible, FALSE otherwise
Returns:
S_OK if operation is successful
E_FAIL if compass representation is destroyed or being destroyed
o Hide
public virtual Hide()
Hides the compass from the screen. S_OK if operation is successful
S_FALSE if compass was already hidden
E_FAIL if compass representation is destroyed or being destroyed
o SetAutoSnapState
public virtual SetAutoSnapState( iState)
Sets the auto snap state of the compass. Compass is automatically snapped onto the selected object while this mode is activated.
Parameters:
iState

Legal values It can be set to either :
TRUE
to activate the auto snap mode.
FALSE
to deactivate the auto snap mode.
Returns:
S_OK if operation is successful
o SetCorner
public virtual SetCorner( iCorner)
Deprecated:
R216 SetDefaultPosition All applications should have the same default corner Defines the position of compass in the viewer.
Parameters:
iCorner
The corner to set.
Legal values It can be set to either :
1
to define the position of compass as Top-Left
2
to define the position of compass as Top-Right
3
to define the position of compass as Bottom-Left
4
to define the position of compass as Bottom-Right
Returns:
S_OK if operation is successful
E_INVALIDARG if argument is NULL or pointing to an illegal value
E_FAIL if compass representation is destroyed or being destroyed
o SetDefaultPosition
public virtual SetDefaultPosition()
Defines the default position of compass in the viewer.
Returns:
S_OK if operation is successful
E_FAIL if compass representation is destroyed or being destroyed
o SetLook
public virtual SetLook( const iLook)
Look management.
Parameters:
iLook
iLook=CatNoManipulation : compass is not linked to any object.
iLook=CatObjectManipulation : compass is linked to one or more objects.
iLook=CatViewpointManipulation : compass is on top right screen.
iLook=CatStrainedManipulation : user is pressing the shift key.
Returns:
S_OK if operation is successful
o SetPosition
public virtual SetPosition( const iAxis)
Sets the position and orientation of the compass.
Parameters:
iAxis
New position and orientation of the compass in the absolute coordinates system. If compass is docked in the top right corner of the screen (i.e. GetState returns CatCompass), only the orientation is taken into acount and the
origin is ignored.
Returns:
S_OK if operation is successful
E_FAIL if compass representation is destroyed or being destroyed
o SetPrivilegedPlane
public virtual SetPrivilegedPlane( iPrivilegedPlane)
Sets the privileged plane definition.
Parameters:
iPrivilegedPlane
The privileged plane to set.
Legal values It can be set to either :
1
to define the privileged plane as (X,Y) or (U,V)
2
to define the privileged plane as (Y,Z) or (V,W)
3
to define the privileged plane as (Z,X) or (W,U)

To set the privileged plane coordinates use the
method.
Returns:
S_OK if operation is successful
E_INVALIDARG if argument is NULL or pointing to an illegal value
E_FAIL if compass representation is destroyed or being destroyed
o SetScaleFactor
public virtual SetScaleFactor( iScaleFactor)
Sets the current scale factor.
Parameters:
iScaleFactor
The scale factor to set.
Returns:
S_OK if operation is successful
E_INVALIDARG if argument is NULL or pointing to an illegal value
E_FAIL if compass representation is destroyed or being destroyed
o SetState
public virtual SetState( const iCompassState)
Sets the state of the compass.
Parameters:
iCompassState
The state to set.
Legal values It can be set to either :
CatCompass
to dock the compass on top right screen corner.
CatGlider
to position the compass in the 3D scene. Compass is positioned at the origin of the absolute axis system, while its orientation is kept.
Returns:
S_OK if operation is successful
E_FAIL if compass representation is destroyed or being destroyed
o Show
public virtual Show()
Shows the compass on the screen.
Returns:
S_OK if operation is successful
S_FALSE if compass was already visible
E_FAIL if compass representation is destroyed or being destroyed

This object is included in the file: CATI3DCompass.h
If needed, your Imakefile.mk should include the module: CATAfrSelection

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.