Changeset 1076 for GTP/trunk/Lib/Vis


Ignore:
Timestamp:
07/05/06 10:43:45 (18 years ago)
Author:
mattausch
Message:

version for performance testing

Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/TestPreprocessor.vcproj

    r1011 r1076  
    7373                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 
    7474                                RuntimeLibrary="2" 
     75                                RuntimeTypeInfo="TRUE" 
    7576                                UsePrecompiledHeader="0" 
    7677                                WarningLevel="3" 
     
    8586                                LinkIncremental="1" 
    8687                                AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;"$(QTDIR)\lib";..\include;..\src\GL;"$(CG_LIB_PATH)";"$(GTPDIR)\NonGTP\Xerces";"$(GTPDIR)\NonGTP\Xerces\xercesc\lib";"$(GTPDIR)\NonGTP\zlib\lib";"$(GTPDIR)\NonGTP\Devil\lib";..\lib\release;..\..\Preprocessing\lib\release" 
    87                                 GenerateDebugInformation="FALSE" 
     88                                GenerateDebugInformation="TRUE" 
    8889                                SubSystem="1" 
    8990                                OptimizeReferences="2" 
    9091                                EnableCOMDATFolding="2" 
    91                                 TargetMachine="1"/> 
     92                                TargetMachine="1" 
     93                                FixedBaseAddress="1"/> 
    9294                        <Tool 
    9395                                Name="VCMIDLTool"/> 
     
    133135                        UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> 
    134136                </Filter> 
     137                <File 
     138                        RelativePath=".\VTune\TestPreprocessor.vpj"> 
     139                </File> 
    135140        </Files> 
    136141        <Globals> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp

    r1074 r1076  
    7474KdTree::Construct() 
    7575{ 
     76 
    7677  if (!splitCandidates) 
    7778    splitCandidates = new vector<SortableEntry>; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp

    r1020 r1076  
    7272{ 
    7373        Cleanup(); 
    74     
     74  
    7575        ComputeBoundingBox(); 
    76     
     76  
    7777        /** true if it is a watertight convex mesh  
    7878        */ 
     
    8888                 
    8989                cout<<"KD"; 
     90                 
    9091                mKdTree->Construct(); 
    9192 
     
    480481 
    481482        Plane3 plane = Plane3(mVertices[face->mVertexIndices[0]], 
    482                                                                                                 mVertices[face->mVertexIndices[1]], 
    483                                                                                                 mVertices[face->mVertexIndices[2]]); 
     483                                                  mVertices[face->mVertexIndices[1]], 
     484                                                  mVertices[face->mVertexIndices[2]]); 
    484485         
    485486        if (!eq(Magnitude(plane.mNormal), 1.0f)) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.cpp

    r863 r1076  
    44 
    55namespace GtpVisibilityPreprocessor { 
     6 
     7 
     8Plane3::Plane3(const Vector3 &a, 
     9                           const Vector3 &b, 
     10                           const Vector3 &c)  
     11{ 
     12    Vector3 v1=a-b, v2=c-b; 
     13    mNormal = Normalize(CrossProd(v2,v1)); 
     14    mD = -DotProd(b, mNormal); 
     15} 
     16 
     17Plane3::Plane3(const Vector3 &normal, 
     18                           const Vector3 &point): 
     19mNormal(normal) 
     20{ 
     21    mD = -DotProd(normal, point); 
     22} 
    623 
    724 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.h

    r1047 r1076  
    1919                 const Vector3 &b, 
    2020                 const Vector3 &c 
    21          ) { 
    22     Vector3 v1=a-b, v2=c-b; 
    23     mNormal = Normalize(CrossProd(v2,v1)); 
    24     mD = -DotProd(b, mNormal); 
    25   } 
     21         ); 
    2622 
    2723  Plane3(const Vector3 &normal, 
    2824                 const Vector3 &point 
    29                  ):mNormal(normal) 
    30   { 
    31     mD = -DotProd(normal, point); 
    32   } 
     25                 ); 
    3326 
    3427  void ReverseOrientation() 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp

    r863 r1076  
    1111Polygon3::Polygon3():  
    1212mMaterial(NULL), mParent(NULL), mPiercingRays(0) 
     13, mPlane(NULL) 
    1314{ 
    1415        // mostly there will be triangles 
     
    1819Polygon3::Polygon3(const VertexContainer &vertices):  
    1920mMaterial(NULL), mParent(NULL), mPiercingRays(0) 
     21, mPlane(NULL) 
    2022{ 
    2123        mVertices.reserve(vertices.size()); 
     
    2628Polygon3::Polygon3(MeshInstance *parent):  
    2729mMaterial(NULL), mParent(parent), mPiercingRays(0) 
     30, mPlane(NULL) 
    2831{} 
    2932 
     
    3134Polygon3::Polygon3(Face *face, Mesh *parentMesh): 
    3235mMaterial(NULL), mParent(NULL), mPiercingRays(0) 
     36, mPlane(NULL) 
    3337{        
    3438        mVertices.reserve(face->mVertexIndices.size()); 
     
    4448 
    4549 
    46 Plane3 Polygon3::GetSupportingPlane() const 
    47 { 
     50Plane3 Polygon3::GetSupportingPlane()// const 
     51{ 
     52#if 0 
    4853        return Plane3(mVertices[0], mVertices[1], mVertices[2]); 
     54#else 
     55        if (!mPlane) 
     56                mPlane = new Plane3(mVertices[0], mVertices[1], mVertices[2]); 
     57        return *mPlane; 
     58#endif 
    4959} 
    5060 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.h

    r860 r1076  
    4646        /** Returns supporting plane of this polygon. 
    4747        */ 
    48         Plane3 GetSupportingPlane() const; 
     48        Plane3 GetSupportingPlane(); //const; 
    4949 
    5050        /** Splits polygon. 
     
    156156        RayContainer mPiercingRays; 
    157157 
     158        ~Polygon3() {DEL_PTR(mPlane);} 
     159        Plane3 *mPlane; 
     160 
    158161}; 
    159162 
  • GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp

    r1004 r1076  
    4646                                 const bool loadPolygonsAsMeshese) 
    4747{ 
    48    
    4948  map<string, Vector3, ltstr> vht; // hash table for vectors 
    5049  map<string, Vector3, ltstr> cht; // hash table for colors 
     
    139138                vertexIndices.push_back(index); 
    140139      } 
    141        
     140     
    142141      face = new Face(vertexIndices); 
    143142       
    144143      fscanf(file,"%s",str);   // get the next vertex label 
    145        
     144     
    146145      if (str[0]!=';') { 
    147146        c = cht.find(str); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r1074 r1076  
    629629 
    630630 
     631        // first node is kd node, i.e. an axis aligned box 
     632        if (1) 
     633        tData.mIsKdNode = true; 
     634        else 
     635                tData.mIsKdNode = false; 
     636 
    631637        // compute first split candidate 
    632638        VspBspSplitCandidate splitCandidate; 
     
    793799                        // if it was a kd node (i.e., a box) and the split axis is axis aligned, it is still a kd node 
    794800                        tFrontData.mIsKdNode = tBackData.mIsKdNode = (tData.mIsKdNode && (splitAxis < 3)); 
     801                         
    795802                        tFrontData.mAxis = tBackData.mAxis = splitAxis; 
    796803 
     
    15391546        //Debug << "use special axis: " << useSpecialAxis << endl; 
    15401547        //Debug << "axis: " << sAxis << " drivingaxis: " << box.Size().DrivingAxis(); 
    1541  
     1548         
    15421549        for (axis = 0; axis < 3 ; ++ axis) 
    15431550        { 
     
    15601567                                nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 
    15611568                                Vector3 normal(0,0,0); normal[axis] = 1.0f; 
    1562  
     1569                                 
    15631570                                // allows faster split because we have axis aligned kd tree boxes 
    15641571                                if (isKdNode) 
     
    22622269 
    22632270 
    2264 void VspBspTree::AddObjToPvs(Intersectable *obj, 
    2265                                                         const int cf, 
    2266                                                         float &frontPvs, 
    2267                                                         float &backPvs, 
    2268                                                         float &totalPvs) const 
     2271inline void VspBspTree::AddObjToPvs(Intersectable *obj, 
     2272                                                                                const int cf, 
     2273                                                                                float &frontPvs, 
     2274                                                                                float &backPvs, 
     2275                                                                                float &totalPvs) const 
    22692276{ 
    22702277        if (!obj) 
    22712278                return; 
    2272  
     2279#if 0 
    22732280        const float renderCost = mViewCellsManager->EvalRenderCost(obj); 
    2274  
     2281#else 
     2282        const int renderCost = 1; 
     2283#endif 
    22752284        // new object 
    22762285        if ((obj->mMailbox != sFrontId) && 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp

    r1074 r1076  
    377377        //-- debug output 
    378378 
    379         Debug << "******* VSP BSP options ******** " << endl; 
     379        Debug << "******* VSP options ******** " << endl; 
    380380    Debug << "max depth: " << mTermMaxDepth << endl; 
    381381        Debug << "min PVS: " << mTermMinPvs << endl; 
     
    16411641                return; 
    16421642 
    1643         const float renderCost = mViewCellsManager->EvalRenderCost(obj); 
     1643        //const float renderCost = mViewCellsManager->EvalRenderCost(obj); 
     1644        const int renderCost = 1; 
    16441645 
    16451646        // new object 
     
    27352736        //-- debug output 
    27362737 
    2737         Debug << "******* VSP BSP options ******** " << endl; 
     2738        Debug << "******* OSP options ******** " << endl; 
    27382739    Debug << "max depth: " << mTermMaxDepth << endl; 
    27392740        Debug << "min PVS: " << mTermMinPvs << endl; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp

    r1074 r1076  
    566566  cout << "use view space box=" << mUseViewSpaceBox<<endl; 
    567567 
    568  
     568   
    569569  if (mUseViewSpaceBox) 
    570570  { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r1005 r1076  
    9090  } 
    9191   
    92  
    9392  QApplication *app = NULL; 
    9493 
     
    110109  Environment::GetSingleton()->GetStringValue("Scene.filename", buff); 
    111110  string filename(buff); 
     111  
    112112  p->LoadScene(filename); 
    113113   
Note: See TracChangeset for help on using the changeset viewer.