DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Collapse DG Kernel ControlsDG Kernel Controls
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Go to DGKC docs Search Documentation


IViewModal Interface

SetViewMode
GetViewMode
SetCurrentFrame
GetCurrentFrame
SetAutoMode
GetAutoMode
ResetAutoMode

IViewModal interface allows switching between two "View" and "Modify" modes of the view, which implements this interface. See Modes topic for more details. Modes are different with respect to how user mouse moves are processed. "View" is the default mode. In View mode mouse moves allow changing point of view by Pan/Zoom/Rotate viewing transformations. In "Modify"  mode mouse moves change position or orientation of the current object in the model. In modify mode, similar to viewing transformations, mouse moves with Shift key down will perform translations of the object. If Shift key is not down rotations of the object will be performed. IViewModal can be queried from IView interface.

See also Modal sample, Interface List


HRESULT SetViewMode( int nMode )

Parameters

nMode  - [in] new mode type. Valid modes are 1 and 2. if nMode = 1 the current mode will be set to "View". if nMode = 2 the current mode will be set to "Modify". See remarks below.

Returns

S_OK in case of success.

DISP_E_PARAMNOTOPTIONAL - when nMode is not one of valid values 1 or 2.

Remarks:

This method allows switching between two available modes. Modes are different with respect to how user mouse moves are processed. "View" is the default mode. In View mode mouse moves allow changing point of view by Pan/Zoom/Rotate viewing transformations. In "Modify"  mode mouse moves change position or orientation of the  current object in the model. In modify mode, similar to viewing transformations, mouse moves with Shift key down will perform translations of the object. If Shift key is not down rotations of the object will be performed. 

For C++ code file DInsight\Samples\VC\Include\DIInterface.h contains definitions for valid values of nMode. 

VB, .NET and similar IDEs can use cast of EDIMove enumeration type to refer to available modes symbolically.


HRESULT GetViewMode( int * pnMode )

Parameters

pnMode [out, retval] reference to an integer variable, which will receive the current mode of the view.

Remarks:
 
The method returns the current mode. See also  remarks for SetViewMode method.

HRESULT SetCurrentFrame( IFrame *pIFrame )

Parameters

pIFrame -  [in] reference to the frame, which will be set current for manipulations in "Modify" mode. See Remarks. pIFrame can be NULL (value zero). In this case the view will not have a current frame. See also IFrame interface

Return Values

DISP_E_PARAMNOTOPTIONAL - when pIFrame is not a frame obtained from  ISection of an object in the model.

Remarks:
 
The method allows setting which object (among all present in the model) will be set as current for modifications by mouse movements in "Modify" mode (See SetViewMode method.). pIFrame reference is normally obtained from the correspondent ISection interface by queering or coercing.
 

HRESULT GetCurrentFrame( IFrame **ppIFrame )

Parameters

ppIFrame [out, retval] reference to IFrame pointer, which  will receive the pointer to the current frame in the view. This variable will be set to NULL if there is no  current object in the model.

Remarks:
 
The method returns IFrame interface implemented by the current object.. The method will return NULL if there is no current object in the model.

HRESULT SetAutoMode(int mode)

Parameters

mode [in] The mode which will be set as auto. See remarks

Remarks:
Selects mode as auto mode. mode must be one of values described in SetViewMode above. Auto mode affects behaviour after manipulations of view with mouse clicks or strokes. The auto mode will be set automatically inside left mouse button up event handler. Mostly often mode should be set to "View". In that case when application sets the mode to "Modify", the "View" mode will be reset automatically after the user selected or moved an object with the mouse.

HRESULT GetAutoMode(int* mode)

Parameters

mode [out, retval] The mode currently selected as auto mode


HRESULT ResetAutoMode()

Remarks:
 
Removes auto mode selection. After that call the current mode will be changed only on SetViewMode unless SetAutoMode is called again