IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Gr3d.VtkControlBase Class Reference

Basic control encapsulating the VTK's render control of type Kitware.VTK.RenderWindowControl. More...

+ Inheritance diagram for IG.Gr3d.VtkControlBase:
+ Collaboration diagram for IG.Gr3d.VtkControlBase:

Public Member Functions

 VtkControlBase ()
 
void InitializeState ()
 
void InitializeVtkRendering ()
 Intializes the VTK interactor mode. More...
 
void OnLoadVtkGraphics (EventArgs e)
 Raises the LoadVtkGraphics event. More...
 
virtual void VtkOnRenderWindowControlLoad ()
 Adds test surface plots to the specified VTK control. More...
 
void RefreshGraph ()
 
void ChangeZoom (double factor)
 Changes CameraViewAngle by the factor defined by the specified factor. More...
 
void RotateAzimuth (double angleStepDegrees)
 Rotates the camera in the fi direction. More...
 
void RotatePitch (double angleStepDegrees)
 Rotates the camera in the theta direction. More...
 
void RotateRoll (double angleStepDegrees)
 Rotates the camera around the viewing direction. More...
 
void SendKeys (string keys)
 Sends the specified sequence of keyboard keys to the embedded VTK control. More...
 
void ResetCamera ()
 Resets the camera in such a way that actors are centered in the visual field and all actors are visible. More...
 

Static Public Member Functions

static void ExampleExternalLoadVtkGraphics_SurfacePlots (IVtkFormContainer vtkContainer)
 Adds test surface plots to the VTK control that is contained on the specified VTK container. More...
 
static void ExampleExternalLoadVtkGraphics_SurfacePlots (VtkControlBase control)
 Adds test surface plots to the specified VTK control. More...
 

Public Attributes

bool _isVtkInitialized = false
 
const double smallNumber = 1.0e-8
 
const string KeysResetCamera = "R"
 
const string KeysJoystickMode = "J"
 
const string KeysTrackballMode = "T"
 
const string KeysCameraMode = "C"
 
const string KeysActorsMode = "A"
 
const string KeysWireframeMode = "W"
 
const string KeysSurfaceMode = "S"
 

Static Public Attributes

static bool DefaultVtkAddTestActors = false
 
static string DefaultVtkTestText = null
 
static bool DefaultVtkAddTestActorsIGLib = false
 

Protected Member Functions

virtual void VtkReplaceControl ()
 Replaces the dummy control (which can be manipulated by the Windows Forms Designer) by the VTK renderer control of type Kitware.VTK.RenderWindowControl. More...
 
virtual void renderWindowControl1_Load (object sender, EventArgs e)
 Event handler that is executed when the VTK control is loaded. More...
 
override void Dispose (bool disposing)
 Clean up any resources being used. More...
 

Protected Attributes

double _rotationStep = 5.0
 Angle step, in degrees, that is used in a single rotation operation. More...
 
double _zoomStep = 1.2
 Zoom step, in degrees, that is used in a single zoom operation. More...
 
double _cameraViewAngle = 30
 
double _cameraRoll = 0
 
vec3 _cameraPosition = new vec3(0, 0, 1)
 
vec3 _cameraFocalPoint = new vec3(0, 0, 0)
 
vec3 _cameraViewUp = new vec3(0, 1, 0)
 
vec3 _cameraDirection = new vec3(1, 0, 0)
 
vec3 _cameraDirectionSpherical
 
bool _vtkReplacementAccomplished = false
 
vtkRenderer _vtkRenderer
 
vtkCamera _vtkCamera
 

Properties

bool VtkAddTestActors [get, set]
 Gets the flag indicated whether test actors are added to the VTK control. More...
 
string VtkTestText [get]
 Gets the eventual test text that is shown on the VTK control. More...
 
bool VtkAddTestActorsIGLib [get, set]
 Gets the flag indicated whether test actors created by IGLib plots are added to the VTK control. More...
 
bool IsVtkInitialized [get, protected set]
 Whether the VTK window is initialized and ready to show graphics and accept commands. More...
 
VtkControlBase VtkControl [get]
 Base windows forms control through which the basic VTK functionality and all additional features can be accessed. More...
 
double RotationStep [get, set]
 
double ZoomFactor [get, set]
 
vec3 CameraDirection [get, set]
 Camera direction. More...
 
vec3 CameraDirectionSpherical [get, set]
 Gets or sets camera direction in spherical coordinates. More...
 
Kitware.VTK.RenderWindowControl VtkRenderWindowControl [get, protected set]
 Gets the VTK's rendering control that shows the VTK graphics on the form. More...
 
