1.0 Introduction

1.1 Compiling and Linking

1.2 Supported Platforms

2.0 Creating Custom Controls

2.1 'Filename' and 'Embed' Properties

2.2 Adding Features to Custom Controls

3.0 HOOPS 3D Stream Control:  Overview and Usage

4.0 Experimenting with the HOOPS 3D Stream Control



1.0 Introduction

This guide explains how to use the HOOPS/ActiveX Classes to create your own custom ActiveX control.  It assumes familiarity with the architecture of the HOOPS/MVO Classes.

1.1 Compiling and Linking

Windows 95/98/NT/2000

The HOOPS/ActiveX headers and source code are located in the /dev_tools/hoops_activex/source directory. This directory includes the Microsoft DevStudio Project files for rebuilding with Visual C++. 

NOTE: For this release, the MSDEV project files integrate the HOOPS/ActiveX base classes with custom logic that forms the HOOPS 3D Stream Control (see below).  Upcoming releases will separate pure HOOPS/ActiveX base classes from 3D Stream Control logic.  For specific details on integrated customizations, contact support@techsoft3d.com.

 

1.2 Supported Platforms

The HOOPS/ActiveX Integration Classes are supported on all major Windows 95/98/NT platforms, and support Microsoft Internet Explorer 4.7 and higher, as well as MS Office97 and higher.  Custom controls should also run properly inside any compliant OLE container application. For specific information regarding the supported versions of compilers and Operating Systems, refer to the Microsoft Windows 95/98/NT section of the HOOPS/3DAF Platform and Device Guide.



2.0 Creating Custom Controls

Custom control classes are derived from the HOOPS/ActiveX and HOOPS/MVO Classes. The objects can be extended to provide application specific functionality by overloading the appropriate member functions. 

The navigable diagram below illustrates the relationship of the ActiveX, HOOPS/ActiveX Integration Classes and the Custom Control Classes created in a sample custom control called 'MyControl' .



Note:  The HOOPS/ActiveX Control Template is not yet integrated into AppWizard with this release. 

Therefore, custom HOOPS/ActiveX classes that define your own UI, etc... currently need to be created via a manual series of steps:  (1) run AppWizard, replace all occurrences of COleControl and COleControlModule with CHoopsControl and CHoopsControlModule, (2) add 'Filename' and 'Embed' properties to your custom control class, and (3) add special code to your custom control's constructor, OnCreate, and destructor methods, and include several other custom functions and HOOPS/MVO objects.  

A point release of HOOPS/3dAF v5.0 will include template-based AppWizard support for easily creating your own custom HOOPS/ActiveX control.  (All necessary derived classes and code would be correctly pregenerated, and you could simply proceed with customizing the control's functionality per your requirements.) 

For now, we recommend that the sample HOOPS 3D Stream Control be used as a starting point for preliminary testing and prototyping. If you are preparing to create your own custom HOOPS/ActiveX-based control and have not yet received the HOOPS/ActiveX Template tools, please contact Tech Soft 3D support.   

2.1 Filename/Embed properties of custom HOOPS/ActiveX controls

OLE Container applications can access exposed methods and properties of custom ActiveX controls (such as the HOOPS 3D Stream Control).  One of the most important properties is called 'filename'. 

The 'filename' property drives the control by calling the method 'OnFilenameChanged' , which modifies the filename asssociated with the control.  'OnFilenameChanged' is called anytime a webpage references the control and passes in a 'filename'.  (See formula1.htm located in /hoops/dev_tools/hoops_activex).  In other cases, the 'OnFilenameChanged' method is called when the user pulls up the control 'Properties' from an OLE container application and loads a file.

'Embed' is another property used by custom controls.  In the case of OLE container applications, checking 'Embed' within the 'Property' page before loading in the file ensures data persistence.  Specifically, if you save a Word document that includes the control and a file was loaded into the control, then the file will be stored inside the Word document if 'Embed' is selected (the state of the file is then 'serialized').  When the document is reopened, the .hsf or .hmf file contents will be loaded back into the HOOPS/3dGS scene-graph.

2.2 Adding features to custom controls

Once you have created custom HOOPS/ActiveX control classes (manually via the approach mentioned previously, or with the upcoming automated AppWizard), proceed by defining a user interface. Custom user interfaces can take the form of right-click menus or JavaScript or VBscript buttons inside webpages. 

At the very least, the 'Filename' propertly would be one of the properties of your custom HOOPS/ActiveX control. 'Embed' would be necessary if you wanted to support persistence within OLE Container applications such as the MS Office programs.

A good starting point for evaluation and prototyping is to begin customizing the HOOPS 3D Stream Control. All the HOOPS/ActiveX-specific support logic and HSF streaming support is encapsulated in the base classes and the HOOPS 3D Stream Control classes. Therefore, customized code would primarily consist of working with vanilla MFC menu programming and CWnd methods to customize the right-click popup menu. Menu options can implement HOOPS/MVO and HOOPS/3dGS tools to create powerful, custom operators.


3.0 HOOPS 3D Stream Control:  Overview and Usage

The HOOPS 3D Stream Control is a customized, MFC-based ActiveX control that is built upon the HOOPS/ActiveX Classes and includes support for streaming HSF files. The customized features include a basic right-click popup menu containing various methods of scene interaction and support for native Windows GDI Printing/Copy-to-Clipboard. 

The source code for the HOOPS 3D Stream Control is available with the HOOPS/3dAF release.  To access, just open the MSDev Workspace hview.dsw located in /hoops/dev_tools/hoops_activex.   This workspace includes the base HOOPS/ActiveX control classes, as well as custom 'control-specific' logic that defines the HOOPS 3D Stream Control. 


4.0 Experimenting with the HOOPS 3D Stream Control

To install the HOOPS 3D Stream Control on your system, build the control from the hview project or download it from the following URL:

    http://hoops3d.com/streaming/control/control_download.htm

After downloading or manually building the 3D Stream Control, it will be registered on your system.  At this point the control is accessible from within the 'Insert->Object' list within MS Office applications (or any OLE-container application, such as Visio, etc...), and will be instantiated whenever web pages that reference the control are loaded into Microsoft Internet Explorer (MSIE). 

'Filename' Property

To experiment with the 'filename' property, insert the HOOPS 3D Stream Control into MS Word by selecting the menu option 'Insert > Object' and selecting  'HOOPS 3D Stream Control'.  DeSelect and then Select the object via a single click.  This will then let you access the menu option 'Edit > HOOPS 3D Stream Control Object > Properties' (alternatively, you can right-click on the control's border).  Choose a file with the .hsf extension and that file will be streamed in.  The file can be local or specified via a remote URL such as :

    http://www.hoops3d.com/stream/bridge.hsf
Finally, double-click to activate the control 'in-place'.  The control's right-click UI should now accessible.