2012-03-22 01:36:20 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
|
2008-12-08 01:02:30 +08:00
|
|
|
*
|
2012-03-22 01:36:20 +08:00
|
|
|
* This library is open source and may be redistributed and/or modified under
|
|
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
2008-12-08 01:02:30 +08:00
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
2012-03-22 01:36:20 +08:00
|
|
|
*
|
2008-12-08 01:02:30 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-03-22 01:36:20 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2008-12-08 01:02:30 +08:00
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OSGWIDGET_VNCCLIENT
|
|
|
|
#define OSGWIDGET_VNCCLIENT
|
|
|
|
|
|
|
|
#include <osgDB/ReaderWriter>
|
|
|
|
|
|
|
|
#include <osgWidget/PdfReader>
|
|
|
|
|
|
|
|
namespace osgWidget {
|
|
|
|
|
|
|
|
/** Pure virtual base class for VncImage that is sublcassed by vnc plugin to provide the actual implementation.*/
|
|
|
|
class VncImage : public osg::Image
|
|
|
|
{
|
|
|
|
public:
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-12-08 01:02:30 +08:00
|
|
|
VncImage() {}
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-12-08 01:02:30 +08:00
|
|
|
virtual bool connect(const std::string& hostname) = 0;
|
|
|
|
|
|
|
|
virtual void close() = 0;
|
|
|
|
|
|
|
|
protected:
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-12-08 01:02:30 +08:00
|
|
|
virtual ~VncImage() {}
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-12-08 01:02:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** Convinience Vnc Client class that provides a interactive quad that can be placed directly in the scene.*/
|
|
|
|
class OSGWIDGET_EXPORT VncClient : public osg::Geode
|
|
|
|
{
|
|
|
|
public:
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-12-08 01:02:30 +08:00
|
|
|
VncClient() {}
|
|
|
|
|
2008-12-09 19:05:04 +08:00
|
|
|
VncClient(const std::string& hostname, const GeometryHints& hints = GeometryHints());
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-12-09 19:05:04 +08:00
|
|
|
bool assign(VncImage* vncImage, const GeometryHints& hints = GeometryHints());
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-12-09 19:05:04 +08:00
|
|
|
bool connect(const std::string& hostname, const GeometryHints& hints = GeometryHints());
|
2008-12-08 01:02:30 +08:00
|
|
|
|
|
|
|
void close();
|
|
|
|
|
|
|
|
protected:
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-12-08 01:02:30 +08:00
|
|
|
osg::ref_ptr<VncImage> _vncImage;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|