vtkRenderer VtkRenderer [get, protected set]
 Gets the VTK renderer that renders 3D objects on the VTK's control VtkRenderWindowControl. More...
 
vtkCamera VtkCamera [get, set]
 Gets the VTK camera that defines the viewing position, direction, zoom, etc. More...
 
Kitware.VTK.vtkRenderWindow VtkRenderWindow [get, protected set]
 VTK render window of hte current control. More...
 
double CameraViewAngle [get, set]
 Viewing angle of the camera, in degrees (defines the zoom level). More...
 
double CameraRoll [get, set]
 Roll of the camera (amount of rotation abount viewing direction) More...
 
vec3 CameraPosition [get, set]
 Gets or sets camera position. More...
 
vec3 CameraFocalPoint [get, set]
 Gets or sets camera focal point. More...
 
vec3 CameraViewUp [get, set]
 Gets or sets the camera viewing up position. More...
 
virtual bool IsJoystickMode [get, set]
 Flag indicating whether the VTK window interactor is in joystick mode (i.e. constant rotation by holding the mouse button, as opposed to the trackball mode where rotation is caused by dragging). More...
 
bool IsTrackballMode [get, set]
 Flag indicating whether the VTK window interactor is in trackball mode. More...
 
virtual bool IsCameraMode [get, set]
 Flag indicating whether the embedded VTK control is in camera mode (i.e. the camera is moved, as opposed to the actors mode where rotation and movement are performed on actors). More...
 
virtual bool IsActorsMode [get, set]
 Flag indicating whether the embedded VTK control is in actors mode. More...
 
bool IsWireframeMode [get, set]
 
bool IsSurfaceMode [get, set]
 
- Properties inherited from IG.Gr3d.IVtkFormContainerGen< VtkControlType >
VtkControlBase VtkControl [get]
 Base windows forms control through which the basic VTK functionality and all additional features can be accessed. More...
 
VtkControlType VtkRenderWindowControl [get]
 VTK's control that is actually used for rendering graphics and through which VTK can be interacted directly. More...
 
- Properties inherited from IG.Gr3d.I3dGraphicsControl
double RotationStep [get, set]
 
double ZoomFactor [get, set]
 Zoom step, in degrees, that is used in a single zoom operation. More...
 
double CameraViewAngle [get, set]
 Viewing angle of the camera, in degrees (defines the zoom level). More...
 
double CameraRoll [get, set]
 Roll of the camera (amount of rotation abount viewing direction) More...
 
vec3 CameraPosition [get, set]
 Gets or sets camera position. More...
 
vec3 CameraFocalPoint [get, set]
 Gets or sets camera focal point. More...
 
vec3 CameraViewUp [get, set]
 Gets or sets the camera viewing up position. More...
 
vec3 CameraDirection [get, set]
 Camera direction. More...
 
vec3 CameraDirectionSpherical [get, set]
 Gets or sets camera direction in spherical coordinates. More...
 

Events

EventHandler LoadVtkGraphics
 Event that occurs when graphics must be loaded in Vtk control. More...
 

Private Member Functions

void VtkControlBase_LoadVtkGraphics (object sender, EventArgs e)
 Event handler that is called when VTK graphics is loaded. More...
 
void VtkControlBase_Load (object sender, EventArgs e)
 Handler for the Load event for the whole VtkControlBase form. More...
 
void InitializeComponent ()
 Required method for Designer support - do not modify the contents of this method with the code editor. More...
 

Private Attributes

bool _vtkAddTestActors = DefaultVtkAddTestActors
 
string _vtkTestText = DefaultVtkTestText
 
bool _vtkAddTestActorsIGLib = DefaultVtkAddTestActorsIGLib
 
Kitware.VTK.RenderWindowControl _renderWindowControl1
 
vtkRenderWindow _vtkRenderWindow
 
bool _isJoystickMode = true
 
bool _isCameraMode = true
 
bool _isWireframeMode = false
 
bool _isSurfaceMode = false
 
System.ComponentModel.IContainer components = null
 Required designer variable. More...
 
System.Windows.Forms.Panel vtkReplacementPanel
 
System.Windows.Forms.TextBox txtReplacementNotification
 

Detailed Description

Basic control encapsulating the VTK's render control of type Kitware.VTK.RenderWindowControl.

This control solves the problem that controls containing the VTK's render control (Kitware.VTK.RenderWindowControl) can not be shown in designer because ActiViz provides only 64 bit version while Visual Studio's designer requires that controls' implementations can be loaded on 32 bit environments (i.e. target platform can be either set to 32 bit or any platform).

