Changeset 1151 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 07/25/06 18:20:07 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r1146 r1151 78 78 79 79 public: 80 ObjectContainer mObjects; 81 82 Vector3 mViewPoint; 83 Vector3 mViewDirection; 84 85 int timerId; 86 bool mUseFalseColors; 87 bool mUseForcedColors; 88 89 HaltonSequence halton; 90 91 int mFrame; 92 bool mWireFrame; 93 94 bool mDetectEmptyViewSpace; 95 bool mSnapErrorFrames; 96 97 bool mUseGlLists; 98 99 string mSnapPrefix; 100 101 KdTree *mKdTree; 102 103 //QWaitCondition mRenderingFinished; 104 105 vector<OcclusionQuery *> mOcclusionQueries; 106 80 107 81 GlRenderer(SceneGraph *sceneGraph, 108 82 ViewCellsManager *viewcells, 109 83 KdTree *tree); 110 84 85 GlRenderer() {} 86 111 87 virtual ~GlRenderer(); 112 88 … … 140 116 141 117 int GetId(int r, int g, int b) const; 118 119 inline const bool GetSnapErrorFrames() { return mSnapErrorFrames; } 120 inline const string GetSnapPrefix() { return mSnapPrefix; } 121 122 inline void SetSnapErrorFrames(bool snapframes) { mSnapErrorFrames = snapframes; } 123 inline void SetSnapPrefix(const string &pref) { mSnapPrefix = pref; } 124 125 protected: 126 127 128 vector<OcclusionQuery *> mOcclusionQueries; 129 130 ObjectContainer mObjects; 131 132 Vector3 mViewPoint; 133 Vector3 mViewDirection; 134 135 int timerId; 136 bool mUseFalseColors; 137 bool mUseForcedColors; 138 139 HaltonSequence halton; 140 141 int mFrame; 142 bool mWireFrame; 143 144 bool mDetectEmptyViewSpace; 145 bool mSnapErrorFrames; 146 147 bool mUseGlLists; 148 149 string mSnapPrefix; 150 151 KdTree *mKdTree; 152 142 153 }; 143 154 … … 147 158 { 148 159 149 //Q_OBJECT150 160 public: 161 151 162 GlRendererBuffer(SceneGraph *sceneGraph, 152 163 ViewCellsManager *viewcells, … … 259 270 /** Abstract class for implmenenting a gl render widget. 260 271 */ 261 class GlRender Widget272 class GlRendererWidget: public GlRenderer 262 273 { 263 274 public: 264 275 265 GlRenderWidget(SceneGraph *sceneGraph, ViewCellsManager *vcm, KdTree *kdTree): 266 mSceneGraph(sceneGraph), mViewCellsManager(vcm), mKdTree(kdTree) 267 { 268 } 269 270 271 GlRenderWidget() {} 272 273 virtual ~GlRenderWidget() {} 276 GlRendererWidget(SceneGraph *sceneGraph, ViewCellsManager *vcm, KdTree *kdTree): 277 GlRenderer(sceneGraph, vcm, kdTree) 278 {} 279 280 GlRendererWidget() {} 281 282 virtual ~GlRendererWidget() {} 274 283 275 284 //virtual void Create() {} … … 285 294 }; 286 295 296 //extern GlRendererWidget *rendererWidget; 297 287 298 }; 288 299 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r1150 r1151 841 841 sprintf(buf, "snap/i-%02d-", mPass); 842 842 843 renderer-> mSnapPrefix = buf;843 renderer->SetSnapPrefix(buf); 844 844 } 845 845 else … … 847 847 sprintf(buf, "snap/r-%02d-", mPass); 848 848 849 renderer-> mSnapPrefix = buf;849 renderer->SetSnapPrefix(buf); 850 850 } 851 851 852 renderer-> mSnapErrorFrames = true;852 renderer->SetSnapErrorFrames(true); 853 853 } 854 854 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1148 r1151 1289 1289 sort(mViewCells.begin(), mViewCells.end(), ViewCell::SmallerPvs); 1290 1290 1291 int start = mViewCells.size() * minValid;1292 int end = mViewCells.size() * maxValid;1293 1294 for (int i = 0; i < mViewCells.size(); ++ i)1291 int start = (int)(mViewCells.size() * minValid); 1292 int end = (int)(mViewCells.size() * maxValid); 1293 1294 for (int i = 0; i < (int)mViewCells.size(); ++ i) 1295 1295 { 1296 1296 mViewCells[i]->SetValid(i >= start && i <= end); -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1146 r1151 1 #include <windows.h> 2 #include <stdio.h> 3 #include <crtdbg.h> 4 1 5 #include "SamplingPreprocessor.h" 2 6 #include "VssPreprocessor.h" … … 19 23 #define USE_EXE_PATH false 20 24 21 #include <crtdbg.h>22 25 23 26 using namespace GtpVisibilityPreprocessor; 24 27 25 28 Preprocessor *preprocessor = NULL; 26 GlRenderWidget *renderWidget = NULL; 29 GlRendererWidget *rendererWidget = NULL; 30 31 // DLL function signature 32 typedef GlRendererWidget *(*importFunction)(); 33 34 int LoadMyDll() 35 { 36 importFunction LoadRenderWidget; 37 38 // Load DLL file 39 HINSTANCE hinstLib = LoadLibrary("QtRenderer.dll"); 40 41 if (hinstLib == NULL) 42 { 43 cout << "ERROR: unable to load DLL\n"; 44 return 1; 45 } 46 47 // Get function pointer 48 LoadRenderWidget = (importFunction)GetProcAddress(hinstLib, "LoadRenderWidget"); 49 50 if (LoadRenderWidget == NULL) 51 { 52 cout << "ERROR: unable to find DLL function\n"; 53 return 1; 54 } 55 56 // load the render window 57 rendererWidget = LoadRenderWidget(); 58 59 return 0; 60 } 61 27 62 28 63 29 64 void Cleanup() 30 65 { 31 DEL_PTR(render Widget);66 DEL_PTR(rendererWidget); 32 67 DEL_PTR(preprocessor); 33 68 … … 40 75 void DisplayWidget() 41 76 { 77 if (!rendererWidget) 78 LoadMyDll(); 79 42 80 // note matt: capsulate qt dependent code as good as possible 43 renderWidget = 44 new GlRenderWidget(preprocessor->mSceneGraph, 81 /*new GlRendererWidget(preprocessor->mSceneGraph, 45 82 preprocessor->mViewCellsManager, 46 83 preprocessor->mKdTree); 47 48 render Widget->Show();84 */ 85 rendererWidget->Show(); 49 86 50 87 #if QT_ENABLED
Note: See TracChangeset
for help on using the changeset viewer.