vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LoadingConsole.h
Go to the documentation of this file.
1 #ifndef LOADINGCONSOLE_H
2 #define LOADINGCONSOLE_H
3 
4 #include "precompiled.h"
5 
6 
7 /* The loading console is used while loading, so it must not be a descendant of the Ability class
8  and should not use the [world] pointer or anything similar. */
9 
11 public:
14 
15  bool create(vrecko::ViewerBase *_viewer, osg::Group *_rootNode);
16  void destroy();
17 
18  // Can be called from any thread, just puts the line into the array of waiting (outstanding) lines
19  void addLine(unsigned long dwOutputType, const char *outputLine);
20 
21  // Processes any outstanding lines, creates graphics etc.
22  void update();
23 
24 protected:
25  class Line {
26  public:
27  Line(osgText::Text *_text) { text = _text; };
28  osg::ref_ptr<osgText::Text> text;
29  };
30 
32  public:
33  OutstandingLine(unsigned long _dwType, const char *_line) : line(_line), dwType(_dwType) {};
34  std::string line;
35  unsigned long dwType;
36  };
37 
38  std::vector<Line> lines;
39 
41  std::vector<OutstandingLine> outstandingLines; // USE [olLock] before accessing this array
42 
43 
44  vrecko::ViewerBase *viewer; // these are NOT our data, do not destroy it
45  osg::Group *rootNode; // these are NOT our data, do not destroy it
46 
47 
50 
51  osg::ref_ptr<osg::Vec3Array> vertices;
52 
53  osg::ref_ptr<osg::ClipNode> mainNode;
54  osg::ref_ptr<osg::Camera> camera;
55  osg::ref_ptr<osg::Geode> geode;
56  osg::ref_ptr<osg::Geometry> geom;
57 };
58 
59 
60 #endif