$A Igor May13;

Constructor & Destructor Documentation

IG.Gr3d.VtkControlBase.VtkControlBase ( )
inline

Member Function Documentation

void IG.Gr3d.VtkControlBase.InitializeState ( )
inline
void IG.Gr3d.VtkControlBase.InitializeVtkRendering ( )
inline

Intializes the VTK interactor mode.

void IG.Gr3d.VtkControlBase.OnLoadVtkGraphics ( EventArgs  e)
inline

Raises the LoadVtkGraphics event.

virtual void IG.Gr3d.VtkControlBase.VtkReplaceControl ( )
inlineprotectedvirtual

Replaces the dummy control (which can be manipulated by the Windows Forms Designer) by the VTK renderer control of type Kitware.VTK.RenderWindowControl.

virtual void IG.Gr3d.VtkControlBase.VtkOnRenderWindowControlLoad ( )
inlinevirtual

Adds test surface plots to the specified VTK control.

This method can be called within an external event handler that is added to the LoadVtkGraphics event.

Parameters
controlVTK control where graphics is added.
static void IG.Gr3d.VtkControlBase.ExampleExternalLoadVtkGraphics_SurfacePlots ( IVtkFormContainer  vtkContainer)
inlinestatic

Adds test surface plots to the VTK control that is contained on the specified VTK container.

This method can be called within an external event handler that is added to the LoadVtkGraphics event of the VTK control.

Parameters
controlVTK control where graphics is added.

This method just calls the ExampleExternalLoadVtkGraphics_SurfacePlots method with argument of type VtkControlBase

References IG.Gr3d.IVtkFormContainerGen< VtkControlType >.VtkControl.

Referenced by IG.Gr3d.VtkFormsExamples.Plot3dFunctionVtkControl().

static void IG.Gr3d.VtkControlBase.ExampleExternalLoadVtkGraphics_SurfacePlots ( VtkControlBase  control)
inlinestatic
void IG.Gr3d.VtkControlBase.VtkControlBase_LoadVtkGraphics ( object  sender,
EventArgs  e 
)
inlineprivate
virtual void IG.Gr3d.VtkControlBase.renderWindowControl1_Load ( object  sender,
EventArgs  e 
)
inlineprotectedvirtual

Event handler that is executed when the VTK control is loaded.

void IG.Gr3d.VtkControlBase.RefreshGraph ( )
inline
void IG.Gr3d.VtkControlBase.ChangeZoom ( double  factor)
inline

Changes CameraViewAngle by the factor defined by the specified factor.

Parameters
factorFactor by which the view angle is increased (must be greater than 1).

Implements IG.Gr3d.I3dGraphicsControl.

void IG.Gr3d.VtkControlBase.RotateAzimuth ( double  angleStepDegrees)
inline

Rotates the camera in the fi direction.

Parameters
angleStepDegreesStep, in degrees, by which the camera is rotated clockwise.

Implements IG.Gr3d.I3dGraphicsControl.

References IG.Num.vec3.y.

void IG.Gr3d.VtkControlBase.RotatePitch ( double  angleStepDegrees)
inline

Rotates the camera in the theta direction.

Parameters
angleStepDegreesStep, in degrees, by which the camera is rotated.

Implements IG.Gr3d.I3dGraphicsControl.

References IG.Num.vec3.z.

void IG.Gr3d.VtkControlBase.RotateRoll ( double  angleStepDegrees)
inline

Rotates the camera around the viewing direction.

Parameters
angleStepDegreesStep, in degrees, by which the camera is rotated.

Implements IG.Gr3d.I3dGraphicsControl.

void IG.Gr3d.VtkControlBase.SendKeys ( string  keys)
inline

Sends the specified sequence of keyboard keys to the embedded VTK control.

Meaning of keys: UtilForms.GenerateKeyPress

See also: http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx

Parameters
keysSpecification of keys that are sent.

References IG.Forms.UtilForms.GenerateKeyPress().

void IG.Gr3d.VtkControlBase.ResetCamera ( )
inline

Resets the camera in such a way that actors are centered in the visual field and all actors are visible.

void IG.Gr3d.VtkControlBase.VtkControlBase_Load ( object  sender,
EventArgs  e 
)
inlineprivate

Handler for the Load event for the whole VtkControlBase form.

override void IG.Gr3d.VtkControlBase.Dispose ( bool  disposing)
inlineprotected

Clean up any resources being used.

Parameters
disposingtrue if managed resources should be disposed; otherwise, false.
void IG.Gr3d.VtkControlBase.InitializeComponent ( )
inlineprivate

