VncClient 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
  2. *
  3. * This library is open source and may be redistributed and/or modified under
  4. * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
  5. * (at your option) any later version. The full license is in LICENSE file
  6. * included with this distribution, and on the openscenegraph.org website.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * OpenSceneGraph Public License for more details.
  12. */
  13. #ifndef OSGWIDGET_VNCCLIENT
  14. #define OSGWIDGET_VNCCLIENT
  15. #include <osgDB/ReaderWriter>
  16. #include <osgWidget/PdfReader>
  17. namespace osgWidget {
  18. /** Pure virtual base class for VncImage that is sublcassed by vnc plugin to provide the actual implementation.*/
  19. class VncImage : public osg::Image
  20. {
  21. public:
  22. VncImage() {}
  23. virtual bool connect(const std::string& hostname) = 0;
  24. virtual void close() = 0;
  25. protected:
  26. virtual ~VncImage() {}
  27. };
  28. /** Convenience Vnc Client class that provides a interactive quad that can be placed directly in the scene.*/
  29. class OSGWIDGET_EXPORT VncClient : public osg::Geode
  30. {
  31. public:
  32. VncClient() {}
  33. VncClient(const std::string& hostname, const GeometryHints& hints = GeometryHints());
  34. bool assign(VncImage* vncImage, const GeometryHints& hints = GeometryHints());
  35. bool connect(const std::string& hostname, const GeometryHints& hints = GeometryHints());
  36. void close();
  37. protected:
  38. osg::ref_ptr<VncImage> _vncImage;
  39. };
  40. }
  41. #endif