Ignore:
Timestamp:
01/16/08 22:52:29 (16 years ago)
Author:
bittner
Message:

sse disabled for hr

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

Legend:

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

    r2575 r2603  
    1919#ifdef USE_HAVRAN_RAYCASTER  
    2020//#include "timer.h" 
     21#include "ktbconf.h" 
    2122#include "raypack.h" 
    2223#endif 
     
    290291                        ) 
    291292{ 
    292 #ifdef USE_HAVRAN_RAYCASTER  
     293#if defined(USE_HAVRAN_RAYCASTER) && defined(_USE_HAVRAN_SSE) 
    293294   
    294295  int x; 
     
    314315  //CTimer timer; 
    315316  //timer.Start(); 
    316  
     317   
    317318  RayPacket2x2 rp; 
    318319  for (y = 0; y < mHeight-1; y+=2) { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp

    r2602 r2603  
    1010#include "Preprocessor.h" 
    1111#include "IntersectableWrapper.h" 
     12#include "Environment.h" 
    1213 
    1314#ifdef USE_HAVRAN_RAYCASTER 
     
    3233 
    3334 
     35 
    3436#ifdef USE_HAVRAN_RAYCASTER  
    3537#ifdef _USE_HAVRAN_SSE 
     
    6264{ 
    6365#ifdef USE_HAVRAN_RAYCASTER  
    64  
    65   CTimer timer; 
    66  
    67   cout << "\nBuilding up kd-tree for Havran ray caster ..."<<endl<<flush; 
    68  
    69   timer.Start(); 
    70   mKtbtree->BuildUp(objlist); 
    71   timer.Stop(); 
    72   cout << "\nBuilding up kd-tree is finished, user time = " 
    73        << timer.UserTime() << " real time = " << timer.RealTime() << 
    74         endl <<flush; 
     66  char buff[256]; 
     67  Environment::GetSingleton()->GetStringValue("Scene.filename", buff); 
     68  string filename(buff); 
     69  const string kdfile = ReplaceSuffix(filename, ".obj", ".kdh"); 
     70 
     71  if (!ImportBinTree(kdfile, objlist)) { 
     72        cout << "\nKd-tree for Havran ray caster imported."<<endl<<flush; 
     73  } else { 
     74        CTimer timer; 
     75        cout << "\nBuilding up kd-tree for Havran ray caster ..."<<endl<<flush; 
     76         
     77        timer.Start(); 
     78        mKtbtree->BuildUp(objlist); 
     79        timer.Stop(); 
     80        cout << "\nBuilding up kd-tree is finished, user time = " 
     81                 << timer.UserTime() << " real time = " << timer.RealTime() << 
     82          endl <<flush; 
     83        ExportBinTree(kdfile); 
     84  } 
    7585#endif 
    7686} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r2602 r2603  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: st 16. I 21:20:04 2008 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: st 16. I 22:10:45 2008 
    44# Project:  preprocessor.pro 
    55# Template: app 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2601 r2603  
    156156 
    157157 
    158 static int SplitFilenames(const string str, vector<string> &filenames) 
    159 { 
    160         int pos = 0; 
    161  
    162         while(1) { 
    163                 int npos = (int)str.find(';', pos); 
    164                  
    165                 if (npos < 0 || npos - pos < 1) 
    166                         break; 
    167                 filenames.push_back(string(str, pos, npos - pos)); 
    168                 pos = npos + 1; 
    169         } 
    170          
    171         filenames.push_back(string(str, pos, str.size() - pos)); 
    172         return (int)filenames.size(); 
    173 } 
    174158 
    175159 
     
    331315} 
    332316 
    333 static string ReplaceSuffix(const string &filename, string a, string b) 
    334 { 
    335         string result = filename; 
    336  
    337         int pos = (int)filename.rfind(a, (int)filename.size() - 1); 
    338         if (pos == filename.size() - a.size()) { 
    339                 result.replace(pos, a.size(), b); 
    340         } 
    341         return result; 
    342 } 
    343317 
    344318 
     
    10711045        //      return true; 
    10721046  } 
    1073  
     1047   
    10741048   
    10751049  if (!mUseKdTree) { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/common.cpp

    r2187 r2603  
    8181{ 
    8282  srand(seed); 
     83} 
     84 
     85 
     86string 
     87ReplaceSuffix(const string &filename, const string &a, const string &b) 
     88{ 
     89        string result = filename; 
     90 
     91        int pos = (int)filename.rfind(a, (int)filename.size() - 1); 
     92        if (pos == filename.size() - a.size())  
     93        { 
     94                result.replace(pos, a.size(), b); 
     95        } 
     96 
     97        return result; 
     98} 
     99 
     100 
     101int 
     102SplitFilenames(const string &str, vector<string> &filenames) 
     103{ 
     104        int pos = 0; 
     105 
     106        while(1) { 
     107                int npos = (int)str.find(';', pos); 
     108                 
     109                if (npos < 0 || npos - pos < 1) 
     110                        break; 
     111                filenames.push_back(string(str, pos, npos - pos)); 
     112                pos = npos + 1; 
     113        } 
     114         
     115        filenames.push_back(string(str, pos, str.size() - pos)); 
     116        return (int)filenames.size(); 
    83117} 
    84118 
  • GTP/trunk/Lib/Vis/Preprocessing/src/common.h

    r2588 r2603  
    1919#include <iostream> 
    2020#include <fstream> 
     21#include <string> 
    2122#include <limits.h> 
    22  
     23#include <vector> 
    2324 
    2425 
     
    489490strdup(char *a); 
    490491 
     492std::string 
     493ReplaceSuffix(const std::string &filename, const std::string &a, const std::string &b); 
     494 
     495 
     496int 
     497SplitFilenames(const std::string &str, std::vector<std::string> &filenames); 
     498 
    491499bool 
    492500FileExists(char *filename); 
     
    511519StripPath(const char *s); 
    512520} 
     521 
    513522 
    514523 
  • GTP/trunk/Lib/Vis/Preprocessing/src/havran/ktball.cpp

    r2602 r2603  
    1111 
    1212// GOLEM library 
     13#include "ktbconf.h" 
    1314#include "ktb.h" 
    1415#include "ktbai.h" 
     
    925926 
    926927  if (!stream.is_open()) { 
    927     cerr << "Kd-tree description file (.kbt) cannot be opened for reading\n"; 
     928    cerr << "Kd-tree description file (.kdh) cannot be opened for reading\n"; 
    928929    return true; // error 
    929930  } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/havran/ktbconf.h

    r2602 r2603  
    2424 
    2525// If we support the use of SSE instructions for ray shooting 
    26 //#define _USE_HAVRAN_SSE 
     26// #define _USE_HAVRAN_SSE 
    2727 
    2828namespace GtpVisibilityPreprocessor { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r2598 r2603  
    7272 
    7373 
    74 static string ReplaceSuffix(const string &filename, const string &a, const string &b) 
    75 { 
    76         string result = filename; 
    77  
    78         int pos = (int)filename.rfind(a, (int)filename.size() - 1); 
    79         if (pos == filename.size() - a.size())  
    80         { 
    81                 result.replace(pos, a.size(), b); 
    82         } 
    83  
    84         return result; 
    85 } 
    86  
    87  
    88 static int SplitFilenames(const string &str, vector<string> &filenames) 
    89 { 
    90         int pos = 0; 
    91  
    92         while(1) { 
    93                 int npos = (int)str.find(';', pos); 
    94                  
    95                 if (npos < 0 || npos - pos < 1) 
    96                         break; 
    97                 filenames.push_back(string(str, pos, npos - pos)); 
    98                 pos = npos + 1; 
    99         } 
    100          
    101         filenames.push_back(string(str, pos, str.size() - pos)); 
    102         return (int)filenames.size(); 
    103 } 
    10474 
    10575 
Note: See TracChangeset for help on using the changeset viewer.