source: trunk/packages/vizservers/geovis/Renderer.h @ 3998

Last change on this file since 3998 was 3998, checked in by ldelgass, 11 years ago

Add prelimilary skeleton for geovis map rendering server. Not functional, not
integrated into configure, etc.

File size: 1.5 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2004-2013  HUBzero Foundation, LLC
4 *
5 * Author: Leif Delgass <ldelgass@purdue.edu>
6 */
7
8#ifndef GEOVIS_RENDERER_H
9#define GEOVIS_RENDERER_H
10
11#include <string>
12#include <vector>
13#include <tr1/unordered_map>
14#include <typeinfo>
15
16#include <osg/ref_ptr>
17#include <osg/Node>
18#include <osg/Image>
19#include <osgViewer/Viewer>
20
21#include "Types.h"
22#include "Trace.h"
23
24// Controls if TGA format is sent to client
25//#define RENDER_TARGA
26#define TARGA_BYTES_PER_PIXEL 3
27
28namespace GeoVis {
29
30/**
31 * \brief GIS Renderer
32 */
33class Renderer
34{
35public:
36    Renderer();
37    virtual ~Renderer();
38
39    // Render window
40
41    void setWindowSize(int width, int height);
42
43    int getWindowWidth() const
44    {
45        return _windowWidth;
46    }
47
48    int getWindowHeight() const
49    {
50        return _windowHeight;
51    }
52
53    void resetCamera(bool resetOrientation = true);
54
55    void setCameraOrientation(const double quat[4], bool absolute = true);
56
57    void panCamera(double x, double y, bool absolute = true);
58
59    void zoomCamera(double z, bool absolute = true);
60
61    // Rendering an image
62
63    void setBackgroundColor(float color[3]);
64
65    void eventuallyRender();
66
67    bool render();
68
69    void getRenderedFrame(osg::Image *image);
70
71private:
72    void initCamera();
73
74    bool _needsRedraw;
75    int _windowWidth, _windowHeight;
76    float _bgColor[3];
77
78    osg::ref_ptr<osg::Node> _sceneRoot;
79    //osgEarth::Map *_map;
80    osg::ref_ptr<osgViewer::Viewer> _viewer;
81};
82
83}
84
85#endif
Note: See TracBrowser for help on using the repository browser.