VISH  0.2
VISH
See also:
Overview of Documentation Pages for an overview of available documentation.

What is Vish?

Vish is not an application by itself, but a collection of interfaces to registration databases that allow implementing objects for visualization purposes independent from a specific application environment. It is available under the Light++ Copyright license.

An example application is QVish, a highly modular reference implementation which by virtue of the Vish interfaces allows easy exchange of components and appearance.

Vish comes as a library, which can be incorporated into another application. These applications implement the various interfaces as specified by vish. The vishy objects, which are compiled using solely the vish interfaces into shared library modules, will then be binary compatible among all applications and can be shared among them on the same hardware platform (with restrictions as imposed by usual limitations of C++ binary compatibility).

Vish objects specify their needs by requesting input parameters, which may be native C++ types like int, float, structs, or other vish objects.

A special subclass of vish objects are render objects; these may provide OpenGL code which is called according to a priority class scheme. Vish by itself is not a scene graph, but a render object may use or implement a scene graph, e.g. by interfacing OpenInventor or OpenSceneGraph. Also, a vish interface implementation may be part of an application using a scene graph library. Pure vish objects will employ raw OpenGL only, but if independence from a scene graph library is not an issue, the vish object may also interface an application's scene graph library directly (hereby loosing binary shareability, of course).

Associated with Vish is the Fiber Bundle Library and its Vish interface, known as Fiberbundle-Vish (Fish). It provides management for handling a wide class of data for scientific visualization.

Who needs Vish?

Vish is primarily of use for anyone who would like to develop OpenGL-based visualizations in a portable and application-independent manner. By using Vish, the resulting code is not bound to a specific application, but directly usable

As Vish is designed very generally, its potential use might be even beyond this primary purpose and will be driven by practice.

How does it work?

VISH is about objects and interface with deferred implementations. VISH objects may specify input slots and which are created through a parameterized database. These vish objects are implemented in the class VObject. All VObject's may make use of parameters which are requested during construction e.g. via the VObject::addParam() call. Such parameters are specified via a textual description and native C++ type, e.g. as in:

class myObject : public VObject
{
public:
        myObject(const string&name, const VCreatorBase&VC) 
        : VObject(name, VC)
        {
                addParam("size", 20);
        }
};

The implementation of the VISH interfaces (e.g. QVish) will then provide a GUI or equivalent input method for the respective parameter. The VObject itself is separated from these details and thus may be compiled independent from the parameter implementation. Using the same platform (hardware, compiler), pre-compiled VObjects may thus be shared in their binary form among various VISH implementations.

What can it do?

OpenGL rendering

Special children are derived from VRenderObject and may implement an OpenGL routine for 3D rendering (see The OpenGL Interface of Vish ).

class myRenderObject : public VRenderObject
{
public:
        myRenderObject(const string&name, const VCreatorBase&VC) 
        : VRenderObject(name, VC)
        {
                addParam("size", 20);
        }

        // A simple OpenGL callback routine demonstrating how to render
        // a parameterized object.
        override void render(VRenderContext & Context) const
        {
        int     size = 20;
                // Here we check if the parameter is available.
                // If not, we could also just continue with the internal default.
                if (!getInputValue(size, "size", Context) )
                        return;

                glBegin(GL_TRIANGLE);
                glVertex2f(0,0);
                glVertex2f(0,size);
                glVertex2f(size,size);
                glEnd();
        }
};

Advanced parameter specification

If there are multiple implementations of an input parameter are available such that specification of its pure type is ambiguous, the parameter request may be refined further via VCreationPreferences. It is a list of desired properties, which are textual descriptions with weights. A VISH implementation may or may not provide a complete fulfillment of such a request. VISH will provide the best possible match.

Interaction notification

VISH provides routines to check a possible user interaction with an OpenGL render object or parts of it. Not every VISH implementation may provide this feature. However, the reference implementation QVish does.

Input parameter implementation

Input parameters are not limited to pre-defined native C++ types, but a parameter request may refer to any user-implemented type or structure. An implementation of an input parameter may be a VISH object itself. In particular, it may also be a VRenderObject and thereby implement a graphical input method for its associated input value.