VR-Forces 4.2 Class Documentation
featureDebugger.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <features/featureSet.h>
14 
15 #include <tbb/mutex.h>
16 #include <tbb/compat/condition_variable>
17 
18 #include <boost/ptr_container/ptr_vector.hpp>
19 
23 
24 namespace MAKVRinTerra
25 {
26  class DtSharedMemoryFeaturesDebugDrawer;
27  class DtAttributeConfigParser;
28  class DtUnusedFeatureTileTracker;
29 
30  template <typename FS>
31  class DtPagingFeatureSet;
32 
34  : public boost::enable_shared_from_this<DtFeaturesDebugger>
35  {
36  public:
37  typedef boost::shared_ptr<DtFeaturesDebugger> Ptr;
38 
42  boost::shared_ptr<DtAttributeConfigParser> = boost::shared_ptr<DtAttributeConfigParser>(),
43  boost::shared_ptr<DtUnusedFeatureTileTracker> = boost::shared_ptr<DtUnusedFeatureTileTracker>(),
44  DtConsoleCommandManager* manager = 0);
45 
47 
53 
54  template <typename F>
55  void add(DtFeatureSetTemplate<F>* fs, bool draw = false, std::string label = std::string());
56 
57  template <typename FS>
58  void add(DtPagingFeatureSet<FS>* fs, bool draw = false, std::string label = std::string());
60 
62 
63  DtFeaturesDebugger& operator[](const std::string& key);
64  const DtFeaturesDebugger& operator[](const std::string& key) const;
66 
68  bool loadConfig(std::string);
69 
71  std::string printConfig() const;
72 
74  bool createFiltered(std::string newname, unsigned set, std::string query);
75 
77  bool createTransformed(std::string newname, unsigned set);
78 
80  std::string listFeatureSets(std::string params) const;
81 
83  bool printFeatureSet(
84  std::ostream&, unsigned set, unsigned max=0, std::string attributes = std::string()) const;
85 
87  std::string info() const;
88 
90  bool draw(std::string sets);
91 
93  void clearDrawer();
94 
96  void redraw();
97 
99  bool pageInPoint(unsigned set, double x, double y);
100 
102  void pageOut(unsigned maxsize);
103 
105  void setProjection(const DtProj&);
106 
108  class Record
109  {
110  public:
111  const boost::scoped_ptr<DtFeatureSet> featureSet;
112  const std::string name;
113 
114  boost::scoped_ptr<DtSharedMemoryFeaturesDebugDrawer> drawer;
115 
116  Record(DtFeatureSet*, std::string);
117 
118  virtual ~Record();
119 
121  virtual Record* clone() const;
122 
124  virtual void setDrawing(bool enable);
125 
127  virtual void setDrawPaging(bool enable);
128 
130  virtual void draw();
131  };
132 
133  private:
134 
136  void doDraw();
137 
138  typedef boost::ptr_vector<Record> RecordVector;
139 
140  typedef tbb::spin_rw_mutex Mutex;
141  typedef tbb::interface5::unique_lock<tbb::mutex> ConditionLock;
142 
143  mutable Mutex myMutex;
144  mutable tbb::mutex myConditionMutex;
145  tbb::interface5::condition_variable myDrawCondition;
146  boost::scoped_ptr<tbb::tbb_thread> myDrawThread;
149 
151  boost::shared_ptr<DtAttributeConfigParser> myAttributeParser;
152  boost::scoped_ptr<DtConsoleCommandManager> myCommandManager;
153  boost::scoped_ptr<DtConsoleCommandOwner> myCommandOwner;
155  boost::shared_ptr<DtUnusedFeatureTileTracker> myUnusedTracker;
156 
157  typedef std::map<std::string, Ptr> SubDebuggers;
159  };
160 }

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)