OpenGL and VTK interface for .NET

Date issued

2003

Journal Title

Journal ISSN

Volume Title

Publisher

Václav Skala - UNION Agency

Abstract

VTK (visualization toolkit) is a large and useful object oriented library for data visualization. The current version (4.0) is also distributed for Win32 platform by means of dynamic linked libraries. Its native language is C++. An interface for Java, Python and TCL exists. These languages provide some subset of the VTK functionality only. Therefore the best use is with C++. OpenGL is well known library for graphics output used in large scale of applications. Interface and behavior of the library is defined in specifications available to wild public. Inner implementation of the interface is matter of operating system and/or graphics hardware providers. Currently existing interface implementations are ready to use within various programming languages. There is necessary to automate the process of wrap-class creation because of the VTK size (more then 700 classes). This process consists of two parts - parsing of C++ headers and generating of appropriate wrap-classes. The parser is distributed with VTK and it is used to generate Java, TCL and Python interfaces and so it is possible to use it in the case of C#. It is not possible for the library user to use inheritance and polymorphism when using the manner described above. A possible way is to use two-level wrapping. The level-one wrap-class is unmanaged and provides calling of managed virtual methods and makes protected methods accessible for level-two wrap-class where the direct inheritance is used. The level-two wrap-class is managed and has the same functionality as described above. One of the aims of this work is to find some way for straightforward use of VTK in C#. It has been done by means of wrap-classes written in C++ Managed Extension. Each VTK class has its own wrap-class. This wrapclass is managed and provides access into methods of unmanaged VTK class. Data conversion and memory management are also matters of wrap-class. Second aim of this work is to create an OpenGL port to .NET environment by wrapping an existing interface. The goal of this part is to compare it with already existing OpenGL interface implementation called CsGL. This interface is fully functional and it is based on the similar principles as of this work. This work tries to go a little bit further to increase programming safety and user's comfort. The presented paper is an introduction and description of this work's approach. The goal of this work is to try to find a reasonable way of VTK and OpenGL porting into .NET environment.

Description

Subject(s)

vizualizační toolkit, OpenGL, rozhraní

Citation

C# and .NET Technologies' 2003, p. 25-34.
OPEN License Selector