Changeset 1457


Ignore:
Timestamp:
09/21/06 23:08:59 (18 years ago)
Author:
bittner
Message:

thread updates

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/BoostPreprocessorThread.cpp

    r1404 r1457  
    2121 
    2222 
    23 void BoostPreprocessorThread::Main() 
    24 { 
    25   Camera camera; 
    26  
    27   if (0) 
    28         { 
    29                 // camera.LookAtBox(mPreprocessor->mKdTree->GetBox()); 
    30                 //      camera.LookInBox(mPreprocessor->mKdTree->GetBox()); 
    31                 camera.SetPosition(Vector3(3473, 6.778f, -1699.0f)); 
    32                 camera.SetDirection(Vector3(-0.2432f, 0, 0.97f)); 
    33                 //      camera.SetPosition(Vector3(991.7, 187.8, -271)); 
    34                 //      camera.SetDirection(Vector3(0.9, 0, -0.4)); 
    35  
    36                 camera.SnapImage("camera.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
    37         }  
    38    
    39   if (0) { 
    40         camera.LookInBox(mPreprocessor->mKdTree->GetBox()); 
    41         camera.SetPosition(camera.mPosition + Vector3(-250,0,-550)); 
    42         camera.SnapImage("camera2.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
    43   } 
    44  
    45   if (0) { 
    46         camera.SetPosition( mPreprocessor->mKdTree->GetBox().Center() - Vector3(0,-100,0) ); 
    47         camera.SetDirection(Vector3(1, 0, 0)); 
    48         camera.SnapImage("camera3.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
    49   } 
    50    
    51   if (mPreprocessor->mComputeVisibility) { 
    52         mPreprocessor->ComputeVisibility(); 
    53         //      mPreprocessor->ExportPreprocessedData("scene.vis"); 
    54         mPreprocessor->PostProcessVisibility(); 
    55   } 
    56    
    57   cerr << "Preprocessor main finished...\n"; 
    58    
    59 } 
    6023 
    6124 
  • GTP/trunk/Lib/Vis/Preprocessing/src/BoostPreprocessorThread.h

    r1146 r1457  
    2222        virtual void RunThread(); 
    2323 
    24         virtual void Main(); 
    2524 
    2625        void operator()(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r1454 r1457  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 21. IX 20:46:44 2006 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 21. IX 22:34:57 2006 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    7171                C:\Qt\4.1.2\mkspecs\features\debug_and_release.prf \ 
    7272                C:\Qt\4.1.2\mkspecs\features\default_post.prf \ 
     73                C:\Qt\4.1.2\mkspecs\features\qt.prf \ 
     74                C:\Qt\4.1.2\mkspecs\features\win32\opengl.prf \ 
     75                C:\Qt\4.1.2\mkspecs\features\moc.prf \ 
    7376                C:\Qt\4.1.2\mkspecs\features\win32\thread.prf \ 
    7477                C:\Qt\4.1.2\mkspecs\features\warn_off.prf \ 
     
    8992C:\Qt\4.1.2\mkspecs\features\debug_and_release.prf: 
    9093C:\Qt\4.1.2\mkspecs\features\default_post.prf: 
     94C:\Qt\4.1.2\mkspecs\features\qt.prf: 
     95C:\Qt\4.1.2\mkspecs\features\win32\opengl.prf: 
     96C:\Qt\4.1.2\mkspecs\features\moc.prf: 
    9197C:\Qt\4.1.2\mkspecs\features\win32\thread.prf: 
    9298C:\Qt\4.1.2\mkspecs\features\warn_off.prf: 
     
    110116distclean: release-distclean debug-distclean FORCE 
    111117        -$(DEL_FILE) Makefile 
     118 
     119release-mocclean: $(MAKEFILE).Release 
     120        $(MAKE) -f $(MAKEFILE).Release mocclean 
     121debug-mocclean: $(MAKEFILE).Debug 
     122        $(MAKE) -f $(MAKEFILE).Debug mocclean 
     123mocclean: release-mocclean debug-mocclean 
     124 
     125release-mocables: $(MAKEFILE).Release 
     126        $(MAKE) -f $(MAKEFILE).Release mocables 
     127debug-mocables: $(MAKEFILE).Debug 
     128        $(MAKE) -f $(MAKEFILE).Debug mocables 
     129mocables: release-mocables debug-mocables 
    112130FORCE: 
    113131 
  • GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp

    r1159 r1457  
    11#include "PreprocessorThread.h" 
     2#include "Camera.h" 
     3#include "KdTree.h" 
     4#include "SceneGraph.h" 
     5#include "Preprocessor.h" 
    26 
    37 
     
    1519} 
    1620 
     21void 
     22PreprocessorThread::Main() 
     23{ 
     24  Camera camera; 
     25   
     26  if (0) 
     27        { 
     28                // camera.LookAtBox(mPreprocessor->mKdTree->GetBox()); 
     29                //      camera.LookInBox(mPreprocessor->mKdTree->GetBox()); 
     30                camera.SetPosition(Vector3(3473, 6.778f, -1699.0f)); 
     31                camera.SetDirection(Vector3(-0.2432f, 0, 0.97f)); 
     32                //      camera.SetPosition(Vector3(991.7, 187.8, -271)); 
     33                //      camera.SetDirection(Vector3(0.9, 0, -0.4)); 
     34 
     35                camera.SnapImage("camera.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
     36        }  
     37   
     38  if (0) { 
     39        camera.LookInBox(mPreprocessor->mKdTree->GetBox()); 
     40        camera.SetPosition(camera.mPosition + Vector3(-250,0,-550)); 
     41        camera.SnapImage("camera2.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
     42  } 
     43 
     44  if (0) { 
     45        camera.SetPosition( mPreprocessor->mKdTree->GetBox().Center() - Vector3(0,-100,0) ); 
     46        camera.SetDirection(Vector3(1, 0, 0)); 
     47        camera.SnapImage("camera3.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
     48  } 
     49   
     50  if (mPreprocessor->mComputeVisibility) { 
     51        mPreprocessor->ComputeVisibility(); 
     52        //      mPreprocessor->ExportPreprocessedData("scene.vis"); 
     53        mPreprocessor->PostProcessVisibility(); 
     54  } 
     55   
     56  cerr << "Preprocessor main finished...\n"; 
     57   
     58} 
     59 
    1760 
    1861/*PreprocessorThread *PreprocessorThreadFactory::Create(const int threadType) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.h

    r1387 r1457  
    1616  virtual ~PreprocessorThread(); 
    1717   
    18   virtual void InitThread() = 0; 
    19   virtual void RunThread() = 0; 
    20  
    21   virtual void Main() = 0; 
     18  virtual void InitThread() {} 
     19  virtual void RunThread() {} 
     20   
     21  virtual void Main(); 
     22   
    2223protected: 
    2324   
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtPreprocessorThread.cpp

    r1387 r1457  
    2020} 
    2121 
    22 void 
    23 QtPreprocessorThread::Main() 
    24 { 
    25    
    26   Camera camera; 
    27    
    28   if (0) 
    29         { 
    30                 // camera.LookAtBox(mPreprocessor->mKdTree->GetBox()); 
    31                 //      camera.LookInBox(mPreprocessor->mKdTree->GetBox()); 
    32                 camera.SetPosition(Vector3(3473, 6.778f, -1699.0f)); 
    33                 camera.SetDirection(Vector3(-0.2432f, 0, 0.97f)); 
    34                 //      camera.SetPosition(Vector3(991.7, 187.8, -271)); 
    35                 //      camera.SetDirection(Vector3(0.9, 0, -0.4)); 
    36  
    37                 camera.SnapImage("camera.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
    38         }  
    39    
    40   if (0) { 
    41         camera.LookInBox(mPreprocessor->mKdTree->GetBox()); 
    42         camera.SetPosition(camera.mPosition + Vector3(-250,0,-550)); 
    43         camera.SnapImage("camera2.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
    44   } 
    45  
    46   if (0) { 
    47         camera.SetPosition( mPreprocessor->mKdTree->GetBox().Center() - Vector3(0,-100,0) ); 
    48         camera.SetDirection(Vector3(1, 0, 0)); 
    49         camera.SnapImage("camera3.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph); 
    50   } 
    51    
    52   if (mPreprocessor->mComputeVisibility) { 
    53         mPreprocessor->ComputeVisibility(); 
    54         //      mPreprocessor->ExportPreprocessedData("scene.vis"); 
    55         mPreprocessor->PostProcessVisibility(); 
    56   } 
    57    
    58   cerr << "Preprocessor main finished...\n"; 
    59    
    60    
    61 } 
    6222 
    6323QtPreprocessorThread::~QtPreprocessorThread() 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtPreprocessorThread.h

    r1387 r1457  
    1616  ~QtPreprocessorThread(); 
    1717   
    18   void Main(); 
    1918  void InitThread() {} 
    2019  void RunThread() { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r1454 r1457  
    22//#define USE_QT 0 
    33#endif 
    4 //#define USE_QT 0 
    5 #define USE_THREADS 1 
     4 
     5#define USE_QT 0 
     6#if USE_QT 
     7#define USE_BOOST 0 
     8#else 
     9#define USE_BOOST 0 
     10#endif 
    611 
    712#ifdef UNICODE 
     
    2732#include "SceneGraph.h" 
    2833 
    29 #if USE_THREADS && !USE_QT 
     34#include "PreprocessorThread.h" 
     35#if USE_BOOST 
    3036#include "BoostPreprocessorThread.h" 
    3137#endif 
     
    209215        // create a preprocessor thread (note: capsulates calls to boost fuctions!) 
    210216        //PreprocessorThread *pt = PreprocessorThreadFactory::Create(preprocessor); 
    211 #if USE_THREADS 
    212217        PreprocessorThread *pt; 
    213218 
     
    215220        pt = new QtPreprocessorThread(preprocessor); 
    216221#else 
     222#if USE_BOOST 
    217223        pt = new BoostPreprocessorThread(preprocessor); 
    218 #endif 
     224#else 
     225        pt = new PreprocessorThread(preprocessor); 
     226#endif   
    219227#endif 
    220228 
     
    225233                cout << "using gl widget" << endl; 
    226234                // create and run the preprocessor application in a parallel thread 
     235#if USE_QT               
    227236#if USE_THREADS 
    228237                pt->InitThread(); 
     
    230239#endif 
    231240                 
    232 #if USE_QT               
    233241                // display the render widget 
    234242                if (!rendererWidget)  
     
    264272        if (!(preprocessor->mUseGlRenderer || preprocessor->mUseGlDebugger)) { 
    265273          // just call the mail method -> will be executed in the main thread 
    266 #if USE_THREADS 
    267274          pt->Main(); 
    268 #endif 
    269275        } 
    270276         
  • GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro

    r1454 r1457  
    11CONFIG -= qt debug 
    2 CONFIG  += console warn_off thread release 
    3 #mlrt qt 
     2CONFIG  += console warn_off thread release mlrt qt 
    43 
    54TEMPLATE = app 
Note: See TracChangeset for help on using the changeset viewer.