IGLib
1.7.2
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. 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 |
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;
|
inline |
|
inline |
|
inline |
Intializes the VTK interactor mode.
|
inline |
Raises the LoadVtkGraphics event.
|
inlineprotectedvirtual |
Replaces the dummy control (which can be manipulated by the Windows Forms Designer) by the VTK renderer control of type Kitware.VTK.RenderWindowControl.
|
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.
control | VTK control where graphics is added. |
|
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.
control | VTK 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().
|
inlinestatic |
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); };
References IG.Gr3d.VtkSurfacePlot.Create(), IG.Gr3d.VtkSurfacePlotBase.LineColorIsScaled, IG.Gr3d.VtkSurfacePlotBase.LinesVisible, IG.Gr3d.VtkSurfacePlotBase.LineWidth, IG.Gr3d.VtkContourPlot.NumContours, IG.Gr3d.VtkSurfacePlot.NumX, IG.Gr3d.VtkSurfacePlot.NumY, IG.Gr3d.VtkPlotBase.OutputLevel, IG.Gr3d.VtkSurfacePlotBase.PointSize, IG.Gr3d.VtkSurfacePlotBase.PointsVisible, IG.Gr3d.VtkSurfacePlot.SetBoundsParameters(), IG.Gr3d.VtkSurfacePlot.SetSurfaceDefinition(), IG.Gr3d.VtkPlotter.ShowPlotWithoutRender(), IG.Gr3d.VtkSurfacePlotBase.SurfaceColor, IG.Gr3d.VtkSurfacePlotBase.SurfaceColorIsScaled, IG.Gr3d.VtkSurfacePlotBase.SurfaceColorOpacity, IG.Gr3d.VtkSurfacePlotBase.SurfacesVisible, and IG.Gr3d.VtkControlBase.VtkRenderWindow.
|
inlineprivate |
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).
References IG.Gr3d.VtkCurvePlot.Create(), IG.Lib.ColorScaleBase.CreateBlueYellow(), IG.Lib.ColorScaleBase.CreateRainbow(), IG.Gr3d.VtkSurfacePlotBase.LineColor, IG.Gr3d.VtkSurfacePlotBase.LineColorIsScaled, IG.Gr3d.VtkSurfacePlotBase.LineColorScale, IG.Gr3d.VtkSurfacePlotBase.LinesVisible, IG.Gr3d.VtkSurfacePlotBase.LineWidth, IG.Gr3d.VtkCurvePlot.NumX, IG.Gr3d.VtkPlotBase.OutputLevel, IG.Gr3d.VtkSurfacePlotBase.PointColor, IG.Gr3d.VtkSurfacePlotBase.PointColorIsScaled, IG.Gr3d.VtkSurfacePlotBase.PointColorScale, IG.Gr3d.VtkSurfacePlotBase.PointSize, IG.Gr3d.VtkSurfacePlotBase.PointsVisible, IG.Gr3d.VtkCurvePlot.SetBoundsReference(), IG.Gr3d.VtkCurvePlot.SetCurveDefinition(), and IG.Gr3d.VtkPlotter.ShowPlotWithoutRender().
|
inlineprotectedvirtual |
Event handler that is executed when the VTK control is loaded.
|
inline |
|
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.
|
inline |
Rotates the camera in the fi direction.
angleStepDegrees | Step, in degrees, by which the camera is rotated clockwise. |
Implements IG.Gr3d.I3dGraphicsControl.
References IG.Num.vec3.y.
|
inline |
Rotates the camera in the theta direction.
angleStepDegrees | Step, in degrees, by which the camera is rotated. |
Implements IG.Gr3d.I3dGraphicsControl.
References IG.Num.vec3.z.
|
inline |
Rotates the camera around the viewing direction.
angleStepDegrees | Step, in degrees, by which the camera is rotated. |
Implements IG.Gr3d.I3dGraphicsControl.
|
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
keys | Specification of keys that are sent. |
References IG.Forms.UtilForms.GenerateKeyPress().
|
inline |
Resets the camera in such a way that actors are centered in the visual field and all actors are visible.
|
inlineprivate |
Handler for the Load event for the whole VtkControlBase form.
|
inlineprotected |
Clean up any resources being used.
disposing | true if managed resources should be disposed; otherwise, false. |
|
inlineprivate |
Required method for Designer support - do not modify the contents of this method with the code editor.
|
static |
Referenced by IG.Gr3d.VtkFormsExamples.Plot3dFunctionVtkControl().
|
private |
|
static |
Referenced by IG.Gr3d.VtkFormsExamples.Plot3dFunctionVtkControl().
|
private |
|
static |
Referenced by IG.Gr3d.VtkFormsExamples.Plot3dFunctionVtkControl().
|
private |
bool IG.Gr3d.VtkControlBase._isVtkInitialized = false |
|
protected |
Angle step, in degrees, that is used in a single rotation operation.
Must be greater than 0.
|
protected |
Zoom step, in degrees, that is used in a single zoom operation.
Must be greater than 1.
|
protected |
|
protected |
|
protected |
const double IG.Gr3d.VtkControlBase.smallNumber = 1.0e-8 |
|
protected |
|
private |
|
protected |
|
protected |
|
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" |
|
private |
|
private |
|
private |
|
private |
|
private |
Required designer variable.
|
private |
|
private |
|
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
|
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
|
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
|
getprotected set |
Whether the VTK window is initialized and ready to show graphics and accept commands.
|
get |
Base windows forms control through which the basic VTK functionality and all additional features can be accessed.
Referenced by IG.Gr3d.VtkPlotter.ShowFormContainerInThread().
|
getset |
|
getset |
|
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.
|
getset |
Gets or sets camera direction in spherical coordinates.
|
getprotected set |
Gets the VTK's rendering control that shows the VTK graphics on the form.
Referenced by IG.Gr3d.VtkPlotter.ShowFormContainerInThread().
|
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().
|
getset |
Gets the VTK camera that defines the viewing position, direction, zoom, etc.
|
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().
|
getset |
Viewing angle of the camera, in degrees (defines the zoom level).
angleStepDegrees | Step, in degrees, by which the camera is rotated. |
|
getset |
Roll of the camera (amount of rotation abount viewing direction)
|
getset |
Gets or sets camera position.
|
getset |
Gets or sets camera focal point.
|
getset |
Gets or sets the camera viewing up position.
|
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).
|
getset |
Flag indicating whether the VTK window interactor is in trackball mode.
Bound to IsJoystickMode as its logical complement.
|
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).
|
getset |
Flag indicating whether the embedded VTK control is in actors mode.
Bound to IsCameraMode as its logical complement.
|
getset |
|
getset |
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().