summaryrefslogtreecommitdiff
path: root/cad/plugins/NanoVision-1/src/Plugins/RenderingEngines/OpenGL/NXOpenGLRendererPlugin.h
blob: dcff2f2859c0e9358e38d0cbbe26639e402666b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright 2008 Nanorex, Inc.  See LICENSE file for details.

#ifndef NX_OPENGLRENDERERPLUGIN_H
#define NX_OPENGLRENDERERPLUGIN_H

#if defined(__APPLE__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif

#include "Nanorex/Interface/NXRendererPlugin.h"
#include "Nanorex/Interface/NXAtomData.h"
#include "Nanorex/Interface/NXBondData.h"
#include "Nanorex/Utility/NXCommandResult.h"
#include "NXOpenGLSceneGraph.h"

class NXOpenGLRenderingEngine;

/* CLASS: NXOpenGLRendererPlugin */
/**
 * Base class for rendering plugins that use OpenGL
 *
 * @ingroup NanorexInterface, PluginArchitecture, GraphicsArchitecture
 */
class NXOpenGLRendererPlugin
: public QObject, public Nanorex::NXRendererPlugin
{
	Q_OBJECT;
	Q_INTERFACES(Nanorex::NXRendererPlugin);
	
public:

	NXOpenGLRendererPlugin(Nanorex::NXRenderingEngine *parent = NULL);
	virtual ~NXOpenGLRendererPlugin() {}
    
	/// Derived classes must implement.
    /// Call to render the atom display list and return the scenegraph node.
	/// Must set commandResult to indicate success or failure.
	virtual NXSGOpenGLNode* renderAtom(Nanorex::NXAtomData const&) = 0;
    
	/// Derived classes must implement.
    /// Call to render the bond display list and return the scenegraph node.
    /// Must set commandResult to indicate success or failure.
	virtual NXSGOpenGLNode* renderBond(Nanorex::NXBondData const&) = 0;
	
#if 0 /// @todo Post-FNANO08
	/// @fixme r1.0.0 hacks
	// -- begin hacks --
	virtual NXSGOpenGLNode* renderDnaSegment(/*TODO*/) = 0;
	virtual NXSGOpenGLNode* renderDnaStrand(/*TODO*/) = 0;
	// -- end hacks --
#endif
};

// .............................................................................

/* CONSTRUCTOR */
inline
NXOpenGLRendererPlugin::
NXOpenGLRendererPlugin(Nanorex::NXRenderingEngine *parentEngine)
: QObject(),
Nanorex::NXRendererPlugin(parentEngine)
{
}


Q_DECLARE_INTERFACE(NXOpenGLRendererPlugin,
                    "com.Nanorex.Plugins.RenderingEngines.OpenGL."
                    "NXOpenGLRendererPlugin/0.1.0")

#endif // NX_OPENGLRENDERERPLUGIN_H