Required method for Designer support - do not modify the contents of this method with the code editor.

Member Data Documentation

bool IG.Gr3d.VtkControlBase.DefaultVtkAddTestActors = false
static
bool IG.Gr3d.VtkControlBase._vtkAddTestActors = DefaultVtkAddTestActors
private
string IG.Gr3d.VtkControlBase.DefaultVtkTestText = null
static
string IG.Gr3d.VtkControlBase._vtkTestText = DefaultVtkTestText
private
bool IG.Gr3d.VtkControlBase.DefaultVtkAddTestActorsIGLib = false
static
bool IG.Gr3d.VtkControlBase._vtkAddTestActorsIGLib = DefaultVtkAddTestActorsIGLib
private
bool IG.Gr3d.VtkControlBase._isVtkInitialized = false
double IG.Gr3d.VtkControlBase._rotationStep = 5.0
protected

Angle step, in degrees, that is used in a single rotation operation.

Must be greater than 0.

double IG.Gr3d.VtkControlBase._zoomStep = 1.2
protected

Zoom step, in degrees, that is used in a single zoom operation.

Must be greater than 1.

double IG.Gr3d.VtkControlBase._cameraViewAngle = 30
protected
double IG.Gr3d.VtkControlBase._cameraRoll = 0
protected
vec3 IG.Gr3d.VtkControlBase._cameraPosition = new vec3(0, 0, 1)
protected
vec3 IG.Gr3d.VtkControlBase._cameraFocalPoint = new vec3(0, 0, 0)
protected
vec3 IG.Gr3d.VtkControlBase._cameraViewUp = new vec3(0, 1, 0)
protected
vec3 IG.Gr3d.VtkControlBase._cameraDirection = new vec3(1, 0, 0)
protected
vec3 IG.Gr3d.VtkControlBase._cameraDirectionSpherical
protected
const double IG.Gr3d.VtkControlBase.smallNumber = 1.0e-8
bool IG.Gr3d.VtkControlBase._vtkReplacementAccomplished = false
protected
Kitware.VTK.RenderWindowControl IG.Gr3d.VtkControlBase._renderWindowControl1
private
vtkRenderer IG.Gr3d.VtkControlBase._vtkRenderer
protected
vtkCamera IG.Gr3d.VtkControlBase._vtkCamera
protected
vtkRenderWindow IG.Gr3d.VtkControlBase._vtkRenderWindow
private
const string IG.Gr3d.VtkControlBase.KeysResetCamera = "R"
const string IG.Gr3d.VtkControlBase.KeysJoystickMode = "J"
const string IG.Gr3d.VtkControlBase.KeysTrackballMode = "T"
const string IG.Gr3d.VtkControlBase.KeysCameraMode = "C"
const string IG.Gr3d.VtkControlBase.KeysActorsMode = "A"
const string IG.Gr3d.VtkControlBase.KeysWireframeMode = "W"
const string IG.Gr3d.VtkControlBase.KeysSurfaceMode = "S"
bool IG.Gr3d.VtkControlBase._isJoystickMode = true
private
bool IG.Gr3d.VtkControlBase._isCameraMode = true
private
bool IG.Gr3d.VtkControlBase._isWireframeMode = false
private
bool IG.Gr3d.VtkControlBase._isSurfaceMode = false
private
System.ComponentModel.IContainer IG.Gr3d.VtkControlBase.components = null
private

Required designer variable.

System.Windows.Forms.Panel IG.Gr3d.VtkControlBase.vtkReplacementPanel
private
System.Windows.Forms.TextBox IG.Gr3d.VtkControlBase.txtReplacementNotification
private

Property Documentation

bool IG.Gr3d.VtkControlBase.VtkAddTestActors
getset

Gets the flag indicated whether test actors are added to the VTK control.

Test actors are added for debugging purposes. If default value of the flag is true then all newly created controls of the current type will contain a pre-loaded test actors and it can be seen if the VTK renderer is properly installed on the control.

Default value is defined by the static property DefaultVtkAddTestActors

string IG.Gr3d.VtkControlBase.VtkTestText
getprotected

Gets the eventual test text that is shown on the VTK control.

Test text is added for debugging purposes. If default value is non-null then all newly created controls of the current type will contain a pre-loaded text through which it can be seen if the VTK renderer is properly installed on the controls.

Default value is defined by the static property DefaultVtkTestText

bool IG.Gr3d.VtkControlBase.VtkAddTestActorsIGLib
getset

Gets the flag indicated whether test actors created by IGLib plots are added to the VTK control.

