Changeset 1002


Ignore:
Timestamp:
06/07/06 10:59:55 (18 years ago)
Author:
mattausch
Message:

debug run: fixing memory holes

Location:
GTP/trunk/Lib/Vis
Files:
5 added
28 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformOcclusionQuery.h

    r160 r1002  
    2020        virtual ~PlatformOcclusionQuery(); 
    2121 
    22         virtual bool GetQueryResult(unsigned int &queryResult, 
    23         const bool waitForResult) const; 
     22        virtual bool GetQueryResult(unsigned int &queryResult,  
     23                                                                const bool waitForResult) const; 
    2424        virtual void BeginQuery(); 
    2525        virtual void EndQuery(); 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj

    r1001 r1002  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\GtpVisibility\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include" 
     22                                AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src" 
    2323                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_OCCLUSIONCULLINGSCENEMANAGER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE" 
    2424                                MinimalRebuild="TRUE" 
     
    3636                                Name="VCLinkerTool" 
    3737                                IgnoreImportLibrary="TRUE" 
    38                                 AdditionalDependencies="OgreMain_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib" 
     38                                AdditionalDependencies="OgreMain_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplibd.lib Preprocessor.lib devil.lib glut32.lib xerces-c_2.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib glew32.lib qtmain.lib QtOpenGLd4.lib QtCored4.lib QtGuid4.lib Qt3Supportd4.lib QAxContainer.lib" 
    3939                                OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll" 
    4040                                Version="0.99" 
    4141                                LinkIncremental="1" 
    4242                                SuppressStartupBanner="TRUE" 
    43                                 AdditionalLibraryDirectories=""$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)";"..\lib\$(ConfigurationName)";"..\..\lib\$(ConfigurationName)";"..\..\GtpVisibility\lib\$(ConfigurationName)"" 
     43                                AdditionalLibraryDirectories=""$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"..\lib\$(ConfigurationName)";"..\..\lib\$(ConfigurationName)";"..\..\..\Preprocessing\lib\$(ConfigurationName)";..\..\..\Preprocessing\src\GL;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;"$(QTDIR)\lib";"$(CG_LIB_PATH)"" 
    4444                                ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def" 
    4545                                GenerateDebugInformation="TRUE" 
     
    104104                                Name="VCLinkerTool" 
    105105                                IgnoreImportLibrary="TRUE" 
    106                                 AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplibd.lib Preprocessor.lib xerces-c_2.lib devil.lib qtmain.lib QtOpenGL4.lib QtCored4.lib QtGuid4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib glew32.lib glew32s.lib" 
     106                                AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib qtmain.lib QtOpenGL4.lib QtCore4.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib glew32.lib glew32s.lib" 
    107107                                OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll" 
    108108                                Version="0.99" 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/scripts/GtpVisibility.vcproj

    r938 r1002  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories=""$(OGRE_PATH)\OgreMain\include";..\include" 
     22                                AdditionalIncludeDirectories=""$(OGRE_PATH)\OgreMain\include";..\include;..\..\Preprocessing\src" 
    2323                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB;GTP_VISIBILITY_MODIFIED_OGRE" 
    2424                                MinimalRebuild="TRUE" 
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj

    r1001 r1002  
    1515                        OutputDirectory="..\lib\$(ConfigurationName)" 
    1616                        IntermediateDirectory="..\obj\$(ConfigurationName)" 
    17                         ConfigurationType="1" 
     17                        ConfigurationType="4" 
    1818                        CharacterSet="2"> 
    1919                        <Tool 
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories="..\support;..\support\devil\include;..\support\zlib\include;..\include..\support;&quot;..\include  ..\support&quot;;..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(CG_INC_PATH)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(GTPDIR)\NonGTP\Zlib\include&quot;;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Devil\include;..\src" 
    23                                 PreprocessorDefinitions="WIN32;_DEBUG;_LIB" 
     22                                AdditionalIncludeDirectories="..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;&quot;$(CG_INC_PATH)&quot;;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces" 
     23                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB;" 
    2424                                MinimalRebuild="TRUE" 
    2525                                BasicRuntimeChecks="3" 
     
    3333                                Name="VCCustomBuildTool"/> 
    3434                        <Tool 
    35                                 Name="VCLinkerTool" 
    36                                 AdditionalDependencies="xerces-c_2D.lib zdll.lib zziplibd.lib devil.lib qtmain.lib QtOpenGLd4.lib QtCored4.lib QtGuid4.lib Qt3Supportd4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib" 
    37                                 AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;&quot;$(QTDIR)\lib&quot;;..\include;..\src\GL;&quot;$(CG_LIB_PATH)&quot;;&quot;$(GTPDIR)\NonGTP\Xerces&quot;;&quot;$(GTPDIR)\NonGTP\Xerces\xercesc\lib&quot;;&quot;$(GTPDIR)\NonGTP\zlib\lib&quot;;&quot;$(GTPDIR)\NonGTP\Devil\lib&quot;"/> 
     35                                Name="VCLibrarianTool"/> 
    3836                        <Tool 
    3937                                Name="VCMIDLTool"/> 
     
    5048                        <Tool 
    5149                                Name="VCXMLDataGeneratorTool"/> 
    52                         <Tool 
    53                                 Name="VCWebDeploymentTool"/> 
    5450                        <Tool 
    5551                                Name="VCManagedWrapperGeneratorTool"/> 
     
    6864                                FavorSizeOrSpeed="0" 
    6965                                OptimizeForWindowsApplication="TRUE" 
    70                                 AdditionalIncludeDirectories="..\support;..\support\devil\include;..\support\zlib\include;..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;&quot;$(CG_INC_PATH)&quot;;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces" 
     66                                AdditionalIncludeDirectories="..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;&quot;$(CG_INC_PATH)&quot;;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces" 
    7167                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB;" 
    7268                                ExceptionHandling="TRUE" 
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/TestPreprocessor.vcproj

    r1001 r1002  
    1313                <Configuration 
    1414                        Name="Debug|Win32" 
    15                         OutputDirectory="Debug" 
    16                         IntermediateDirectory="Debug" 
     15                        OutputDirectory="..\bin\Debug" 
     16                        IntermediateDirectory="..\obj\Debug" 
    1717                        ConfigurationType="1" 
    1818                        CharacterSet="2"> 
     
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
     22                                AdditionalIncludeDirectories="..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;&quot;$(CG_INC_PATH)&quot;;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces" 
    2223                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" 
    2324                                MinimalRebuild="TRUE" 
    2425                                BasicRuntimeChecks="3" 
    25                                 RuntimeLibrary="5" 
     26                                RuntimeLibrary="3" 
    2627                                UsePrecompiledHeader="0" 
    2728                                WarningLevel="3" 
     
    3233                        <Tool 
    3334                                Name="VCLinkerTool" 
    34                                 AdditionalDependencies="xerces-c_2D.lib zdll.lib zziplibd.lib devil.lib qtmain.lib QtOpenGLd4.lib QtCored4.lib QtGuid4.lib Qt3Supportd4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib" 
    35                                 OutputFile="$(OutDir)/TestPreprocessor.exe" 
     35                                AdditionalDependencies="xerces-c_2D.lib zdll.lib zziplibd.lib devil.lib qtmain.lib QtOpenGLd4.lib QtCored4.lib QtGuid4.lib Qt3Supportd4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib glew32.lib" 
     36                                OutputFile="$(OutDir)/Preprocessor.exe" 
    3637                                LinkIncremental="2" 
    37                                 AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;&quot;$(QTDIR)\lib&quot;;..\include;..\src\GL;&quot;$(CG_LIB_PATH)&quot;;&quot;$(GTPDIR)\NonGTP\Xerces&quot;;&quot;$(GTPDIR)\NonGTP\Xerces\xercesc\lib&quot;;&quot;$(GTPDIR)\NonGTP\zlib\lib&quot;;&quot;$(GTPDIR)\NonGTP\Devil\lib&quot;" 
     38                                AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;..\include;..\src\GL;&quot;$(CG_LIB_PATH)&quot;;&quot;$(GTPDIR)\NonGTP\Xerces&quot;;&quot;$(GTPDIR)\NonGTP\Xerces\xercesc\lib&quot;;&quot;$(GTPDIR)\NonGTP\zlib\lib&quot;;&quot;$(GTPDIR)\NonGTP\Devil\lib&quot;;..\lib\debug" 
    3839                                GenerateDebugInformation="TRUE" 
    3940                                ProgramDatabaseFile="$(OutDir)/TestPreprocessor.pdb" 
     
    6970                        <Tool 
    7071                                Name="VCCLCompilerTool" 
    71                                 AdditionalIncludeDirectories="..\support;..\support\devil\include;..\support\zlib\include;..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;&quot;$(CG_INC_PATH)&quot;;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces" 
     72                                AdditionalIncludeDirectories="..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;&quot;$(CG_INC_PATH)&quot;;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces" 
    7273                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 
    7374                                RuntimeLibrary="2" 
     
    8384                                OutputFile="$(OutDir)/Preprocessor.exe" 
    8485                                LinkIncremental="1" 
    85                                 AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;&quot;$(QTDIR)\lib&quot;;..\include;..\src\GL;&quot;$(CG_LIB_PATH)&quot;;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;&quot;..\..\Preprocessing\lib\$(ConfigurationName)&quot;" 
     86                                AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;&quot;$(QTDIR)\lib&quot;;..\include;..\src\GL;&quot;$(CG_LIB_PATH)&quot;;&quot;$(GTPDIR)\NonGTP\Xerces&quot;;&quot;$(GTPDIR)\NonGTP\Xerces\xercesc\lib&quot;;&quot;$(GTPDIR)\NonGTP\zlib\lib&quot;;&quot;$(GTPDIR)\NonGTP\Devil\lib&quot;;..\lib\release" 
    8687                                GenerateDebugInformation="FALSE" 
    8788                                SubSystem="1" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r1001 r1002  
    245245void 
    246246Environment::RegisterOption(const char *name, 
    247                              const EOptType type, 
    248                              const char *abbrev, 
    249                              const char *defValue) 
     247                                                        const EOptType type, 
     248                                                        const char *abbrev, 
     249                                                        const char *defValue) 
    250250{ 
    251251  int i; 
     
    21542154        RegisterOption("VspBspTree.Construction.renderCostWeight", 
    21552155                        optFloat, 
    2156                         "-vsp_bsp_post_process_render_cost_weight", 
     2156                        "vsp_bsp_post_process_render_cost_weight=", 
    21572157                        "0.5"); 
    21582158 
  • GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp

    r1001 r1002  
    304304                                        dynamic_cast<TransformedMeshInstance *>(object); 
    305305 
    306                                 if (!mi->GetMesh()) 
     306                                if (!mi->GetMesh())      
    307307                                        break; 
    308  
    309                                 mesh = new Mesh(*mi->GetMesh()); 
    310  
    311                                 Matrix4x4 m; 
    312                                 mi->GetWorldTransform(m); 
    313                                 mesh->ApplyTransformation(m); 
     308                                mesh = new Mesh(); 
     309                                mi->GetTransformedMesh(*mesh); 
    314310 
    315311                                break; 
     
    361357        { 
    362358                VssRay *ray = *rit; 
     359                Intersectable *obj = ray->mTerminationObject; 
    363360 
    364361                if ((mBox.IsInside(ray->mTermination) || !forcedBoundingBox) && 
    365                         ray->mTerminationObject &&  
    366                         !ray->mTerminationObject->Mailed()) 
    367                 { 
    368                         ray->mTerminationObject->Mail(); 
    369                         MeshInstance *obj = dynamic_cast<MeshInstance *>(ray->mTerminationObject); 
    370                         AddMeshToPolygons(obj->GetMesh(), polys, obj); 
    371                         ++ numObj; 
     362                        obj && !obj->Mailed()) 
     363                { 
     364                        obj->Mail(); 
     365 
     366                        // transformed mesh instance and mesh instance handle mesh differently 
     367                        if (obj->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 
     368                        { 
     369                                Mesh mesh; 
     370                                 
     371                                TransformedMeshInstance *tmobj =  
     372                                        dynamic_cast<TransformedMeshInstance *>(obj); 
     373                                 
     374                                tmobj->GetTransformedMesh(mesh); 
     375                                AddMeshToPolygons(&mesh, polys, tmobj); 
     376                        } 
     377                        else // MeshInstance 
     378                        { 
     379                                MeshInstance *mobj = dynamic_cast<MeshInstance *>(obj); 
     380                                AddMeshToPolygons(mobj->GetMesh(), polys, mobj); 
     381                        } 
    372382 
    373383                        //-- compute bounding box 
     
    802812 
    803813                // update single pvs parameter 
    804                 viewCell->mPvsSize = viewCell->GetPvs().GetSize();  
    805                 viewCell->mPvsSizeValid = true; 
    806  
     814                mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().GetSize());  
     815         
    807816 
    808817                mBspStats.contributingSamples += conSamp; 
     
    936945                AddToPvs(leaf, *tData.mRays, sampCon, conSamp); 
    937946 
    938                 viewCell->mPvsSize = viewCell->GetPvs().GetSize(); 
    939                 viewCell->mPvsSizeValid = true; 
    940  
     947                mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().GetSize()); 
     948                 
    941949                mBspStats.contributingSamples += conSamp; 
    942950                mBspStats.sampleContributions +=(int) sampCon; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.h

    r863 r1002  
    3333{ 
    3434        Vector3 mPosition; 
     35 
    3536        /// from point visibility => visible objects, not potentially 
    3637        ObjectPvs mVisibleObjects; 
     
    3940 
    4041/** 
    41         This is a view space partitioning specialised BSPtree.   
    42         There are no polygon splits, but we split the sample rays.  
    43         The candidates for the next split plane are evaluated only  
    44         by checking the sampled visibility information.  
    45         The polygons are employed merely as candidates for the next split planes. 
     42        This is a tree which partitions from point queries in a greedy optimal fashion. 
    4643*/ 
    4744class FromPointVisibilityTree  
     
    4946        friend class ViewCellsParseHandlers; 
    5047        friend class VspBspViewCellsManager; 
     48 
    5149public: 
    5250         
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r1001 r1002  
    187187 
    188188        glPushMatrix(); 
    189 /* 
    190         cout << "\n*******" << endl; 
    191         for (int i = 0; i < 16; ++ i) 
    192                 cout << (float *)(m.x)[i] << " "; 
    193          
    194         cout << "\n*******" << endl; 
     189/* cout << "\n"; 
    195190        for (int i = 0; i < 4; ++ i) 
    196191                for (int j = 0; j < 4; ++ j) 
    197                         cout << m.x[i][j] << " "; 
    198  
    199 cout << "\n==" << endl;*/ 
     192                        cout << m.x[i][j] << " "; cout << "\n"*/ 
    200193 
    201194        glMultMatrixf((float *)m.x); 
    202         GLfloat dummy[16]; 
    203  
    204         /*glGetFloatv(GL_MODELVIEW_MATRIX, dummy); 
    205  
     195 
     196        /*GLfloat dummy[16]; 
     197        glGetFloatv(GL_MODELVIEW_MATRIX, dummy); 
    206198        for (int i = 0; i < 16; ++ i) 
    207199                cout << dummy[i] << " "; 
     
    631623        sample.mVisibleObjects = 0; 
    632624 
    633         int i, j; 
    634  
    635625        // reset object counters 
    636626        ObjectContainer::const_iterator it, it_end = mObjects.end(); 
     
    649639 
    650640        // query all 6 directions for a full point sample 
    651         for (i = 0; i < 6; ++ i)  
     641        for (int i = 0; i < 6; ++ i)  
    652642        { 
    653643                mViewDirection = directions[i]; 
     
    718708  SetupProjection(GetHeight(), GetHeight(), 90.0f); 
    719709 
    720   samples.resize(numSamples); 
     710  //samples.resize(numSamples); 
    721711  halton.Reset(); 
    722712   
    723713  // the number of queries queried in batch mode 
    724714  const int numQ = 500; 
     715 
    725716  //const int numQ = (int)mObjects.size(); 
    726717  if (useOcclusionQueries) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp

    r904 r1002  
    2121    mDepth = 0; 
    2222} 
     23 
     24 
     25KdInterior::~KdInterior() 
     26{ 
     27        // recursivly destroy children 
     28        DEL_PTR(mFront); 
     29        DEL_PTR(mBack); 
     30} 
     31 
    2332 
    2433KdTree::KdTree() 
     
    5463  splitCandidates = NULL; 
    5564} 
     65 
     66 
     67KdTree::~KdTree() 
     68{ 
     69        DEL_PTR(mRoot); 
     70} 
     71 
    5672 
    5773bool 
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h

    r878 r1002  
    9797  bool Mailed() const { return mailbox == mailID; } 
    9898 
    99  
     99  virtual ~KdNode(){}; 
    100100  KdNode(KdInterior *parent); 
    101101 
     
    124124     
    125125  KdInterior(KdInterior *parent):KdNode(parent), mBack(NULL), mFront(NULL) {} 
     126 
     127  ~KdInterior(); 
    126128 
    127129  /** \sa KdNode::IsLeaf() */ 
     
    170172  } 
    171173 
     174  ~KdLeaf() { DEL_PTR(mViewCell);  } 
    172175         
    173176        void AddPassingRay2(const Ray &ray, 
     
    254257   
    255258  KdTree(); 
    256    
     259 
     260  ~KdTree(); 
    257261     
    258262  /** Insert view cell into the tree */ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp

    r1001 r1002  
    608608        mFaces.reserve(rhs.mFaces.size()); 
    609609        mId = rhs.mId; 
     610        mMaterial = rhs.mMaterial; 
    610611 
    611612        FaceContainer::const_iterator it, it_end = rhs.mFaces.end(); 
     
    628629        mVertices = m.mVertices; 
    629630        mFaces.reserve(m.mFaces.size()); 
     631        mMaterial = m.mMaterial; 
     632        // note: we don't copy id on purpose 
    630633        //mId = m.mId; 
    631  
     634         
    632635        FaceContainer::const_iterator it, it_end = m.mFaces.end(); 
    633636 
     
    695698 
    696699/*************************************************************/ 
    697 /*                      TransformedMeshInstance implementation               */ 
     700/*           TransformedMeshInstance implementation          */ 
    698701/*************************************************************/ 
    699702 
     
    747750} 
    748751 
    749  
    750 } 
     752 void TransformedMeshInstance::GetTransformedMesh(Mesh &transformedMesh) 
     753 { 
     754         // copy mesh 
     755        transformedMesh = *mMesh; 
     756        transformedMesh.ApplyTransformation(mWorldTransform); 
     757 } 
     758 
     759} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h

    r1001 r1002  
    329329  void GetWorldTransform(Matrix4x4 &m); 
    330330 
     331  /** Transforms mesh- 
     332        @param transformedMesh returns the tranformed mesh. 
     333  */ 
     334  void GetTransformedMesh(Mesh &transformedMesh); 
     335 
    331336protected: 
    332337 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r1001 r1002  
    115115mVspKdTree(NULL), 
    116116mVspBspTree(NULL), 
    117 mViewCellsManager(NULL) 
     117mViewCellsManager(NULL), 
     118mRenderSimulator(NULL) 
    118119{ 
    119120        environment->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer); 
     
    165166  DEL_PTR(mVspBspTree); 
    166167  cout << "done.\n"; 
     168 
     169   cout << "Deleting scene graph...\n"; 
     170  DEL_PTR(mSceneGraph); 
     171  cout << "done.\n"; 
     172 
     173  DEL_PTR(mRenderSimulator); 
     174  DEL_PTR(renderer); 
    167175} 
    168176 
     
    276284  if (mApplyVisibilityFilter || mApplyVisibilitySpatialFilter) { 
    277285        cout<<"Applying visibility filter ..."; 
    278         cout<<"filyter width = " << mVisibilityFilterWidth << endl; 
    279          
     286        cout<<"filter width = " << mVisibilityFilterWidth << endl; 
     287         
     288        if (!mViewCellsManager) 
     289                return false; 
     290 
    280291        mViewCellsManager->ApplyFilter(mKdTree, 
    281292                                                                   mApplyVisibilityFilter ? mVisibilityFilterWidth : -1.0f, 
     
    361372        { 
    362373                //-- parse type of view cell container 
    363                 char viewCellsStr[64]; 
    364                 environment->GetStringValue("ViewCells.type", viewCellsStr); 
    365                  
    366             mViewCellsManager = CreateViewCellsManager(viewCellsStr); 
     374                environment->GetStringValue("ViewCells.type", buf);              
     375            mViewCellsManager = CreateViewCellsManager(buf); 
    367376        } 
    368377 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RenderSampler.cpp

    r1001 r1002  
    3333        cout << "starting sampling of render cost ... "; 
    3434 
    35         vector<RenderCostSample> samples; 
    36         while (1){cout <<"q";} 
     35        vector<RenderCostSample> samples(mSamples); 
     36   
    3737        if (renderer) 
    3838        { 
     
    5757                histogram[i] = 0; 
    5858        } 
    59  
     59cout << "here3 "<< mSamples << endl; 
     60        cout << "here2 " << samples.size() << endl; 
    6061        // store maximal pvs 
    6162        for (int i = 0; i < mSamples; ++ i)  
  • GTP/trunk/Lib/Vis/Preprocessing/src/ResourceManager.h

    r1001 r1002  
    114114                for (mit = mEntries.begin(); mit != mEntries.end(); ++ mit) 
    115115                { 
    116                         cout << "mesh: " << (*mit).first << " " << (*mit).second << endl; 
     116                        //cout << "mesh: " << (*mit).first << " " << (*mit).second << endl; 
    117117                        DEL_PTR((*mit).second); 
    118118                } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp

    r863 r1002  
    2525    return false; 
    2626   
     27} 
     28 
     29 
     30SceneGraph::~SceneGraph() 
     31{ 
     32        DEL_PTR(mRoot); 
     33} 
     34 
     35 
     36SceneGraphNode::~SceneGraphNode() 
     37{ 
     38        CLEAR_CONTAINER(mGeometry); 
     39        SceneGraphNodeContainer::iterator it, it_end = mChildren.end(); 
     40 
     41        // recursivly delete all children 
     42        CLEAR_CONTAINER(mChildren); 
    2743} 
    2844 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h

    r860 r1002  
    1111   
    1212/** Basic scene graph node, we are interested only in bounding boxes and topology 
    13     of the scene graph */ 
     13    of the scene graph  
     14        */ 
    1415class SceneGraphNode { 
    1516public: 
     
    1718  SceneGraphNodeContainer mChildren; 
    1819  AxisAlignedBox3 mBox; 
     20  ~SceneGraphNode(); 
    1921  void UpdateBox(); 
    2022}; 
     
    2527 
    2628public: 
     29 
     30        ~SceneGraph(); 
     31 
    2732  SceneGraphNode *mRoot; 
    2833  bool Export(const string filename); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp

    r1001 r1002  
    161161                if (ROTATE_SCENE) 
    162162                        RotateMesh(currentMesh); 
    163                                 currentMesh->Preprocess(); 
    164                                 // make an instance of this mesh 
    165                                 MeshInstance *mi = new MeshInstance(currentMesh); 
    166                                 root->mGeometry.push_back(mi);   
    167                                 currentMesh = new Mesh; 
     163 
     164                currentMesh->Preprocess(); 
     165                // make an instance of this mesh 
     166                MeshInstance *mi = new MeshInstance(currentMesh); 
     167                root->mGeometry.push_back(mi);   
     168                currentMesh = MeshManager::GetSingleton()->CreateResource(); 
    168169      } 
    169170    } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r997 r1002  
    5555} 
    5656 
    57  
     57/// Counts differences between pvss. 
    5858inline int CountDiffPvs(ViewCell *vc) 
    5959{ 
     
    100100 
    101101        return pvs; 
    102 } 
    103  
    104 // computet render cost of merge 
    105 float ViewCellsTree::ComputeMergedPvsCost(const ObjectPvs &pvs1,  
    106                                                                                   const ObjectPvs &pvs2) const 
    107 { 
    108         float renderCost = 0; 
    109  
    110         // compute new pvs size 
    111         ObjectPvsMap::const_iterator it, it_end =  pvs1.mEntries.end(); 
    112  
    113         Intersectable::NewMail(); 
    114  
    115         // first mail all objects in first pvs 
    116         for (it = pvs1.mEntries.begin(); it != it_end; ++ it) 
    117         { 
    118                 Intersectable *obj = (*it).first; 
    119  
    120                 obj->Mail(); 
    121                 renderCost += mViewCellsManager->EvalRenderCost(obj); 
    122         } 
    123  
    124         it_end = pvs2.mEntries.end(); 
    125  
    126          
    127         for (it = pvs2.mEntries.begin(); it != it_end; ++ it) 
    128         { 
    129                 Intersectable *obj = (*it).first; 
    130  
    131                 // test if object already considered     
    132                 if (!obj->Mailed()) 
    133                 { 
    134                         renderCost += mViewCellsManager->EvalRenderCost(obj); 
    135                 } 
    136         } 
    137  
    138         return renderCost; 
    139102} 
    140103 
     
    281244} 
    282245 
     246 
     247bool ViewCell::AddPvsSample(Intersectable *sample, 
     248                                                        const float pdf,  
     249                                                        float &contribution) 
     250{ 
     251        const bool result = mPvs.AddSample(sample, pdf, contribution); 
     252 
     253        // update pvs size 
     254        mPvsSize = mPvs.GetSize(); 
     255        mPvsSizeValid = true; 
     256 
     257        return result; 
     258} 
     259 
     260 
     261 
     262 
    283263/************************************************************************/ 
    284264/*                class ViewCellInterior implementation                 */ 
     
    315295{ 
    316296    mChildren.push_back(vc); 
    317     vc->mParent = this; 
     297    vc->SetParent(this); 
    318298} 
    319299 
     
    797777 
    798778        cout << "finished" << endl; 
     779} 
     780 
     781 
     782float ViewCellsTree::ComputeMergedPvsCost(const ObjectPvs &pvs1,  
     783                                                                                  const ObjectPvs &pvs2) const 
     784{ 
     785        // computes render cost of merge 
     786        float renderCost = 0; 
     787 
     788        // compute new pvs size 
     789        ObjectPvsMap::const_iterator it, it_end =  pvs1.mEntries.end(); 
     790 
     791        Intersectable::NewMail(); 
     792 
     793        // first mail all objects in first pvs 
     794        for (it = pvs1.mEntries.begin(); it != it_end; ++ it) 
     795        { 
     796                Intersectable *obj = (*it).first; 
     797 
     798                obj->Mail(); 
     799                renderCost += mViewCellsManager->EvalRenderCost(obj); 
     800        } 
     801 
     802        it_end = pvs2.mEntries.end(); 
     803 
     804         
     805        for (it = pvs2.mEntries.begin(); it != it_end; ++ it) 
     806        { 
     807                Intersectable *obj = (*it).first; 
     808 
     809                // test if object already considered     
     810                if (!obj->Mailed()) 
     811                { 
     812                        renderCost += mViewCellsManager->EvalRenderCost(obj); 
     813                } 
     814        } 
     815 
     816        return renderCost; 
    799817} 
    800818 
     
    21462164{ 
    21472165        // if one has a parent, it was already merged 
    2148         return !(mLeftViewCell->mParent || mRightViewCell->mParent); 
     2166        return !(mLeftViewCell->GetParent() || mRightViewCell->GetParent()); 
    21492167} 
    21502168 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r997 r1002  
    9898        friend class ViewCellsTree; 
    9999        friend class ViewCellsManager; 
    100         friend class VspBspViewCellsManager; 
    101         friend class BspViewCellsManager; 
    102         friend class VspBspTree; 
    103         friend class FromPointVisibilityTree; 
    104         friend class BspTree; 
     100        //friend class VspBspViewCellsManager; 
     101        //friend class BspViewCellsManager; 
     102        //friend class VspBspTree; 
     103        //friend class FromPointVisibilityTree; 
     104        //friend class BspTree; 
    105105 
    106106 
     
    120120        const ObjectPvs &GetPvs() const; 
    121121 
     122        /** Returns pvs. 
     123        */ 
    122124        ObjectPvs &GetPvs(); 
    123125 
     126        /** Completely substitutes the pvs. 
     127        */ 
    124128        void SetPvs(const ObjectPvs &pvs); 
    125129 
     
    128132        int Type() const; 
    129133 
     134         
     135        /** Adds a passing ray to the passing ray container. 
     136        */ 
     137        void AddPassingRay(const Ray &ray, const int contributions); 
     138 
     139        /** Returns volume of the view cell. 
     140        */ 
     141        float GetVolume() const; 
     142 
     143        /** Returns area of the view cell. 
     144        */ 
     145        float GetArea() const; 
     146 
     147        /** Sets the volume of the view cell. 
     148        */ 
     149        void SetVolume(float volume); 
     150         
     151        /** Sets the area of the view cell. 
     152        */ 
     153        void SetArea(float area); 
     154 
     155 
     156        /** if this view cell is the root of a view cell hierarchy 
     157        */ 
     158        bool IsRoot() const; 
     159 
     160        /** Returns parent view cell. 
     161        */ 
     162        ViewCellInterior *GetParent() const; 
     163 
     164        /** Sets parent of this view cell. 
     165        */ 
    130166        void SetParent(ViewCellInterior *parent); 
    131167 
    132         /** Adds a passing ray to the passing ray container. 
    133         */ 
    134         void AddPassingRay(const Ray &ray, const int contributions); 
    135  
    136         /** Returns volume of the view cell. 
    137         */ 
    138         float GetVolume() const; 
    139  
    140         /** Returns area of the view cell. 
    141         */ 
    142         float GetArea() const; 
    143  
    144         /** Sets the volume of the view cell. 
    145         */ 
    146         void SetVolume(float volume); 
    147          
    148         /** Sets the area of the view cell. 
    149         */ 
    150         void SetArea(float area); 
    151  
    152  
    153         /** if this view cell is the root of a view cell hierarchy 
    154         */ 
    155         bool IsRoot() const; 
    156  
    157         /** Returns parent view cell. 
    158         */ 
    159         ViewCellInterior *GetParent() const; 
    160  
    161          
     168 
    162169        /** Sets the mesh for this view cell. 
    163170        */ 
    164171        void SetMesh(Mesh *mesh); 
    165172 
     173        /** Sets this view cell to be a valid view cell according to some criteria. 
     174        */ 
    166175        void SetValid(const bool valid); 
     176        /** Returns true if this view cell is considered to be valid according to 
     177                some criteria. 
     178        */ 
    167179        bool GetValid() const; 
    168180 
     
    179191    RgbColor GetColor() const; 
    180192 
     193        /** Adds a sample to the pvs. 
     194                @param sample the sample to be added 
     195                @param pdf a continuos measure of visibility 
     196                @param contribution returns the contribution of this sample to the pvs 
     197        */ 
     198        bool AddPvsSample(Intersectable *sample, const float pdf, float &contribution); 
    181199   
    182         /// parent view cell in the view cell hierarchy 
    183         ViewCellInterior *mParent; 
     200 
    184201 
    185202        /// Rays piercing this view cell. 
     
    211228        } 
    212229 
     230        /** Sets merge cost used for merging this view cell from other cells.  
     231                @hack The function is available for leaves also to have a common interface, 
     232                but it should be less than zero for leaves. 
     233                */ 
    213234        void SetMergeCost(const float mergeCost); 
    214235 
     236        /** Returns merge cost needed to merge this leaf from other cells. 
     237                @hack The function is available for leaves also to have a common interface, 
     238                but it should be less than zero for leaves. 
     239        */ 
    215240        float GetMergeCost() const; 
     241 
     242 
     243 
     244        //////////////////////////////////////////// 
     245        //       mailing stuff 
     246 
    216247 
    217248        static void NewMail(const int reserve = 1)  
     
    228259 
    229260        int IncMail() { return ++mMailbox - sMailId; } 
    230  
    231261 
    232262 
     
    239269protected: 
    240270 
     271        /// parent view cell in the view cell hierarchy 
     272        ViewCellInterior *mParent; 
     273 
    241274        /// the potentially visible objects 
    242275        ObjectPvs mPvs; 
     
    253286 
    254287         
    255         /// pvs size, used for lazy pvs computation 
     288        /// store pvs size, used for evaluation purpose when pvss are stored only in the leaves 
    256289        int mPvsSize; 
    257         /// if the given pvs size is the real pvs size 
     290        /// if the pvs size scalar is up to date and corresponding to the real pvs size 
    258291        bool mPvsSizeValid; 
    259292 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r1001 r1002  
    661661                case Intersectable::TRANSFORMED_MESH_INSTANCE: 
    662662                        { 
    663                                 TransformedMeshInstance *mi =  
    664                                         dynamic_cast<TransformedMeshInstance *>(object); 
    665  
    666                                 if (!mi->GetMesh()) 
     663                                TransformedMeshInstance *mi = dynamic_cast<TransformedMeshInstance *>(object); 
     664 
     665                                if (!mi->GetMesh())      
    667666                                        break; 
    668  
    669                                 mesh = new Mesh(*mi->GetMesh()); 
    670  
    671                                 Matrix4x4 m; 
    672                                 mi->GetWorldTransform(m); 
    673                                 mesh->ApplyTransformation(m); 
     667                                mesh = new Mesh(); 
     668                                mi->GetTransformedMesh(*mesh); 
    674669                                 
    675670                                break; 
     
    773768                } 
    774769        } 
     770 
     771        CLEAR_CONTAINER(boxPolys); 
    775772} 
    776773 
     
    810807                { 
    811808                        MeshInstance *obj = dynamic_cast<MeshInstance *>(ray->intersections[0].mObject); 
    812                         Face *face = obj->GetMesh()->mFaces[ray->intersections[0].mFace]; 
    813  
     809 
     810                        Mesh *mesh; 
     811                        if (obj->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 
     812                        { 
     813                                TransformedMeshInstance *tmobj =  
     814                                        dynamic_cast<TransformedMeshInstance *>(obj); 
     815                         
     816                                mesh = new Mesh(); 
     817                                tmobj->GetTransformedMesh(*mesh); 
     818                        } 
     819                        else // MeshInstance 
     820                        { 
     821                                mesh = obj->GetMesh(); 
     822                        } 
     823 
     824                        Face *face = mesh->mFaces[ray->intersections[0].mFace]; 
    814825                        std::map<Face *, Polygon3 *>::iterator it = facePolyMap.find(face); 
    815826 
     
    821832                        }  
    822833                        else 
    823                         {       //store rays if needed for heuristics 
    824                                 Polygon3 *poly = new Polygon3(face, obj->GetMesh()); 
     834                        {        
     835                                //store rays if needed for heuristics 
     836                                Polygon3 *poly = new Polygon3(face, mesh); 
    825837                                poly->mParent = obj; 
    826838                                polys->push_back(poly); 
     
    831843                                facePolyMap[face] = poly; 
    832844                        } 
     845 
     846                        // cleanup 
     847                        if (obj->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 
     848                                DEL_PTR(mesh); 
    833849                } 
    834850        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1001 r1002  
    3939}; 
    4040 
    41 //typedef priority_queue<ViewCell *, vector<ViewCell *>, myless<vector<ViewCell *>::value_type> > FilterQueue; 
    42  
    43  
    4441 
    4542ViewCellsManager::ViewCellsManager(Environment *env): 
     
    205202ViewCellsManager::~ViewCellsManager() 
    206203{ 
    207         DEL_PTR(mRenderer); 
     204        //DEL_PTR(mRenderer); 
    208205 
    209206        if (!ViewCellsTreeConstructed()) 
    210207                CLEAR_CONTAINER(mViewCells); 
    211         else 
    212                 DEL_PTR(mViewCellsTree); 
     208        //else 
     209        DEL_PTR(mViewCellsTree); 
    213210} 
    214211 
     
    306303                } 
    307304        } 
    308         Debug << "\nSampled " << i << " new view cells (" << " of " << (int)mEmptyViewCells.size() << ")" << endl << endl; 
     305        Debug << "\nSampled " << i << " new view cells ("  
     306                  << " of " << (int)mEmptyViewCells.size() << ")" << endl << endl; 
    309307} 
    310308 
     
    395393                  << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
    396394 
    397  
     395return 0; 
    398396        // take post processing time 
    399397        startTime = GetTime(); 
    400398 
    401  
    402         // testing the view cell filter functionality    
    403         if (0) TestFilter(preprocessor->mObjects); 
    404  
    405399        // -- stats after contruction 
    406400        ResetViewCells(); 
    407  
    408401        Debug << "\nView cells after initial sampling:\n" << mCurrentViewCellsStats << endl; 
     402 
    409403 
    410404        if (1) // export initial view cells 
     
    473467 
    474468         
    475  
    476469        //-- post processing 
    477470        VssRayContainer postProcessSamples; 
     
    494487 
    495488 
    496  
    497489        cout << "starting post processing and visualization" << endl; 
    498490 
     
    514506                 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 
    515507 
    516         // only for debugging purpose 
    517         if (TEST_EMPTY_VIEW_CELLS) 
    518                 CollectEmptyViewCells(); 
    519          
     508        disposeRays(postProcessSamples, outRays); 
     509 
     510         
     511        //return 1; 
    520512        // evaluation of the paritition, i.e., a number of new samples are cast 
    521513        if (mEvaluateViewCells) 
     
    523515                EvalViewCellPartition(preprocessor); 
    524516        } 
    525          
     517 
     518 
    526519        //-- visualization 
    527520        if (mShowVisualization) 
     
    679672                                                                                         const ObjectContainer &objects) 
    680673{ 
    681         if (!ViewCellsConstructed()) 
     674        if (!ViewCellsConstructed() || !ViewCellsTreeConstructed()) 
    682675                return false; 
    683676 
     
    764757        sort(viewCells.begin(), viewCells.end(), ViewCell::SmallerPvs); 
    765758 
    766         //Debug << "********************" << endl; 
    767         //for (int i = 0; i < viewCells.size(); ++ i) 
    768         //      Debug << "pvs: " << mViewCellsTree->GetPvsSize(viewCells[i]) << " "; 
    769         //Debug << "\n"; 
    770759        maxPvs = mViewCellsTree->GetPvsSize(viewCells.back()); 
    771760        minVal = 0; 
     
    844833 
    845834 
     835bool ViewCellsManager::GetExportPvs() const  
     836{ 
     837        return mExportPvs; 
     838} 
     839 
     840 
    846841void ViewCellsManager::EvalViewCellPartition(Preprocessor *preprocessor) 
    847842{ 
     
    862857        Debug << "view cell stats prefix: " << statsPrefix << endl; 
    863858 
    864         //VssRayContainer outRays; 
     859         
    865860        // should directional sampling be used? 
    866861        bool dirSamples = (mEvaluationSamplingType == Preprocessor::DIRECTION_BASED_DISTRIBUTION); 
     
    932927 
    933928        //-- histogram 
    934  
    935929 
    936930        bool useHisto; 
     
    12071201bool ViewCellsManager::ViewCellsTreeConstructed() const 
    12081202{ 
    1209         return mViewCellsTree->GetRoot(); 
     1203    return (mViewCellsTree && mViewCellsTree->GetRoot()); 
    12101204} 
    12111205 
     
    14191413 
    14201414 
    1421 void ViewCellsManager::DeriveViewCells(const ObjectContainer &objects, 
    1422                                                                            ViewCellContainer &viewCells, 
    1423                                                                            const int maxViewCells) const 
     1415void ViewCellsManager::DeriveViewCellsFromObjects(const ObjectContainer &objects, 
     1416                                                                                                  ViewCellContainer &viewCells, 
     1417                                                                                                  const int maxViewCells) const 
    14241418{ 
    14251419        // maximal max viewcells 
     
    14441438 
    14451439                        Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 
    1446  
    1447                         // copy mesh 
    1448                         *mesh = *mi->GetMesh(); 
    1449  
     1440                         
    14501441                        // transform mesh 
    1451                         Matrix4x4 m; 
    1452                         mi->GetWorldTransform(m); 
    1453                         mesh->ApplyTransformation(m); 
     1442                        mi->GetTransformedMesh(*mesh); 
    14541443                         
    14551444                        // create bb + kd tree 
     
    21682157 
    21692158 
     2159void ViewCellsManager::SetScalarPvsSize(ViewCell *vc, const int pvsSize) const 
     2160{ 
     2161        vc->mPvsSize = pvsSize; 
     2162        vc->mPvsSizeValid = true; 
     2163} 
     2164 
     2165 
    21702166/**********************************************************************/ 
    21712167/*                 BspViewCellsManager implementation                 */ 
     
    29642960        { 
    29652961                pvs = root->GetPvs(); 
    2966  
    2967                 root->mPvsSize = pvs.GetSize(); 
    2968                 root->mPvsSizeValid = true; 
    2969  
     2962                SetScalarPvsSize(root, pvs.GetSize()); 
     2963                 
    29702964                return; 
    29712965        } 
     
    30183012        if (mViewCellsTree->ViewCellsStorage() == ViewCellsTree::PVS_IN_INTERIORS) 
    30193013        { 
    3020                 interior->mPvs = pvs; 
     3014                interior->SetPvs(pvs); 
    30213015        } 
    30223016         
    30233017        // set new pvs size 
    3024         interior->mPvsSize = pvs.GetSize(); 
    3025         interior->mPvsSizeValid = true; 
     3018    SetScalarPvsSize(interior, pvs.GetSize()); 
    30263019 
    30273020#else 
     
    37813774        Debug << "saved rays: " << (int)savedRays.size() << endl; 
    37823775 
    3783  
    3784         //TODO: remove 
     3776        long startTime; 
     3777 
    37853778        if (1) 
    37863779                mVspBspTree->Construct(constructionRays, &mViewSpaceBox); 
     
    37903783        // collapse invalid regions 
    37913784        cout << "collapsing invalid tree regions ... "; 
    3792         long startTime = GetTime(); 
    3793         int collapsedLeaves = mVspBspTree->CollapseTree(); 
     3785        startTime = GetTime(); 
     3786        const int collapsedLeaves = mVspBspTree->CollapseTree(); 
    37943787        Debug << "collapsed in " << TimeDiff(startTime, GetTime()) * 1e-3  
    37953788                  << " seconds" << endl; 
     
    37973790    cout << "finished" << endl; 
    37983791 
    3799         // -- stats 
     3792        //-- stats 
    38003793        Debug << mVspBspTree->GetStatistics() << endl; 
    38013794 
     
    42114204        { 
    42124205                pvs = root->GetPvs(); 
    4213  
    4214                 root->mPvsSize = root->GetPvs().GetSize(); 
    4215                 root->mPvsSizeValid = true; 
    4216  
     4206                SetScalarPvsSize(root, root->GetPvs().GetSize()); 
     4207                 
    42174208                return; 
    42184209        } 
     
    42664257        if (mViewCellsTree->ViewCellsStorage() == ViewCellsTree::PVS_IN_INTERIORS) 
    42674258        { 
    4268                 interior->mPvs = pvs; 
     4259                interior->SetPvs(pvs); 
    42694260        } 
    42704261         
    42714262        // set new pvs size 
    4272         interior->mPvsSize = pvs.GetSize(); 
    4273         interior->mPvsSizeValid = true; 
     4263        SetScalarPvsSize(interior, pvs.GetSize()); 
     4264         
    42744265 
    42754266#else 
     
    43254316        GetRaySets(sampleRays, mVisualizationSamples, visRays); 
    43264317 
    4327          
    4328         if (1) // export view cells 
     4318        //-- export view cells 
     4319        if (1)  
    43294320        {       // hack pvs 
    4330                 int savedColorCode = mColorCode; 
     4321                const int savedColorCode = mColorCode; 
    43314322                mColorCode = 1; 
    43324323         
     
    43674358                mColorCode = savedColorCode; 
    43684359        } 
     4360 
    43694361 
    43704362        if (0) 
     
    50355027  //  AxisAlignedBox3 box(center - Vector3(viewSpaceFilterSize/2), 
    50365028  //                                      center + Vector3(viewSpaceFilterSize/2)); 
    5037  
    50385029        if (!ViewCellsConstructed()) 
    50395030                return; 
    50405031 
    5041   if (viewSpaceFilterSize >=0.0f) { 
     5032        if (viewSpaceFilterSize >= 0.0f) { 
    50425033 
    50435034  bool usePrVS = false; 
    50445035 
    5045    
    50465036  if (!usePrVS) { 
    50475037        AxisAlignedBox3 box = GetViewCellBox(viewCell); 
     
    50525042         
    50535043  //  cout<<"box="<<box<<endl; 
    5054         ViewCellContainer::const_iterator it=viewCells.begin(), it_end = viewCells.end(); 
     5044        ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end(); 
    50555045         
    50565046        int i; 
    5057         for (i=0; it != it_end; ++it, i++) { 
    5058           //    cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl; 
     5047        for (i=0; it != it_end; ++ it, ++ i) { 
     5048                cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl; 
    50595049          pvs.Merge((*it)->GetPvs()); 
    50605050        } 
     
    50705060  } else 
    50715061        pvs = viewCell->GetPvs(); 
    5072    
     5062    
    50735063  if (spatialFilterSize >=0.0f) 
    50745064        ApplySpatialFilter(kdTree, spatialFilterSize, pvs); 
    5075  
     5065   
    50765066} 
    50775067 
     
    50975087   
    50985088  int i; 
    5099   for (i=0, it = mViewCells.begin(); it != it_end; ++ it, i++) { 
     5089  for (i=0, it = mViewCells.begin(); it != it_end; ++ it, ++ i) { 
    51005090        ApplyFilter(*it, 
    51015091                                kdTree, 
     
    51075097 
    51085098  // now replace all pvss 
    5109   for (i= 0, it = mViewCells.begin(); it != it_end; ++ it, i++) { 
     5099  for (i = 0, it = mViewCells.begin(); it != it_end; ++ it, ++ i) { 
     5100             
    51105101        ObjectPvs &pvs = (*it)->GetPvs(); 
    51115102        pvs.Clear(); 
     
    51145105  } 
    51155106   
    5116   delete newPvs; 
     5107  delete [] newPvs; 
    51175108} 
    51185109 
     
    51805171 
    51815172////////////////////////////////// 
    5182 ViewCellsManager *ViewCellsManagerFactory::Create(const string mName) 
     5173/*ViewCellsManager *ViewCellsManagerFactory::Create(const string mName) 
    51835174{ 
    51845175        //TODO 
    51855176        return NULL;// new VspBspViewCellsManager(); 
    5186 } 
    5187  
    5188  
    5189 } 
     5177}*/ 
     5178 
     5179 
     5180} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r1001 r1002  
    170170        void AddViewCell(ViewCell *viewCell); 
    171171 
    172         /** Derive view cells from objects. The view ells are created by taking the object 
     172        /** Derive view cells from scene objects. The view ells are created by taking the object 
    173173                geometry into account. 
    174174        */ 
    175         void DeriveViewCells(const ObjectContainer &objects,  
    176                                                  ViewCellContainer &viewCells,  
    177                                                  const int maxViewCells) const; 
     175        void DeriveViewCellsFromObjects(const ObjectContainer &objects,  
     176                                                                        ViewCellContainer &viewCells,  
     177                                                                        const int maxViewCells) const; 
    178178 
    179179        /** Sets maximal number of samples used for the  
     
    206206        int GetPostProcessSamples() const; 
    207207 
    208         /** Returns true if view cells wer already constructed. 
     208        /** Returns true if view cells are already constructed. 
    209209        */ 
    210210        virtual bool ViewCellsConstructed() const = 0; 
     
    405405        */ 
    406406        float EvalRenderCost(Intersectable *obj) const; 
    407  
    408407    
    409          
     408        /** Sets pvs size of view cell as a scalar. Used when storing pvs only in the leaves 
     409                of the hierarchy. 
     410        */ 
     411        inline void SetScalarPvsSize(ViewCell *vc, const int pvsSize) const; 
     412 
     413 
    410414        /** Returns bounding box of a view cell. 
    411415        */ 
     
    420424        bool LoadBoundingBoxes(const string filename, IndexedBoundingBoxContainer &boxes) const; 
    421425 
    422         bool GetExportPvs() const  
    423         { 
    424                 return mExportPvs; 
    425         } 
     426        /** Returns true if pvs should be exported together with the view cells. 
     427        */ 
     428        bool GetExportPvs() const; 
    426429 
    427430        /** Loads view cells from file. The view cells manager is created with  
    428431                respect to the loaded view cells. 
    429432 
     433                @param filename the filename of the view cells 
     434                @param objects the scene objects 
     435                @param env an environment file containing more parameters 
     436                @param finalizeViewCells if the view cells should be post processed, i.e. 
     437                        a mesh is created representing the geometry 
     438                @param bconverter a conversion routine working with the similarities of bounding 
     439                boxes: if there is a certain similarity of overlap between bounding boxes, two tested 
     440                candidate objects are considered to be the same objects 
    430441                @returns the view cells manager if loading was successful, false otherwise 
    431442        */ 
     
    522533        virtual void ExportColor(Exporter *exporter, ViewCell *vc) const = 0; 
    523534 
    524  
     535        /** Returns volume of the view space. 
     536        */ 
    525537        virtual float GetViewSpaceVolume(); 
    526538         
     
    553565        virtual void UpdatePvsForEvaluation(ViewCell *root, ObjectPvs &pvs) = 0; 
    554566 
    555  
     567         
    556568        //////////////////////////////////////////////// 
    557569 
     
    570582        /// Loaded view cells 
    571583        ViewCellContainer mViewCells; 
    572  
     584        /// the corresponding view cell tree holding the logical description of view cells 
    573585        ViewCellsTree *mViewCellsTree; 
    574  
     586        /// if empty view cells should be pruned (i.e., invalidated) from this point on 
    575587        bool mPruneEmptyViewCells; 
    576588 
     589        /// if the pvss in the view cell leaves and the interiors are up to date 
    577590        bool mViewCellPvsIsUpdated; 
     591 
    578592        /// maximum number of samples taken for construction of the view cells 
    579593        int mConstructionSamples; 
     
    595609        bool mCompressViewCells; 
    596610 
     611        /// holds the current view cell statistics 
    597612        ViewCellsStatistics mCurrentViewCellsStats; 
    598613        /// the scene bounding box 
     
    602617        bool mExportViewCells; 
    603618 
    604         //bool mMarchTree); 
     619        // if only valid view cells should be considered for processing 
    605620        bool mOnlyValidViewCells; 
    606621 
    607622        /// if rays should be used to collect merge candidates 
    608623        bool mUseRaysForMerge; 
    609         /// merge the view cells? 
     624        /// if there should be an additional merge step after the subdivision 
    610625        bool mMergeViewCells; 
    611626 
     
    616631        //-- visualization options 
    617632         
    618         /// color code for view cells 
     633        /// color code for view cells visualization 
    619634        int mColorCode; 
    620635        bool mExportGeometry; 
     
    638653        bool mExportPvs; 
    639654 
     655        /// the pointer to the environment 
    640656        Environment *mEnvironment; 
    641657}; 
    642  
    643658 
    644659 
     
    729744        void ExportBspPvs(const ObjectContainer &objects); 
    730745 
     746        /** test if subdivision is valid in terms of volume / area. 
     747        */ 
    731748        void TestSubdivision(); 
    732749}; 
     
    9941011                                          const VssRayContainer &rays); 
    9951012 
     1013        /** test if subdivision is valid in terms of volume / area. 
     1014        */ 
    9961015        void TestSubdivision(); 
    9971016}; 
    9981017 
    9991018 
    1000 class ViewCellsManagerFactory 
     1019/*class ViewCellsManagerFactory 
    10011020{ 
    1002  
    10031021public: 
    1004  
    10051022        ViewCellsManager *Create(const string mName); 
    1006  
    1007 }; 
     1023};*/ 
    10081024 
    10091025} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r1001 r1002  
    317317                                TransformedMeshInstance *mi = dynamic_cast<TransformedMeshInstance *>(object); 
    318318 
    319                                 if (!mi->GetMesh()) 
     319                                if (!mi->GetMesh())      
    320320                                        break; 
    321  
    322                                 mesh = new Mesh(*mi->GetMesh()); 
    323  
    324                                 Matrix4x4 m; 
    325                                 mi->GetWorldTransform(m); 
    326  
    327                                 mesh->ApplyTransformation(m); 
    328  
     321                                mesh = new Mesh(); 
     322                                mi->GetTransformedMesh(*mesh); 
     323                                 
    329324                break; 
    330325                        } 
     
    375370        { 
    376371                VssRay *ray = *rit; 
     372                Intersectable *obj = ray->mTerminationObject; 
    377373 
    378374                if ((mBox.IsInside(ray->mTermination) || !forcedBoundingBox) && 
    379                         ray->mTerminationObject &&  
    380                         !ray->mTerminationObject->Mailed()) 
    381                 { 
    382                         ray->mTerminationObject->Mail(); 
    383                         MeshInstance *obj = dynamic_cast<MeshInstance *>(ray->mTerminationObject); 
    384                         AddMeshToPolygons(obj->GetMesh(), polys, obj); 
     375                        obj && !obj->Mailed()) 
     376                { 
     377                        obj->Mail(); 
     378 
     379                        // transformed mesh instance and mesh instance handle mesh differently 
     380                        if (obj->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 
     381                        { 
     382                                Mesh mesh; 
     383                                 
     384                                TransformedMeshInstance *tmobj =  
     385                                        dynamic_cast<TransformedMeshInstance *>(obj); 
     386                                 
     387                                tmobj->GetTransformedMesh(mesh); 
     388                                AddMeshToPolygons(&mesh, polys, tmobj); 
     389                        } 
     390                        else // MeshInstance 
     391                        { 
     392                                MeshInstance *mobj = dynamic_cast<MeshInstance *>(obj); 
     393                                AddMeshToPolygons(mobj->GetMesh(), polys, mobj); 
     394                        } 
     395 
    385396                        ++ numObj; 
    386397 
     
    815826                AddToPvs(leaf, *tData.mRays, sampCon, conSamp); 
    816827 
    817                 // update single pvs parameter 
    818                 viewCell->mPvsSize = viewCell->GetPvs().GetSize();  
    819                 viewCell->mPvsSizeValid = true; 
    820  
     828                // update scalar pvs size lookup 
     829                mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().GetSize()); 
     830         
    821831 
    822832                mBspStats.contributingSamples += conSamp; 
     
    950960                AddToPvs(leaf, *tData.mRays, sampCon, conSamp); 
    951961 
    952                 viewCell->mPvsSize = viewCell->GetPvs().GetSize(); 
    953                 viewCell->mPvsSizeValid = true; 
     962                // update scalar pvs size value 
     963                mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().GetSize()); 
    954964 
    955965                mBspStats.contributingSamples += conSamp; 
     
    11611171                                                  int &contributingSamples) 
    11621172{ 
    1163   sampleContributions = 0; 
    1164   contributingSamples = 0; 
     1173        sampleContributions = 0; 
     1174        contributingSamples = 0; 
    11651175   
    1166   RayInfoContainer::const_iterator it, it_end = rays.end(); 
     1176        RayInfoContainer::const_iterator it, it_end = rays.end(); 
    11671177   
    1168   ViewCellLeaf *vc = leaf->GetViewCell(); 
     1178        ViewCellLeaf *vc = leaf->GetViewCell(); 
    11691179   
    1170   // add contributions from samples to the PVS 
    1171   for (it = rays.begin(); it != it_end; ++ it) 
    1172         { 
    1173           float sc = 0.0f; 
    1174           VssRay *ray = (*it).mRay; 
    1175           bool madeContrib = false; 
    1176           float contribution; 
    1177           if (ray->mTerminationObject) { 
    1178                 if (vc->GetPvs().AddSample(ray->mTerminationObject, ray->mPdf, contribution)) 
    1179                   madeContrib = true; 
    1180                 sc += contribution; 
    1181           } 
     1180        // add contributions from samples to the PVS 
     1181        for (it = rays.begin(); it != it_end; ++ it) 
     1182        { 
     1183                float sc = 0.0f; 
     1184                VssRay *ray = (*it).mRay; 
     1185 
     1186                bool madeContrib = false; 
     1187                float contribution; 
     1188 
     1189                if (ray->mTerminationObject)  
     1190                { 
     1191                        if (vc->AddPvsSample(ray->mTerminationObject, ray->mPdf, contribution)) 
     1192                                madeContrib = true; 
     1193                        sc += contribution; 
     1194                } 
    11821195           
    1183           if (ray->mOriginObject) { 
    1184                 if (vc->GetPvs().AddSample(ray->mOriginObject, ray->mPdf, contribution)) 
    1185                   madeContrib = true; 
    1186                 sc += contribution; 
    1187           } 
     1196                if (ray->mOriginObject)  
     1197                { 
     1198                        if (vc->AddPvsSample(ray->mOriginObject, ray->mPdf, contribution)) 
     1199                                madeContrib = true; 
     1200                        sc += contribution; 
     1201                } 
    11881202           
    11891203          sampleContributions += sc; 
     1204 
    11901205          if (madeContrib) 
    11911206                  ++ contributingSamples; 
     
    26352650        // preprocess: throw out polygons coincident to the view space box (not needed) 
    26362651        PolygonContainer boxPolys; 
    2637         mBox.ExtractPolys(boxPolys); 
     2652        /*mBox.ExtractPolys(boxPolys); 
    26382653        vector<Plane3> boxPlanes; 
    26392654 
     
    26662681        } 
    26672682 
    2668         // remove deleted entries 
     2683        // remove deleted entries after swapping them to end of vector 
    26692684        for (int i = 0; i < (int)polys.size(); ++ i) 
    26702685        { 
     
    26742689                        polys.pop_back(); 
    26752690                } 
    2676         } 
     2691        }*/ 
    26772692} 
    26782693 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp

    r931 r1002  
    2222VssPreprocessor::VssPreprocessor(): 
    2323  mPass(0), 
    24   mVssRays() 
     24  mVssRays(), 
     25  mViewSpaceBox(NULL) 
    2526{ 
    2627  // this should increase coherence of the samples 
     
    543544 
    544545 
    545   AxisAlignedBox3 *box = new AxisAlignedBox3(mKdTree->GetBox()); 
     546  AxisAlignedBox3 box(mKdTree->GetBox()); 
    546547   
    547548  if (!useViewspacePlane) { 
    548549        float size = 0.05f; 
    549550        float s = 0.5f - size; 
    550         float olds = Magnitude(box->Size()); 
    551         box->Enlarge(box->Size()*Vector3(-s)); 
     551        float olds = Magnitude(box.Size()); 
     552        box.Enlarge(box.Size()*Vector3(-s)); 
    552553        Vector3 translation = Vector3(-olds*0.1f, 0, 0); 
    553         box->SetMin(box->Min() + translation); 
    554         box->SetMax(box->Max() + translation); 
     554        box.SetMin(box.Min() + translation); 
     555        box.SetMax(box.Max() + translation); 
    555556  } else { 
    556557 
    557558        // sample city like heights 
    558         box->SetMin(1, box->Min(1) + box->Size(1)*0.2f); 
    559         box->SetMax(1, box->Min(1) + box->Size(1)*0.3f); 
     559        box.SetMin(1, box.Min(1) + box.Size(1)*0.2f); 
     560        box.SetMax(1, box.Min(1) + box.Size(1)*0.3f); 
    560561  } 
    561562 
    562563  if (use2dSampling) 
    563         box->SetMax(1, box->Min(1)); 
     564        box.SetMax(1, box.Min(1)); 
    564565 
    565566  cout<<"mUseViewSpaceBox="<<mUseViewSpaceBox<<endl; 
     
    570571          if (!mEnlargeViewSpace) 
    571572          { 
    572                   mViewSpaceBox = box; 
     573                  mViewSpaceBox = new AxisAlignedBox3(box); 
    573574          } 
    574575          else 
     
    591592                  { 
    592593                          // $$ JB temporary 
    593                           AxisAlignedBox3 box = *mViewSpaceBox; 
     594                          AxisAlignedBox3 tempbox = *mViewSpaceBox; 
    594595                           
    595                           float s = box.Size(0); 
     596                          float s = tempbox.Size(0); 
    596597                           
    597                           box.Scale(0.8f); 
    598                           box.SetMax(0, box.Max(0) + s*0.8f); 
    599                           box.SetMin(0, box.Min(0) + s*0.8f); 
    600                           *mViewSpaceBox = box; 
     598                          tempbox.Scale(0.8f); 
     599                          tempbox.SetMax(0, box.Max(0) + s*0.8f); 
     600                          tempbox.SetMin(0, box.Min(0) + s*0.8f); 
     601                          *mViewSpaceBox = tempbox; 
    601602                  }              
    602603          } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp

    r1001 r1002  
    275275                MeshInstance *mi; 
    276276 
    277                 if (0 && !mUsingMeshDefinition)  
     277                if (!mUsingMeshDefinition)  
    278278                { 
    279279                        // make an instance of this mesh 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r1001 r1002  
    1010#include "MeshKdTree.h" 
    1111#include "Exporter.h" 
    12 #include "X3dExporter.h" // delete later 
    1312#include "ViewCell.h" 
    1413#include "SceneGraph.h" 
     
    4948  environment->GetStringValue("Preprocessor.type", buff); 
    5049  string preprocessorType(buff); 
    51          
    52   Preprocessor *p; 
    5350 
     51  Preprocessor *p = NULL; 
     52 
     53  
    5454  if (preprocessorType == "vss") 
    5555  { 
     
    5757  } 
    5858  else 
     59  { 
    5960        if (preprocessorType == "rss") 
    60           p = new RssPreprocessor(); 
     61        { 
     62                p = new RssPreprocessor(); 
     63        } 
    6164        else 
     65        { 
    6266          if (preprocessorType == "exact") 
     67          { 
    6368                p = new ExactPreprocessor(); 
     69          } 
    6470          else 
     71          { 
    6572                if (preprocessorType == "sampling") 
     73                { 
    6674                  p = new SamplingPreprocessor(); 
     75                } 
    6776                else 
     77                {        
    6878                  if (preprocessorType == "render") 
    6979                  { 
    70                           p = new RenderSampler(); 
     80                         p = new RenderSampler(); 
    7181                  } 
    7282                  else { 
    73                         cerr<<"Unknown preprocessor type"<<endl; 
    74                         Debug<<"Unknown preprocessor type"<<endl; 
    75                         exit(1); 
     83                          DEL_PTR(environment); 
     84                          cerr<<"Unknown preprocessor type"<<endl; 
     85                          Debug<<"Unknown preprocessor type"<<endl; 
     86                          exit(1); 
    7687                  } 
     88                } 
     89          } 
     90        } 
     91  } 
    7792   
    78   
     93 
    7994  QApplication *app = NULL; 
    8095 
     
    149164         returnCode = app->exec(); 
    150165 
    151    // clean up 
     166  //-- clean up 
    152167  DEL_PTR(p); 
    153168  DEL_PTR(environment); 
     169 
    154170  MeshManager::DelSingleton(); 
    155171  MaterialManager::DelSingleton(); 
    156172 
     173  DEL_PTR(pt); 
    157174 
    158175  return returnCode; 
Note: See TracChangeset for help on using the changeset viewer.