IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
Basic control encapsulating the VTK's render control of type Kitware.VTK.RenderWindowControl. More...
Public Member Functions | |
VtkControlBase () | |
void | InitializeState () |
void | InitializeVtkRendering () |
Intializes the VTK interactor mode. | |
void | OnLoadVtkGraphics (EventArgs e) |
Raises the LoadVtkGraphics event. | |
virtual void | VtkOnRenderWindowControlLoad () |
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. | |
void | RefreshGraph () |
void | ChangeZoom (double factor) |
Changes CameraViewAngle by the factor defined by the specified factor. | |
void | RotateAzimuth (double angleStepDegrees) |
Rotates the camera in the fi direction. | |
void | RotatePitch (double angleStepDegrees) |
Rotates the camera in the theta direction. | |
void | RotateRoll (double angleStepDegrees) |
Rotates the camera around the viewing direction. | |
void | SendKeys (string keys) |
Sends the specified sequence of keyboard keys to the embedded VTK control. Meaning of keys: UtilForms.GenerateKeyPressSee also: http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx | |
void | ResetCamera () |
Resets the camera in such a way that actors are centered in the visual field and all actors are visible. | |
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. This method can be called within an external event handler that is added to the LoadVtkGraphics event of the VTK control. | |
static void | ExampleExternalLoadVtkGraphics_SurfacePlots (VtkControlBase control) |
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. | |
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. | |
virtual void | renderWindowControl1_Load (object sender, EventArgs e) |
Event handler that is executed when the VTK control is loaded. | |
override void | Dispose (bool disposing) |
Clean up any resources being used. | |
Protected Attributes | |
double | _rotationStep = 5.0 |
Angle step, in degrees, that is used in a single rotation operation. Must be greater than 0. | |
double | _zoomStep = 1.2 |
Zoom step, in degrees, that is used in a single zoom operation. Must be greater than 1. | |
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. 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 | VtkTestText [get] |
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 | VtkAddTestActorsIGLib [get, set] |
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 | IsVtkInitialized [get, set] |
Whether the VTK window is initialized and ready to show graphics and accept commands. | |
VtkControlBase | VtkControl [get] |
Base windows forms control through which the basic VTK functionality and all additional features can be accessed. | |
double | RotationStep [get, set] |
double | ZoomFactor [get, set] |
Zoom step, in degrees, that is used in a single zoom operation. Must be greater than 1. | |
vec3 | CameraDirection [get, set] |
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 | CameraDirectionSpherical [get, set] |
Gets or sets camera direction in spherical coordinates. | |
Kitware.VTK.RenderWindowControl | VtkRenderWindowControl [get, set] |
Gets the VTK's rendering control that shows the VTK graphics on the form. | |
vtkRenderer | VtkRenderer [get, set] |
Gets the VTK renderer that renders 3D objects on the VTK's control VtkRenderWindowControl. | |
vtkCamera | VtkCamera [get, set] |
Gets the VTK camera that defines the viewing position, direction, zoom, etc. | |
Kitware.VTK.vtkRenderWindow | VtkRenderWindow [get, set] |
VTK render window of hte current control. Getter may return null if the window is not defined. | |
double | CameraViewAngle [get, set] |
Viewing angle of the camera, in degrees (defines the zoom level). | |
double | CameraRoll [get, set] |
Roll of the camera (amount of rotation abount viewing direction) | |
vec3 | CameraPosition [get, set] |
Gets or sets camera position. | |
vec3 | CameraFocalPoint [get, set] |
Gets or sets camera focal point. | |
vec3 | CameraViewUp [get, set] |
Gets or sets the camera viewing up position. | |
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). | |
bool | IsTrackballMode [get, set] |
Flag indicating whether the VTK window interactor is in trackball mode. Bound to IsJoystickMode as its logical complement. | |
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). | |
virtual bool | IsActorsMode [get, set] |
Flag indicating whether the embedded VTK control is in actors mode. Bound to IsCameraMode as its logical complement. | |
bool | IsWireframeMode [get, set] |
bool | IsSurfaceMode [get, set] |
Events | |
EventHandler | LoadVtkGraphics |
Event that occurs when graphics must be loaded in Vtk control. | |
Private Member Functions | |
void | VtkControlBase_LoadVtkGraphics (object sender, EventArgs e) |
Event handler that is called when VTK graphics is loaded. This method actually executes loading of some test graphics in the case that the appropriate flags are set.Flag VtkAddTestActors specified whether some VTK test graphics is added (this is graphics from the VTK Hello World example).Flag VtkAddTestActorsIGLib specified whether some IGLib test graphics is added (a parametric curve in 3D). | |
void | VtkControlBase_Load (object sender, EventArgs e) |
Handler for the Load event for the whole VtkControlBase form. | |
void | InitializeComponent () |
Required method for Designer support - do not modify the contents of this method with the code editor. | |
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. | |
System.Windows.Forms.Panel | vtkReplacementPanel |
System.Windows.Forms.TextBox | txtReplacementNotification |
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;
IG::Gr3d::VtkControlBase::VtkControlBase | ( | ) | [inline] |
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 | ( | ) | [inline, protected, virtual] |
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 | ( | ) | [inline, virtual] |
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.
control | VTK control where graphics is added. |
static void IG::Gr3d::VtkControlBase::ExampleExternalLoadVtkGraphics_SurfacePlots | ( | IVtkFormContainer | vtkContainer | ) | [inline, static] |
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.
control | VTK control where graphics is added. |
This method just calls the ExampleExternalLoadVtkGraphics_SurfacePlots method with argument of type VtkControlBase
static void IG::Gr3d::VtkControlBase::ExampleExternalLoadVtkGraphics_SurfacePlots | ( | VtkControlBase | control | ) | [inline, static] |
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.
control | VTK control where graphics is added. |
IVtkFormContainer vtkFormContainer; vtkFormContainer.VtkControl.LoadVtkGraphics += (obj, eventArgs) => { VtkControlBase.ExampleExternalLoadVtkGraphics_SurfacePlots(vtkFormContainer); };
void IG::Gr3d::VtkControlBase::VtkControlBase_LoadVtkGraphics | ( | object | sender, |
EventArgs | e | ||
) | [inline, private] |
Event handler that is called when VTK graphics is loaded. This method actually executes loading of some test graphics in the case that the appropriate flags are set.Flag VtkAddTestActors specified whether some VTK test graphics is added (this is graphics from the VTK Hello World example).Flag VtkAddTestActorsIGLib specified whether some IGLib test graphics is added (a parametric curve in 3D).
virtual void IG::Gr3d::VtkControlBase::renderWindowControl1_Load | ( | object | sender, |
EventArgs | e | ||
) | [inline, protected, virtual] |
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.
factor | Factor 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.
angleStepDegrees | Step, in degrees, by which the camera is rotated clockwise. |
Implements IG::Gr3d::I3dGraphicsControl.
void IG::Gr3d::VtkControlBase::RotatePitch | ( | double | angleStepDegrees | ) | [inline] |
Rotates the camera in the theta direction.
angleStepDegrees | Step, in degrees, by which the camera is rotated. |
Implements IG::Gr3d::I3dGraphicsControl.
void IG::Gr3d::VtkControlBase::RotateRoll | ( | double | angleStepDegrees | ) | [inline] |
Rotates the camera around the viewing direction.
angleStepDegrees | Step, 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.GenerateKeyPressSee also: http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx
keys | Specification of keys that are sent. |
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 | ||
) | [inline, private] |
Handler for the Load event for the whole VtkControlBase form.
override void IG::Gr3d::VtkControlBase::Dispose | ( | bool | disposing | ) | [inline, protected] |
Clean up any resources being used.
disposing | true if managed resources should be disposed; otherwise, false. |
void IG::Gr3d::VtkControlBase::InitializeComponent | ( | ) | [inline, private] |
Required method for Designer support - do not modify the contents of this method with the code editor.
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::_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] |
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] |
bool IG::Gr3d::VtkControlBase::VtkAddTestActors [get, set] |
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 [get, protected] |
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 [get, set] |
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 [get, 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.
Implements IG::Gr3d::IVtkFormContainerGen< VtkControlType >.
double IG::Gr3d::VtkControlBase::RotationStep [get, set] |
Implements IG::Gr3d::I3dGraphicsControl.
double IG::Gr3d::VtkControlBase::ZoomFactor [get, set] |
Zoom step, in degrees, that is used in a single zoom operation. Must be greater than 1.
Implements IG::Gr3d::I3dGraphicsControl.
vec3 IG::Gr3d::VtkControlBase::CameraDirection [get, set] |
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.
Implements IG::Gr3d::I3dGraphicsControl.
vec3 IG::Gr3d::VtkControlBase::CameraDirectionSpherical [get, set] |
Gets or sets camera direction in spherical coordinates.
Implements IG::Gr3d::I3dGraphicsControl.
Kitware.VTK.RenderWindowControl IG::Gr3d::VtkControlBase::VtkRenderWindowControl [get, set] |
Gets the VTK's rendering control that shows the VTK graphics on the form.
Implements IG::Gr3d::IVtkFormContainerGen< VtkControlType >.
vtkRenderer IG::Gr3d::VtkControlBase::VtkRenderer [get, set] |
Gets the VTK renderer that renders 3D objects on the VTK's control VtkRenderWindowControl.
vtkCamera IG::Gr3d::VtkControlBase::VtkCamera [get, set] |
Gets the VTK camera that defines the viewing position, direction, zoom, etc.
Kitware.VTK.vtkRenderWindow IG::Gr3d::VtkControlBase::VtkRenderWindow [get, set] |
VTK render window of hte current control. Getter may return null if the window is not defined.
double IG::Gr3d::VtkControlBase::CameraViewAngle [get, set] |
Viewing angle of the camera, in degrees (defines the zoom level).
angleStepDegrees | Step, in degrees, by which the camera is rotated. |
Implements IG::Gr3d::I3dGraphicsControl.
double IG::Gr3d::VtkControlBase::CameraRoll [get, set] |
Roll of the camera (amount of rotation abount viewing direction)
Implements IG::Gr3d::I3dGraphicsControl.
vec3 IG::Gr3d::VtkControlBase::CameraPosition [get, set] |
Gets or sets camera position.
Implements IG::Gr3d::I3dGraphicsControl.
vec3 IG::Gr3d::VtkControlBase::CameraFocalPoint [get, set] |
Gets or sets camera focal point.
Implements IG::Gr3d::I3dGraphicsControl.
vec3 IG::Gr3d::VtkControlBase::CameraViewUp [get, set] |
Gets or sets the camera viewing up position.
Implements IG::Gr3d::I3dGraphicsControl.
virtual bool IG::Gr3d::VtkControlBase::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).
bool IG::Gr3d::VtkControlBase::IsTrackballMode [get, set] |
Flag indicating whether the VTK window interactor is in trackball mode. Bound to IsJoystickMode as its logical complement.
virtual bool IG::Gr3d::VtkControlBase::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).
virtual bool IG::Gr3d::VtkControlBase::IsActorsMode [get, set] |
Flag indicating whether the embedded VTK control is in actors mode. Bound to IsCameraMode as its logical complement.
bool IG::Gr3d::VtkControlBase::IsWireframeMode [get, set] |
bool IG::Gr3d::VtkControlBase::IsSurfaceMode [get, set] |
EventHandler IG::Gr3d::VtkControlBase::LoadVtkGraphics |
Event that occurs when graphics must be loaded in Vtk control.