Test actors are added for debugging purposes. If default value of the flag is true then all newly created controls of the current type will contain a pre-loaded test actors and it can be seen if the VTK renderer is properly installed on the control.

Default value is defined by the static property DefaultVtkAddTestActors

bool IG.Gr3d.VtkControlBase.IsVtkInitialized
getprotected set

Whether the VTK window is initialized and ready to show graphics and accept commands.

VtkControlBase IG.Gr3d.VtkControlBase.VtkControl
get

Base windows forms control through which the basic VTK functionality and all additional features can be accessed.

Referenced by IG.Gr3d.VtkPlotter.ShowFormContainerInThread().

double IG.Gr3d.VtkControlBase.RotationStep
getset
double IG.Gr3d.VtkControlBase.ZoomFactor
getset
vec3 IG.Gr3d.VtkControlBase.CameraDirection
getset

Camera direction.

Getter obtains it as difference between the camera focal point and camera position.

Setter sets the camera focal points in such a way that camera direction has the specified value.

vec3 IG.Gr3d.VtkControlBase.CameraDirectionSpherical
getset

Gets or sets camera direction in spherical coordinates.

Kitware.VTK.RenderWindowControl IG.Gr3d.VtkControlBase.VtkRenderWindowControl
getprotected set

Gets the VTK's rendering control that shows the VTK graphics on the form.

Referenced by IG.Gr3d.VtkPlotter.ShowFormContainerInThread().

vtkRenderer IG.Gr3d.VtkControlBase.VtkRenderer
getprotected set

Gets the VTK renderer that renders 3D objects on the VTK's control VtkRenderWindowControl.

Referenced by IG.Gr3d.VtkFormsExamples.Plot3dFunctionVtkControl(), and IG.Gr3d.VtkPlotter.ShowFormContainerInThread().

vtkCamera IG.Gr3d.VtkControlBase.VtkCamera
getset

Gets the VTK camera that defines the viewing position, direction, zoom, etc.

Kitware.VTK.vtkRenderWindow IG.Gr3d.VtkControlBase.VtkRenderWindow
getprotected set

VTK render window of hte current control.

Getter may return null if the window is not defined.

Referenced by IG.Gr3d.VtkControlBase.ExampleExternalLoadVtkGraphics_SurfacePlots(), IG.Gr3d.VtkFormsExamples.Plot3dFunctionVtkControl(), and IG.Gr3d.VtkPlotter.ShowFormContainerInThread().

double IG.Gr3d.VtkControlBase.CameraViewAngle
getset

Viewing angle of the camera, in degrees (defines the zoom level).

Parameters
angleStepDegreesStep, in degrees, by which the camera is rotated.
double IG.Gr3d.VtkControlBase.CameraRoll
getset

Roll of the camera (amount of rotation abount viewing direction)

vec3 IG.Gr3d.VtkControlBase.CameraPosition
getset

Gets or sets camera position.

vec3 IG.Gr3d.VtkControlBase.CameraFocalPoint
getset

Gets or sets camera focal point.

vec3 IG.Gr3d.VtkControlBase.CameraViewUp
getset

Gets or sets the camera viewing up position.

virtual bool IG.Gr3d.VtkControlBase.IsJoystickMode
getset

Flag indicating whether the VTK window interactor is in joystick mode (i.e. constant rotation by holding the mouse button, as opposed to the trackball mode where rotation is caused by dragging).

bool IG.Gr3d.VtkControlBase.IsTrackballMode
getset

Flag indicating whether the VTK window interactor is in trackball mode.

Bound to IsJoystickMode as its logical complement.

virtual bool IG.Gr3d.VtkControlBase.IsCameraMode
getset

Flag indicating whether the embedded VTK control is in camera mode (i.e. the camera is moved, as opposed to the actors mode where rotation and movement are performed on actors).

virtual bool IG.Gr3d.VtkControlBase.IsActorsMode
getset

Flag indicating whether the embedded VTK control is in actors mode.

Bound to IsCameraMode as its logical complement.

bool IG.Gr3d.VtkControlBase.IsWireframeMode
getset
bool IG.Gr3d.VtkControlBase.IsSurfaceMode
getset

Event Documentation

EventHandler IG.Gr3d.VtkControlBase.LoadVtkGraphics

Event that occurs when graphics must be loaded in Vtk control.

Referenced by IG.Gr3d.VtkFormsExamples.Plot3dFunctionVtkControl(), and IG.Gr3d.VtkPlotter.ShowFormContainerInThread().


The documentation for this class was generated from the following files: