1 | #pragma once |
---|
2 | /* -*-c++-*- osgVisual - Copyright (C) 2009-2010 Torben Dannhauer |
---|
3 | * |
---|
4 | * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under |
---|
5 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
---|
6 | * (at your option) any later version. The full license is in LICENSE file |
---|
7 | * included with this distribution, and on the openscenegraph.org website. |
---|
8 | * |
---|
9 | * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. |
---|
10 | * You have to aquire licenses for all used proprietary modules. |
---|
11 | * |
---|
12 | * This library is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * OpenSceneGraph Public License for more details. |
---|
16 | */ |
---|
17 | |
---|
18 | #include "VistaView.h" |
---|
19 | |
---|
20 | #include <osg/Drawable> |
---|
21 | #include <osg/Geode> |
---|
22 | #include <osg/Projection> |
---|
23 | #include <osg/MatrixTransform> |
---|
24 | #include <osg/CoordinateSystemNode> |
---|
25 | |
---|
26 | #include <osgDB/FileUtils> |
---|
27 | |
---|
28 | |
---|
29 | namespace osgVisual |
---|
30 | { |
---|
31 | |
---|
32 | /** |
---|
33 | * \brief This class integrates Vista2D by Wetzel Technology into OSG. |
---|
34 | * |
---|
35 | * It wraps vista2D's OpenGL interface to be usable as a standart OSG Node. The Vista2D nodekit performs auto-linking |
---|
36 | * againt the Vista2D library, therefore only three shared libraries have to be copied to the binary folder of the project. |
---|
37 | * |
---|
38 | * Vista2D ist a software to design HID. This Nodekit enables OSG to display Vista2D project files. |
---|
39 | * |
---|
40 | * Please copy the following files to the binary folder of you application if you intend to use this nodekit: |
---|
41 | * libView.dll |
---|
42 | * fontLib.dll |
---|
43 | * freetype6.dll |
---|
44 | * |
---|
45 | * The implementation of this class is based on osg::Drawable. The drawimplementations contains the Vista2D wrap. |
---|
46 | * |
---|
47 | * @author Torben Dannhauer |
---|
48 | * @date Sep 2009 |
---|
49 | */ |
---|
50 | class visual_vista2D : public osg::Drawable |
---|
51 | { |
---|
52 | public: |
---|
53 | /** |
---|
54 | * \brief Construtor: Creates a Vista2D environment which should be wrapt by this node. |
---|
55 | * |
---|
56 | */ |
---|
57 | visual_vista2D(void); |
---|
58 | |
---|
59 | /** |
---|
60 | * \brief Empty destructor. |
---|
61 | * |
---|
62 | */ |
---|
63 | ~visual_vista2D(void); |
---|
64 | |
---|
65 | /** |
---|
66 | * \brief This static function must be called to instantiate a vista2D project. |
---|
67 | * |
---|
68 | * @param vista2DFilename_ : Vista2D project file to display. |
---|
69 | * @param sceneGraphRoot_ : Scenegraph to add the vista2D note as child. |
---|
70 | * @return : True if successful. |
---|
71 | */ |
---|
72 | static bool createVistaOverlay( std::string vista2DFilename_, osg::CoordinateSystemNode *sceneGraphRoot_ ); |
---|
73 | |
---|
74 | /** |
---|
75 | * \brief This function is requiered by subclassing osg::Drawable. |
---|
76 | * |
---|
77 | * @return : Cloned object. |
---|
78 | */ |
---|
79 | osg::Object* cloneType() const; |
---|
80 | |
---|
81 | /** |
---|
82 | * \brief This function is requiered by subclassing osg::Drawable. |
---|
83 | * |
---|
84 | * @param : Copyoperator how to copy the object |
---|
85 | * @return : Cloned object. |
---|
86 | */ |
---|
87 | osg::Object* clone(const osg::CopyOp&) const; |
---|
88 | |
---|
89 | private: |
---|
90 | /** |
---|
91 | * \brief This function initialized the visual_vista2D object after instantiation by createVistaOverlay() |
---|
92 | * |
---|
93 | * @param vista2DFilename_ : Vista2D project file to instantiate. |
---|
94 | */ |
---|
95 | void init(std::string vista2DFilename_); |
---|
96 | |
---|
97 | /** |
---|
98 | * \brief This function implements the pure OpenGL draw by calling Vista2D's draw funtion. |
---|
99 | * |
---|
100 | * Because Visrta2D manipulates OpenGLs stateset, this function saves the |
---|
101 | * OSG statset at the beginning and restores it after the drawing of Vista2D |
---|
102 | * |
---|
103 | * @param renderInfo : Renderinfo of the drawing |
---|
104 | */ |
---|
105 | void drawImplementation(osg::RenderInfo& renderInfo) const; |
---|
106 | |
---|
107 | /** |
---|
108 | * Pointer to Vista2D's view instance. |
---|
109 | */ |
---|
110 | Vista2D::VistaView* view; |
---|
111 | }; |
---|
112 | |
---|
113 | } // END NAMESPACE |
---|