If you are a developer who wants to integrate MineSet visualization tools into your ActiveX applications, this chapter provides helpful information. The topics discussed are as follows:
Eight ActiveX controls are included in the MineSet distribution. They are automatically registered on your system when you install MineSet. Once they are registered, you can browse them using the ActiveX test container in Microsoft Developer Studio.
The Component Object Model, or COM provides an efficient methodology for modular application development. You can build stand-alone components (servers). Users or clients of COM servers, can use pre-built functionality in server objects without intimate knowledge of the server object during development. Previously, you were required to link to a component's functionality at design time, or provide a path to the component in the source code. Instead, COM can now ask the registry for the object's location. This means that as long as the registry knows where to find the server object, your client application can use the object.
COM objects are implemented either within executables (EXEs) or Dynamic Link Libraries (DLLs). COM objects implemented in EXEs are called local servers, while those implemented in DLLs are called in-process servers. An in-process COM server exposes its functions so that outside applications can use the functionality of its DLL. The visualization controls described in this chapter are of the latter type.
The COM library uses a class identifier (a CLSID value) to uniquely identify each COM object. An application then uses this identifier to determine which object the application wants to use. For example, suppose you create and register a COM object that provides functionality similar to the Windows 95 tree-view control—showing, for example, a Web site hierarchy. Once you register this object, other applications can call the functions you expose in it.
Because ActiveX controls are COM objects, this control is provided as an ActiveX control (with appropriate documentation). You can integrate it into your applications using a development environment and call methods, and you can set properties on the control.
ActiveX controls have become the primary architecture for developing programmable software components for use in containers ranging from software development tools to end-user productivity tools. For a control to operate well in a variety of containers, it must be able to assume some minimum level of functionality that it can rely on in all containers. This minimum level of functionality is defined in the COM and ActiveX Control specifications, published by Microsoft Corporation. These guidelines have been rigorously followed so that MineSet visualization controls would be reliable and interoperable, and, and so that they would be better and more usable for building component-based solutions.
MineSet visualization controls consist of eight separate ActiveX controls implemented as in-process DLLs. As a developer of a client application that will incorporate the MineSet visualizations, the you only have to be concerned about the VizComposite control. The VizComposite control is an actual composite control that dynamically creates and manages the other seven ActiveX controls based on the visualization file being loaded. A client application only needs to create an instance of the VizComposite control, either during design or at run-time, in order to embed MineSet visualization capabilities within its application. Once instantiated, you can call methods and set or get property values from the control to alter its behavior and to access certain functionality.
You can develop your client application using MineSet visualization controls in any development environment, including Visual C++, Visual Basic, and Visual J++. While Windows 95, Windows 98, or Windows NT can be your development platform, SGI highly recommends developing on Windows NT 4.0 Workstation for any serious DCOM work. Using Windows NT, you can examine processes and shut down the system with somewhat more stability and ease than with Windows 95 or Windows 98.
If you are a novice at programming in COM, consider reading some entry-level books, such as:
Inside COM, by Dale Rogerson (Microsoft Press).
Understanding ActiveX and OLE, by David Chappell (Microsoft Press).
Some very good books on the details of COM and ActiveX/ATL include:
Essential COM, by Don Box (Addison Wesley).
Beginning ATL COM Programming, by Grimes and Stockton (Wrox Press).
Professional ATL COM Programming, by Richard Grimes (Wrox Press).
| Note: This document does not cover detailed semantics of the OLE interfaces; these are covered by the Microsoft Platform SDK documentation. |
The ActiveX control names are in the form of MineSet ControlName Control, (for example, MineSet VizComposite Control). The controls are:
VizComposite (the only one of interest to the application developer).
SyncServer (used for synchronizing visualizations).
VizAnimation (used for the animation panel).
VizLegend (used for the legend).
VizMain (contains the 3D viewer).
VizPane (auxiliary viewer used by some visualizers).
VizPlaneViewer (viewer inside VizPane).
VizSelection—shows pick/select information.
The VizComposite control contains and manages some or all the other controls as needed. This composite control implements several ActiveX interfaces.
The interface you obtain from the composite control should be one of the following:
IVizCommon
IVizCommon2
IScatterviz
IScatter2
ISplatviz
ISplatviz2
IMapviz
IEviviz
IDtableviz
IDtableviz2
ITreeviz
IVizCommon contains methods that are common to all the other interfaces. Also, all the other interfaces include IVizCommon, so methods of IVizCommon may be called directly from any of the other interfaces.
After you have loaded a file into VizComposite, you can use GetVizType() (a method of IVizCommon) to determine which of the specific tool interfaces you need to obtain, or you can just decide based on the configuration file extension.
The following tables describe all the interface methods and properties. Each description includes the C++ style declaration exposed via a COM vtable interface. When you load the control into Visual Studio and it becomes a class, the IScatterviz and IVizCommon interfaces from which it derives are exposed. These Automation interfaces are slightly different than the COM vtable interfaces, so the two interfaces are described in separate tables. If you load the control into a Java or Visual Basic environment, the resulting class will have Java or Visual Basic style declarations instead.
After inserting the VizComposite control into the Visual Studio workspace, a member variable representing the control can be created. The COM vtable interfaces may then be accessed via this member variable. For example, if the member variable is named m_vizCompositeCtrl, the following code shows how to pass a file to the control using the COM vtable interface for IVizCommon (the file atlbase.h is included in order to use the USES_CONVERSION and A2W macros.):
#import "d:\sdk ib\VizComposite.dll" no_namespace
#include "atlbase.h"
...
USES_CONVERSION;
IVizCommon *pVizCommon = NULL;
IUnknown *pUnk = NULL;
pUnk = m_vizcompositectrl.GetControlUnknown();
if(pUnk)
{
pUnk->QueryInterface(__uuidof(IVizCommon), (void **)&pVizCommon);
if(pVizCommon)
{
pVizCommon->put_File(A2W("c:\\examples\\adult-salary-evi.eviviz"));
pVizCommon->Release();
}
}
|
| Note: You can view online documentation for the methods in each control by using oleview. |
Table 14-1 lists the IVizCommon methods for the COM vtable interface. These methods and properties are common to all viz tools, although their behavior for a particular tool may vary. (In rare cases, behavior has not yet been implemented for some tools, in which case E_NOTIMPL is returned. Otherwise S_OK is returned.)
Table 14-1. IVizCommon Methods—COM vtable Interface
Declaration | Description |
|---|---|
void PutFile(_bstr_ _arg1); | Creates the right tool based on the configuration file extension. This is probably the single most important method. You can create an application using only this method. |
VIZCODE GetVizType(); | Returns an enum indicating the type of visualization tool. It returns VIZ_UNKNOWN if no configuration file has been opened yet. Other values are: VIZ_MAP, VIZ_SCATTER, VIZ_SPLAT, VIZ_EVI, VIZ_DTABLE, and VIZ_TREE (in the VizCommon.idl file this is the VizType property). |
HRESULT SetScale(float s); | In the Tree Visualizer, Evidence Visualizer, Decision Table Visualizer, and Map Visualizer, this function scales the heights of objects in the scene. In the Scatter Visualizer, it scales the size of the entities. In the Splat Visualizer it scales the opacity. For the MineSet Visualizer application the scale is adjusted by the slider on the left trim of the viewer. |
HRESULT ShowDecoration(long on); | Turns on or off (TRUE/FALSE) the Inventor window decoration based on the value of on. |
HRESULT ShowBackgroundColorDialog(); | Brings up the color selector dialog, so the user can select a desired background color. |
HRESULT SetBackgroundColor(float r, | Explicitly sets a specific background color. |
HRESULT ShowFilterDialog(); | Brings up a filter panel of some type that can be used to reduce the amount of geometry in the scene. The Scatter Visualizer, Splat Visualizer, Decision Table Visualizer, and Map Visualizer use the same style of filter dialog. The Tree Visualizer and Evidence Visualizer have their own variations. |
HRESULT DoIdle(long lCount); | Makes Inventor run smoothly. It should be called in your application's OnIdle member function. For example: BOOL CVizApp::OnIdle(LONG lCount) { if (m_bIsProcessing) { m_pVizView->m_vizCompositeCtrl.Idle(lCount) ; } return CWinApp::OnIdle(lCount);}m_bIsProcessing must be set to true in the view's OnInitialUpdate: ((CVizApp *)AfxGetApp())->m_bIsProcessing = TRUE; |
HRESULT ShowSelectionDialog(); | Brings up a table showing information about all the objects in the scene which are currently selected. For the visualization application supplied with MineSet, this method is called when the user selects Show Values from the Selection menu. |
HRESULT SetLegendHeight(short numLegends); | Sets the height of the legend control at the bottom of the visualization tool. If the numLegends argument is 3, then the height of the legend control will be enough to show three legends without the help of a vertical scrollbar. |
HRESULT EnableSound(long on); | Turns the sound effects on or off (TRUE or FALSE respectively.) |
VIEWINGCODE GetViewingMode(); | Returns the Inventor viewing mode, either VIEWING_PICK (viewer turned on) or VIEWING_GRASP (viewer turned off). When the viewer is turned on (pick mode), events are consumed by the viewer. When viewing is off, events are processed by the viewer's render area. This means events will be sent to the scene graph for processing (that is, picking can occur). These methods have no meaning for Tree Visualizer, which does not use a model viewer. |
void PutViewingMode(VIEWINGCODE pVal); | Establishes the desired viewing mode (either VIEWING_PICK or VIEWING_GRASP). In grasp mode, the cursor appears as a hand, and viewing transformations are performed. In pick mode, no navigation is possible, but you can pick and select objects in the scene. These methods have no meaning for Tree Visualizer, which does not use a model viewer. |
long GetSupportsAnimation(); | Returns TRUE if the visualization tool currently instantiated supports animation. In other words, returns TRUE if sliders are present. Some tools such as the Evidence Visualizer, Decision Table Visualizer, and Tree Visualizer never have animation in their current implementations. For these visualizers GetSupportsAnimation always return FALSE. |
Returns the selection expression which has been created based on the current selection of objects in the scene. This string is typically used to drill through to the underlying data in some manner, but there are other potential uses. If nothing has been selected the expression is an empty string (“”). | |
_bstr_t GetHistoryString(); | Returns the history from the configuration file. This history contains everything that the Tool Manager needs to recreate its state at the time the current visualization was created. |
_bstr_t GetTitleString(); | Returns an appropriate application title including the application name and current configuration file base name. |
HRESULT EnableStereo(long on); | Turns on stereo rendering in the 3D viewer. It may be necessary to set hardware specific settings, and/or have certain peripherals like Crystal Eyes glasses before stereo is actually useful. |
HRESULT SetStereoOffset(float offset); | Sets the amount of eye separation for the left and right stereo views. |
HRESULT SetSelectionsHeight(short height); | Sets the height (in pixels) of the selection control which appears at the top of all tools and displays pick information. |
HRESULT EnableWarnOnExecute(long on); | Specifies whether the user should be warned when a user-defined execute statement is invoked (this occurs when an object is double clicked and such an execute statement has been defined). The warning might be useful if you are concerned about security. |
HRESULT EnableQuiet(long on); | Turns off the display of all error and warning popup messages. In most cases this option should be off (FALSE). See also SetErrorFile. |
HRESULT SetErrorFile(_bstr_t fileName); | Specifies a file where all error messages should be sent. If an error file is set, error messages will still appear in dialogs on the screen. If you do not want the dialogs to appear on the screen you should use EnableQuiet(TRUE). This method is primarily used for debugging and testing of applications made using the composite control. |
HRESULT SetHideDistance(float distance); | Sets the distance at which level of detail is hidden. The most common use of this distance factor is in changing the level of detail on 3D text displayed in a scene. This option could also change detail thresholds in other circumstances. Sometimes the text has three or four levels of detail (hidden, bounding box, wire frame, full 3D), the distance parameter sets the first threshold, and the other thresholds are scalar multiples. |
void PutNullStyle(DRAW_STYLE style); | Allows you to set how Null Values are displayed in the scene. Possible values are SOLID, HIDDEN and OUTLINE. Outline behaves the same as hidden for all tools except the Tree Visualizer. |
DRAW_STYLE GetNullStyle(); | Returns current setting for how Null values are displayed. |
HRESULT SetFont(_bstr_t fontName); | Sets a desired font. This might be particularly useful for certain locales. |
HRESULT SaveSceneGraph(_bstr_t fileName); | Outputs the current scenegraph to a file in Inventor format. This .iv file cannot be loaded directly into another application, however, without having the right DLL's installed. This method is primarily used for debugging and testing. |
HRESULT SaveCompositeImage(_bstr_t fileName, | Outputs the current scenegraph to a file in Inventor format. This saves an image of the whole composite control to a file. An offscreen renderer is not used to save the scene, so if you want improved resolution, a better choice might be SaveViewerImage. |
HRESULT SaveViewerImage(_bstr_t fileName, | Saves the main viewer image to a file. An offscreen renderer is used for this, so the resolution is better. If the last three arguments are not specified (or are 0), then values are chosen based on the current screen size and resolution. |
HRESULT HasLegend(long *HasLegend); | Returns TRUE or FALSE depending on whether or not a legend is present at the bottom. |
HRESULT SaveLegendImage(_bstr_t fileName); | Takes a snapshot of the legend control and saves it to a file. This method is primarily used for debugging and testing. |
HRESULT SaveDataTable(_bstr_t fileName); | Stores the tools internal data table to a file. This method is primarily used for debugging and testing. |
HRESULT PrintCompositeImage(long hDC, | Prints an image of the window pointed to by hWnd to a file. An offscreen rendered is not used for saving the scene, so SaveViewerImage might be better for improved resolution. If hWnd is NULL, only the main rendering window image is saved. |
HRESULT SetMouseButtonStyle(MBUTTON_STYLR | Selects the desired mouse mapping mode. Possible values are, MINESET_TWO_BUTTON_STYLE and MINESET_THREE_BUTTON_STYLE Since many users do not have a three-button mouse, MineSet now allows for two-button operation. For those familiar with previous versions of MineSet on the IRIX platform, three-button style offers the same controls as before. The default, two-button style, is more consistent between tools and has less dependence on the use of modifier keys. However, no functionality is lost with either a three- or a two-button mouse. See the Navigation entry in the MineSet Enterprise Edition Reference Guide for mouse button navigation details. |
HRESULT SetCameraPosition(float x, HRESULT GetCameraPosition(float *v); | Provides methods of manipulating the camera viewpoint. Normally, the user interacts with the scene using the mouse, but an application may require alternative methods for setting or getting the viewpoint and orientation. Possible uses are setting up or running animations, saving or restoring interesting viewpoints, alternative input devices, and so forth. |
HRESULT SetCameraOrientation(float x, HRESULT GetCameraOrientation(float *v); | Changes camera orientation. In SetCameraOrientation, x, y, z are the components of the axis, and angle is the rotation of the camera around that axis of orientation in radians. In GetCameraOrientation, x, y, and z are the components of the axis orientation, angle gives the orientation of the camera about that axis in radians. |
Table 14-2 lists the IVizCommon methods for the Automation interface.
Table 14-2. IVizCommon Methods—Automation Interface
Declaration | Description |
|---|---|
void SetFile(LPCTSTR fileName); | Creates the right tool based on the configuration file extension. This is probably the single most important method. You can create an application using only this method. |
long GetVizType(); | Returns an enum indicating the type of visualization tool. It returns VIZ_UNKNOWN if no configuration file has been opened yet. Other values are: VIZ_MAP, VIZ_SCATTER, VIZ_SPLAT, VIZ_EVI, VIZ_DTABLE, and VIZ_TREE (in the VizCommon.idl file this is the VizType property). |
void SetScale(float s); | In the Tree Visualizer, Evidence Visualizer, Decision Table Visualizer, and Map Visualizer, this function scales the heights of objects in the scene. In the Scatter Visualizer, it scales the size of the entities. In the Splat Visualizer it scales the opacity. For the MineSet Visualizer application the scale is adjusted by the slider on the left trim of the viewer. |
void ShowDecoration(long on); | Turns on or off (TRUE/FALSE) the Inventor window decoration based on the value of on. |
void ShowBackgroundColorDialog(); | Brings up the color selector dialog, so the user can select a desired background color. |
void SetBackgroundColor(float r, | Explicitly sets a specific background color. |
void ShowFilterDialog(); | Brings up a filter panel of some type that can be used to reduce the amount of geometry in the scene. The Scatter Visualizer, Splat Visualizer, Decision Table Visualizer, and Map Visualizer use the same style of filter dialog. The Tree Visualizer and Evidence Visualizer have their own variations. |
void DoIdle(long lCount); | Makes Inventor run smoothly. It should be called in your application's OnIdle member function. For example: BOOL CVizApp::OnIdle(LONG lCount) { if (m_bIsProcessing) { m_pVizView->m_vizCompositeCtrl.Idle(lCount) ; } return CWinApp::OnIdle(lCount);}m_bIsProcessing must be set to true in the view's OnInitialUpdate: ((CVizApp *)AfxGetApp())->m_bIsProcessing = TRUE; |
void ShowSelectionDialog(); | Brings up a table showing information about all the objects in the scene which are currently selected. For the visualization application supplied with MineSet, this method is called when the user selects Show Values from the Selection menu. |
void SetLegendHeight(short numLegends); | Sets the height of the legend control at the bottom of the visualization tool. If the numLegends argument is 3, then the height of the legend control will be enough to show three legends without the help of a vertical scrollbar. |
void EnableSound(long on); | Turns the sound effects on or off (TRUE or FALSE respectively.) |
long GetViewingMode(); | Returns the Inventor viewing mode, either VIEWING_PICK (viewer turned on) or VIEWING_GRASP (viewer turned off). When the viewer is turned on (pick mode), events are consumed by the viewer. When viewing is off, events are processed by the viewer's render area. This means events will be sent to the scene graph for processing (that is, picking can occur). These methods have no meaning for Tree Visualizer, which does not use a model viewer. |
void SetViewingMode(long nNewValue); | Establishes the desired viewing mode (either VIEWING_PICK or VIEWING_GRASP). In grasp mode, the cursor appears as a hand, and viewing transformations are performed. In pick mode, no navigation is possible, but you can pick and select objects in the scene. These methods have no meaning for Tree Visualizer, which does not use a model viewer. |
Long GetSupportsAnimation(); | Returns TRUE if the visualization tool currently instantiated supports animation. In other words, returns TRUE if sliders are present. Some tools such as the Evidence Visualizer, Decision Table Visualizer, and Tree Visualizer never have animation in their current implementations. For these visualizers GetSupportsAnimation always return FALSE. |
CString GetSelectionExpression(); | Returns the selection expression which has been created based on the current selection of objects in the scene. This string is typically used to drill through to the underlying data in some manner, but there are other potential uses. If nothing has been selected the expression is an empty string (“”). |
CString GetHistoryString(); | Returns the history from the configuration file. This history contains everything that the Tool Manager needs to recreate its state at the time the current visualization was created. |
CString GetTitleString(); | Returns an appropriate application title including the application name and current configuration file base name. |
void EnableStereo(long on); | Turns on stereo rendering in the 3D viewer. It may be necessary to set hardware specific settings, and/or have certain peripherals like Crystal Eyes glasses before stereo is actually useful. |
void SetStereoOffset(float offset); | Sets the amount of eye separation for the left and right stereo views. |
void SetSelectionsHeight(short height); | Sets the height (in pixels) of the selection control which appears at the top of all tools and displays pick information. |
void EnableWarnOnExecute(long on); | Specifies whether the user should be warned when a user-defined execute statement is invoked (this occurs when an object is double clicked and such an execute statement has been defined). The warning might be useful if you are concerned about security. |
void EnableQuiet(long on); | Turns off the display of all error and warning popup messages. In most cases this option should be off (FALSE). See also SetErrorFile. |
void SetErrorFile(LPCTSTR fileName); | Specifies a file where all error messages should be sent. If an error file is set, error messages will still appear in dialogs on the screen. If you do not want the dialogs to appear on the screen you should use EnableQuiet(TRUE). This method is primarily used for debugging and testing of applications made using the composite control. |
void SetHideDistance(float distance); | Sets the distance at which level of detail is hidden. The most common use of this distance factor is in changing the level of detail on 3D text displayed in a scene. This option could also change detail thresholds in other circumstances. Sometimes the text has three or four levels of detail (hidden, bounding box, wire frame, full 3D), the distance parameter sets the first threshold, and the other thresholds are scalar multiples. |
void PutNullStyle(long nNewValue); | Allows you to set how Null Values are displayed in the scene. Possible values are SOLID, HIDDEN and OUTLINE. Outline behaves the same as hidden for all tools except the Tree Visualizer. |
long GetNullStyle(); | Returns current setting for how Null values are displayed. |
void SetFont(LPCTSTR fontName); | Sets a desired font. This might be particularly useful for certain locales. |
void SaveSceneGraph(LPCTSTR fileName); | Outputs the current scenegraph to a file in Inventor format. This .iv file cannot be loaded directly into another application, however, without having the right DLL's installed. This method is primarily used for debugging and testing. |
void SaveCompositeImage(LPCTSTR fileName, | Outputs the current scenegraph to a file in Inventor format. This saves an image of the whole composite control to a file. An offscreen renderer is not used to save the scene, so if you want improved resolution, a better choice might be SaveViewerImage. |
void SaveViewerImage(LPCSTR fileName, | Saves the main viewer image to a file. An offscreen renderer is used for this, so the resolution is better. If the last three arguments are not specified (or are 0), then values are chosen based on the current screen size and resolution. |
void HasLegend(long *HasLegend); | Returns TRUE or FALSE depending on whether or not a legend is present at the bottom. |
void SaveLegendImage(LPCTSTR fileName); | Takes a snapshot of the legend control and saves it to a file. This method is primarily used for debugging and testing. |
void SaveDataTable(LPCTSTR fileName); | Stores the tools internal data table to a file. This method is primarily used for debugging and testing. |
void PrintCompositeImage(long hDC, | Prints an image of the window pointed to by hWnd to a file. An offscreen rendered is not used for saving the scene, so SaveViewerImage might be better for improved resolution. If hWnd is NULL, only the main rendering window image is saved. |
void SetMouseButtonStyle(long style); | Selects the desired mouse mapping mode. Possible values are, MINESET_TWO_BUTTON_STYLE and MINESET_THREE_BUTTON_STYLE Since many users do not have a three-button mouse, MineSet now allows for two-button operation. For those familiar with previous versions of MineSet on the IRIX platform, three-button style offers the same controls as before. The default, two-button style, is more consistent between tools and has less dependence on the use of modifier keys. However, no functionality is lost with either a three- or a two-button mouse. See the Navigation entry in the MineSet Enterprise Edition Reference Guide for mouse button navigation details. |
void SetCameraPosition(float x, void GetCameraPosition(float *v); | Provides methods of manipulating the camera viewpoint. Normally, the user interacts with the scene using the mouse, but an application may require alternative methods for setting or getting the viewpoint and orientation. Possible uses are setting up or running animations, saving or restoring interesting viewpoints, alternative input devices, and so forth. |
void SetCameraOrientation(float x, void GetCameraOrientation(float *v); | Changes camera orientation. In SetCameraOrientation, x, y, z are the components of the axis, and angle is the rotation of the camera around that axis of orientation in radians. In GetCameraOrientation, x, y, and z are the components of the axis orientation, angle gives the orientation of the camera about that axis in radians. |
Table 14-3 lists the IVizCommon2 methods for the COM vtable interface.
Table 14-3. IVizCommon2 Methods—COM vtable Interface
Declaration | Description |
|---|---|
HRESULT SetSelectionExpression(_bstr_t selectionExp); | Changes the set of currently selected objects in the scene. |
_bstr_t GetFilterExpression(); | Returns the filter expression. |
HRESULT SetFilterExpression(_bstr_t filterExp); | Specifies the filter expression and filters the scene objects appropriately. |
HRESULT EnableDynamicBrushing(long on); | Specifies whether selection events should be propagated between multiple visualization windows. If turned on, the selection expression of an object selected in one window is propagated to all other visualization window, and the corresponding objects are highlighted. |
HRESULT PublishOnWeb(_bstr_t fileName); | Compresses visualization, data, and schema files into a single MTR archive for publishing on the web. |
HRESULT GenerateReport(_bstr_t fileName); | Generates a HTML based report for the current visualization. |
HRESULT ShowDrillThroughDialog(); | Brings up a dialog which allows the user to set options for drill through and then invoke it. Uses the method SendDrillThroughRequest of ISyncServer to process the drill through request (that is, communication with Tool Manager). Alternatively, the plugin viz tool may wish to do its own drill through handling. It is up to the plugin viz tool to implement the drill through dialog and interprocess communication. VizMain implements a default that can be used in conjunction with Tool Manager. |
Table 14-4 lists the IVizCommon2 methods for the Automation interface.
Table 14-4. IVizCommon2 Methods—Automation Interface
Declaration | Description |
|---|---|
void SetSelectionExpression(LPCTSTR selectionExp); | Changes the set of currently selected objects in the scene. |
CString GetFilterExpression(); | Returns the filter expression. |
void SetFilterExpression(LPCTSTR filterExp); | Specifies the filter expression and filters the scene objects appropriately. |
void EnableDynamicBrushing(long on); | Specifies whether selection events should be propagated between multiple visualization windows. If turned on, the selection expression of an object selected in one window is propagated to all other visualization window, and the corresponding objects are highlighted. |
void PublishOnWeb(LPCSTR fileName); | Compresses visualization, data, and schema files into a single MTR archive for publishing on the web. |
void GenerateReport(LPCSTR fileName); | Generates a HTML based report for the current visualization. |
void ShowDrillThroughDialog(); | Brings up a dialog which allows the user to set options for drill through and then invoke it. Uses the method SendDrillThroughRequest of ISyncServer to process the drill through request (that is, communication with Tool Manager). Alternatively, the plugin viz tool may wish to do its own drill through handling. It is up to the plugin viz tool to implement the drill through dialog and interprocess communication. VizMain implements a default that can be used in conjunction with Tool Manager. |
Table 14-5 lists the methods for the COM vtable interface that are available to interactively modify the Scatter Visualizer.
Table 14-5. IScatterviz Methods—COM vtable Interface
Declaration | Description |
|---|---|
HRESULT ShowDrillThroughColumnDialog(); | Brings up a dialog that allows you to select which columns you want to be significant on drill through. In other words you use the dialog to specify which columns could potentially be in the selection Expression (see GetSelectionExpression on page 170). |
HRESULT SetTrailType(TRAILCODE trailtype); | Specifies what type of trails to use if any. Possible values of TRAILCODE are NO_TRAILS, LINE_TRAILS, FADE_OUT_TRAILS, and TUBE_TRAILS. |
HRESULT ShowAnimationPanel(long on); | Indicates that if the argument is TRUE show the animation panel, otherwise hide it. If there is no animation panel, it cannot be shown. |
HRESULT CreateBoxSelection(); | Creates a bounding box which can be used to select entities. |
HRESULT UseSliderOnDrillThough(long on(); | Specifies whether or not the animation slider position should be used in constructing the drill through expression when you drill through. |
HRESULT Set2DSliderPositions(float slider1Pos, | Allows you to programmatically alter the slider position. If the slider is one dimensional then the second argument is ignored. |
void PutShape(SHAPECODE pVal); | Refers to the current entity shape type. Possible values for the Scatter Visualizer are: SHAPE_CUBE SHAPE_SPHERE SHAPE_DIAMOND SHAPE_BAR |
SHAPECODE GetShape(); | Returns the current shape type. |
HRESULT EnableSpinAnimation(long on); | Specifies whether or not the automatic spin animation should be enabled in the viewer. If on is set to TRUE, then it is possible to set the animation continuously spinning by doing a rotation and releasing the left mouse before you are done dragging. |
HRESULT SetLabelSize(float size); | Sets the scale size of object labels that appear in the scene. The larger the value of size the bigger the label. |
HRESULT SetAxisLabelSize(float size); | Sets the scale size of axis labels that appear in the scene. This applies to the labels at the ends of the axes in Scatter and Splat Visualizers. |
HRESULT SetGridColor(float r, float g, float b); | Sets the color for the grid. |
HRESULT SetGridSize(float axis1, | Sets the grid spacing in each of the 3 dimensions. Larger values indicate wider grid line spacing. A value of 0 means do not draw any grid lines in that axis dimension. If the value of all axes is 0, then no grid is drawn. |
HRESULT SetOrientation(ORIENTATIONCODE orientation); | Specifies which of the three available orthogonal orientations the view should be set to. Possible values are: ORIENTATION_FRONT ORIENTATION_RIGHT ORIENTATION_TOP ORIENTATION_DEFAULT ORIENTATION_DEFAULT allows the viz tool to choose the orientation. |
HRESULT EnablePerspective(long on); | Sets whether or not to use perspective in the 3D viewer. If TRUE then use perspective projection if FALSE then use orthogonal projection. |
HRESULT SaveAnimationPaneImage(_bstr_t filename); | Takes a snapshot of the animation control and saves it to a file. This method is primarily used for debugging and testing. |
Table 14-6 lists the methods for the Automation interface that are available to interactively modify the Scatter Visualizer.
Table 14-6. IScatterviz Methods—Automation Interface
Declaration | Description |
|---|---|
void ShowDrillThroughColumnDialog(); | Brings up a dialog that allows you to select which columns you want to be significant on drill through. In other words you use the dialog to specify which columns could potentially be in the selection Expression (see GetSelectionExpression on page 170). |
void SetTrailType(long trailtype); | Specifies what type of trails to use if any. Possible values of TRAILCODE are NO_TRAILS, LINE_TRAILS, FADE_OUT_TRAILS, and TUBE_TRAILS. |
void ShowAnimationPane(long on); | Indicates that if the argument is TRUE show the animation panel, otherwise hide it. If there is no animation panel, it cannot be shown. |
void CreateBoxSelection(); | Creates a bounding box which can be used to select entities. |
void UseSliderOnDrillThough(long on(); | Specifies whether or not the animation slider position should be used in constructing the drill through expression when you drill through. |
void Set2DSliderPositions(float slider1Pos, | Allows you to programmatically alter the slider position. If the slider is one dimensional then the second argument is ignored. |
void SetShape(long nNewValue); | Refers to the current entity shape type. Possible values for the Scatter Visualizer are: SHAPE_CUBE SHAPE_SPHERE SHAPE_DIAMOND SHAPE_BAR |
void GetShape(); | Returns the current shape type. |
void EnableSpinAnimation(long on); | Specifies whether or not the automatic spin animation should be enabled in the viewer. If on is set to TRUE, then it is possible to set the animation continuously spinning by doing a rotation and releasing the left mouse before you are done dragging. |
void SetLabelSize(float size); | Sets the scale size of object labels that appear in the scene. The larger the value of size the bigger the label. |
void SetAxisLabelSize(float size); | Sets the scale size of axis labels that appear in the scene. This applies to the labels at the ends of the axes in Scatter and Splat Visualizers. |
void SetGridColor(float r, float g, float b); | Sets the color for the grid. |
void SetGridSize(float axis1, | Sets the grid spacing in each of the 3 dimensions. Larger values indicate wider grid line spacing. A value of 0 means do not draw any grid lines in that axis dimension. If the value of all axes is 0, then no grid is drawn. |
void SetOrientation (long orientation); | Specifies which of the three available orthogonal orientations the view should be set to. Possible values are: ORIENTATION_FRONT ORIENTATION_RIGHT ORIENTATION_TOP ORIENTATION_DEFAULT ORIENTATION_DEFAULT allows the viz tool to choose the orientation. |
void EnablePerspective(long on); | Sets whether or not to use perspective in the 3D viewer. If TRUE then use perspective projection if FALSE then use orthogonal projection. |
void SaveAnimationPaneImage(LPCTSTR filename); | Takes a snapshot of the animation control and saves it to a file. This method is primarily used for debugging and testing. |
Table 14-7 lists two methods that are available to interactively modify the Scatter Visualizer.
Table 14-7. IScattert2 Methods—Automation Interface
Declaration | Description |
|---|---|
HRESULT EnableShadows(long on); | Specifies whether to use projective shadow rendering. |
HRESULT SetShadowColor(float r, | Specifies the overall color for shadows. |
Table 14-8 lists the methods that are available to interactively modify the Splat Visualizer.
Declaration | Description |
|---|---|
void ShowPickDragger(long on); | Specifies whether the Splat Visualizer pick-dragger is shown, otherwise it is hidden (on=TRUE—shown, on=FALSE—hidden). |
long GetShowingPickDragger(); | Returns TRUE if the pick dragger is currently showing. |
HRESULT ShowAnimationPanel(long on); | Specifies whether the animation panel is shown (on=TRUE—shown, on=FALSE—hidden). If there is no animation panel, it cannot be shown. |
HRESULT CreateBoxSelection(); | Creates a bounding box which can be used to select splats. |
HRESULT UseSliderOnDrillThrough(long on); | Specifies whether the animation slider position should be used in constructing the drill through expression. |
HRESULT Set2DSliderPositions(float slider1Pos, | Allows you to programmatically alter the slider position. If the slider is one dimensional then the second argument is ignored. |
void PutShape(SHAPECODE pVal); | Sets the shape type for splats: SHAPE_CUBE, SHAPE_SPHERE, SHAPE_DIAMOND, SHAPE_BAR, SHAPE_LINEAR, SHAPE_GAUSSIAN, or SHAPE_TEXTURE |
SHAPECODE GetShape(); | Returns the current shape type. |
HRESULT EnableSpinAnimation(long on); | Specifies whether the automatic spin animation should be enabled in the viewer. If on is set to TRUE, then it is possible to set the animation continuously spinning by doing a rotation and releasing the left mouse before you are done dragging. |
HRESULT SetAxisLabelSize(float size); | Sets the scale size of axis labels that appear in the scene. This applies to the labels at the ends of the axes in Scatter Visualizer and Splat Visualizer and similar tools. |
HRESULT SetGridColor(float r, float g, float b); | Sets the color for the grid. |
HRESULT SetGridSize(float axis1, | Sets the grid spacing in each of the three dimensions. Larger values indicate wider grid line spacing. A value of 0 means do not draw any grid lines in that axis dimension. If the value of all axes is 0, then no grid is drawn. |
HRESULT SetOrientation(ORIENTATIONCODE orientation); | Specifies to which of three orthogonal orientations the view should be set Possible values are ORIENTATION_FRONT, ORIENTATION_RIGHT, ORIENTATION_TOP, and ORIENTATION_DEFAULT, where ORIENTATION_DEFAULT uses the orientation that the visualization tool thinks best. |
HRESULT EnablePerspective(long on); | Sets whether to use perspective in the 3D viewer. If TRUE use perspective projection, if FALSE use orthogonal projection. |
HRESULT SaveAnimationPaneImage(_bstr_t fileName); | Takes a snapshot of the animation control and saves it to a file. This method is primarily used for debugging and testing. |
Table 14-9 describes a method that is available to interactively modify the Scatter Visualizer.
Table 14-9. IScattert2 Methods
Declaration | Description |
|---|---|
HRESULT GetUsingNominalSplats(); | Returns TRUE if a string valued attribute is mapped to color. In this case the splats will show a distribution of colors corresponding to unique string values. The type of splat used to show this distribution is called a nominal splat. |
Table 14-10 lists the methods that are available to interactively modify the Map Visualizer.
Declaration | Description |
|---|---|
HRESULT ShowXYCoords(long on); | Specifies whether (TRUE) or not (FALSE) to display the XY Coordinate grid. |
HRESULT UseRandomColors(long on); | Specifies whether (TRUE) or not (FALSE) to assign a random color to each distinct geographical entity. |
HRESULT ShowAnimationPanel(long on); | Specifies whether (TRUE) or not (FALSE) to show the animation panel. If there is no animation panel, it cannot be shown. |
HRESULT UseSliderOnDrillThrough(long on); | Specifies whether (TRUE) or not (FALSE) the animation slider position should be used in constructing the drill through expression. |
HRESULT Set2DSliderPositions(float slider1Pos, | Allows you to programmatically alter the slider position. If the slider is one dimensional, the second argument is ignored. |
HRESULT EnableSpinAnimation(long on); | Specifies whether or not the automatic spin animation should be enabled in the viewer. If on is set to TRUE, then it is possible to set the animation continuously spinning by doing a rotation and releasing the left mouse before you are done dragging. |
HRESULT EnablePerspective(long on); | Sets whether or not to use perspective in the 3D viewer. TRUE specifies perspective projection. FALSE specifies orthogonal projection. |
HRESULT SaveAnimationPaneImage(_bstr_ fileName); | Takes a snapshot of the animation control and saves it to a file. This method is primarily used for debugging and testing. |
Table 14-11 lists the methods that are available to interactively modify the Evidence Visualizer.
Declaration | Description |
|---|---|
HRESULT SetAttributeOrder(ORDERCODE on); | Allows you to programmatically change the way the attributes are listed in the evidence visualizer. Possible values are: ORDER_BY_IMPORTANCE (the default) and ORDER_BY_DATABASE (use the database ordering). |
HRESULT SubtractMinEvidence(long on); | Specifies whether to subtract the minimum amount of evidence from each value in the bars mode (see the MineSet Enterprise Edition Reference Guide.) |
HRESULT SelectAttributeValue(_bstr_t attribute, | Programmatically selects one of the attribute values and resulting probabilities. |
HRESULT EnableEvidenceMode(long on); | Sets whether to show an evidence representation, or a probability representation. For the Evidence Visualizer, this means switching between showing the evidence cakes on the left, or the probability pies. See the MineSet Enterprise Edition Reference Guide for additional information about these modes. |
long GetEvidenceMode(); | Returns TRUE if the classifier visualizer is in the Evidence mode. |
HRESULT SetNominalOrder(ORDERCODE ordercode); | Specifies how to order attribute values. Possible values are: ORDER_ALPHABETICALLY ORDER_BY_WEIGHT, ORDER_BY_LABEL |
HRESULT SetViewerType(VIEWERCODE type) ; | Specifies whether to use the landscape style viewer or examiner viewer to display the scene. VIEWERCODE values are LANDSCAPE.VIEWER and EXAMINER.VIEWER Drilling up and down is not available in the landscape viewer mode. |
HRESULT SetLaplace(long on, float value); | Specifies whether or not to use Laplace correction. The second argument is the amount of Laplace correction to use. If the second argument is -1, then a default based on the data is used. |
HRESULT SaveLabelPaneImage(_bstr_t fileName); | Takes a snapshot of the label probability pane and saves it to a file. This method is primarily used for debugging and testing. |
HRESULT SelectLabelValue(_bstr_t value); | Programmatically selects one of the label values. After this method has been invoked, one of the classes in the probability pane on the right should be selected. |
HRESULT SetWeightThresh(float percent); | Filters out objects with low weight. When the threshold is 0% all values are shown, no matter how small their weight; if value is set to 100% all values are removed from the scene. |
HRESULT SetDetailThresh(float percent); | Changes the amount of detail in the scene. As the threshold is lowered, all attributes with lower importance values are removed from the scene. |
Table 14-12 lists the methods that are available to interactively modify the Decision Table Visualizer.
Table 14-12. IDtableviz Methods
Declaration | Description |
|---|---|
HRESULT EnableEvidenceMode(long on); | Specifies whether to show an evidence representation, or a probability representation. In the Decision Table Visualizer, this determines whether the cakes show evidence (normalized conditional probabilities), or straight probabilities. See the MineSet Enterprise Edition Reference Guide for additional information about these modes. |
HRESULT SetNominalOrder(ORDERCODE ordercode); | Specifies how to order attribute values. Possible values are: ORDER_ALPHABETICALLY, ORDER_BY_WEIGHT, and ORDER_BY_LABEL |
HRESULT SetViewerType(VIEWERCODE type); | Specifies whether to use the landscape style viewer or examiner viewer to display the scene. Possible VIEWERCODE values are LANDSCAPE.VIEWER and EXAMINER.VIEWER. |
HRESULT SetLaplace(long on, float value); | Specifies whether or not to use the Laplace correction. The second argument is the amount of Laplace correction to use. |
HRESULT SaveLabelPaneImage(_bstr_t fileName); | Takes a snapshot of the label probability pane and saves it to a file. This method is primarily used for debugging and testing. |
HRESULT SelectLabelValue(_bstr_t value); | Programmatically selects one of the label values. After this method has been invoked, one of the classes in the probability pane on the right should be selected. |
HRESULT SetWeightThresh(float percent); | Filters out objects with low weight. When the threshold is 0% all values are shown, no matter how small their weight; if value is set to 100% all values are removed from the scene. |
HRESULT SetDetailThresh(float percent); | Changes the amount of detail in the scene. As the threshold is increased, more detail is achieved through globally drilling down on all the cake charts until the maximum level of detail is reached at 100%. |
Table 14-13 describes a method that is available to interactively modify the Scatter Visualizer.
Table 14-13. IScattert2 Methods
Declaration | Description |
|---|---|
HRESULT ShowHierarchyDialog(); | Causes the Hierarchy Dialog box to be displayed. This is relevant only for decision tables and regression tables. |
Table 14-14 lists the methods that are available to interactively modify the Tree Visualizer.
Declaration | Description |
|---|---|
HRESULT ShowMarksDialog(); | Brings up a dialog which allows you to mark nodes in the tree with colored flags. |
HRESULT ShowOverviewDialog(); | Brings up a dialog which shows a two dimensional view of the entire tree. |
HRESULT ShowSearchDialog(); | Brings up a dialog which lets you search for different attribute values for all the nodes in the tree hierarchy. |
HRESULT Navigate(TREE_GOCODE code); | The equivalent of the navigation buttons on the right-hand strip of the Tree Visualizer Viewer. Code can take on any of the following values: TREE_HOME—Resets the camera to the home position. |
HRESULT IsValidNavigation(TREE_GOCODE c, | Sets enabled to TRUE if the corresponding TREE_GOCODE is currently available. Otherwise sets it to FALSE. |
HRESULT ShowBaseHeights(long on); | Toggles whether or not to show the base heights in the scene. If base heights are not shown, they appear simply as a flat box on the ground plane. |
HRESULT ShowMarksFlags(long on); | Specifies whether to show the marks flags, if there are any. |
void SetZeroStyle(DRAW_STYLE style); | Allows you to set how zero values are displayed. DRAW_STYLE style can take one of the following values: SOLID, HIDDEN or OUTLINE. |
DRAW_STYLE GetZeroStyle(); | Returns the current setting for how zero values are displayed using the variable DRAW_STYLE *style. This value will be either SOLID, HIDDEN, or OUTLINE. |
HRESULT NormalizeSubtree(); | Recomputes the heights for all nodes in the tree using the currently selected node as the 1.0 value. |
HRESULT SaveInitialHierarchy(b_str_t fileName); | Primarily used for debugging and testing. |
HRESULT SaveViewedHierarchy(b_str_t fileName); | Primarily used for debugging and testing. |
HRESULT SaveOverviewImage(_bstr_t fileName); | Saves a snapshot of the overview dialog image. This method is primarily used for debugging and testing. |
HRESULT SaveSearchPaths(_bstr_t fileName); | Saves a list of all the currently shown search paths. This method is primarily used for debugging and testing. |