KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > Viewing Interfaces > IViewModal
IViewModal Interface

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.

Note that this is a Pro level interface, which is not available in the standard KernelCAD or KernelCAD .NET.

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 symbolicaly.


HRESULT GetViewMode( int * pnMode )

Parameters

pnMode [out, retval] rreference 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 behaiviour after manipulations of view with mouse clicks or strokes. The auto mode will be set automaticaly 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