Changeset 863 for GTP/trunk


Ignore:
Timestamp:
04/29/06 19:11:23 (19 years ago)
Author:
mattausch
Message:

working on preprocessor integration
added iv stuff

Location:
GTP/trunk/Lib/Vis
Files:
79 edited
2 copied

Legend:

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

    r828 r863  
    1212#include "VisibilityManager.h" 
    1313#include "ViewCellsManager.h" 
     14 
     15//class GtpVisibilityPreprocessor::ViewCellsManager; 
    1416 
    1517 
     
    118120        void InitVisibilityCulling(Camera *cam); 
    119121 
     122        /** Finds object corresponding to this bounding box in the scene. 
     123        */ 
     124        MovableObject *FindCorrespondingObject(const AxisAlignedBox &box); 
     125 
     126        /** Identifies objects in the scene and gives them unique ids that 
     127                correspond to preprocessor ids. 
     128        */ 
     129        void IdentifyObjects(GtpVisibilityPreprocessor::ObjectContainer &objects); 
     130 
    120131        /// the interface to the scene hierarchy. 
    121132        OctreeHierarchyInterface *mHierarchyInterface; 
     
    164175        /// Always execute the vertex program of a pass, e.g., for the depth pass or item buffer 
    165176        bool mExecuteVertexProgramForAllPasses; 
    166  
     177        /// if hierarchical culling is currently in use 
    167178        bool mIsHierarchicalCulling; 
    168179 
    169         ViewCellsManager *mViewCellsManager; 
     180        GtpVisibilityPreprocessor::ViewCellsManager *mViewCellsManager; 
    170181}; 
    171182 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreTypeConverter.h

    r860 r863  
    11#ifndef _OgreTypeConverter_H__ 
    22#define _OgreTypeConverter_H__ 
    3  
     3  
     4#include "OgreAxisAlignedBox.h" 
    45#include "AxisAlignedBox3.h" 
    5 #include "OgreAxisAlignedBox.h" 
    66#include "Vector3.h" 
    7 #include "OgreVector3.h" 
    87 
    98 
    109namespace Ogre { 
    11    
     10  
    1211/** 
    13         Class which converts our types to OGRE types 
     12        Class which converts preprocessor types to OGRE types 
    1413*/ 
    1514class __declspec(dllexport) OgreTypeConverter 
    1615{ 
    1716public: 
    18  
     17        /** Converts Ogre AABB to preprocessor AABB. 
     18        */ 
    1919        static GtpVisibilityPreprocessor::AxisAlignedBox3 ConvertFromOgre(const AxisAlignedBox &box); 
     20        /** Converts Ogre vector to preprocessor vector. 
     21        */ 
    2022        static GtpVisibilityPreprocessor::Vector3 ConvertFromOgre(const Vector3 &v); 
    21          
     23        /** Converts preprocessor AABB to Ogre AABB. 
     24        */ 
    2225        static AxisAlignedBox ConvertToOgre(const GtpVisibilityPreprocessor::AxisAlignedBox3 &box); 
     26        /** Converts preprocessor vector to Ogre vector. 
     27        */ 
    2328        static Vector3 ConvertToOgre(const GtpVisibilityPreprocessor::Vector3 &v); 
    2429}; 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreVisibilityOctreeSceneManager.h

    r828 r863  
    104104        void InitVisibilityCulling(Camera *cam); 
    105105         
     106 
     107 
    106108        /// the interface to the scene hierarchy. 
    107109        OctreeHierarchyInterface *mHierarchyInterface; 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj

    r860 r863  
    8888                                EnableFiberSafeOptimizations="TRUE" 
    8989                                OptimizeForProcessor="2" 
    90                                 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\include" 
     90                                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" 
    9191                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE" 
    9292                                StringPooling="TRUE" 
     
    198198                                </File> 
    199199                                <File 
     200                                        RelativePath="..\include\OgreMeshInstance.h"> 
     201                                </File> 
     202                                <File 
    200203                                        RelativePath="..\include\OgreOcclusionQueriesQueryManager.h"> 
    201204                                </File> 
     
    234237                                Name="Source Files" 
    235238                                Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> 
     239                                <File 
     240                                        RelativePath="..\src\OgreMeshInstance.cpp"> 
     241                                </File> 
    236242                                <File 
    237243                                        RelativePath="..\src\OgreOcclusionQueriesQueryManager.cpp"> 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r860 r863  
    11#include "OgreOcclusionCullingSceneManager.h" 
    22#include "OgreVisibilityOptionsManager.h" 
     3#include "OgreTypeConverter.h" 
    34#include <OgreMath.h> 
    45#include <OgreIteratorWrappers.h> 
     
    910#include <OgreEntity.h> 
    1011#include <OgreSubEntity.h> 
     12#include <OgreIteratorWrappers.h> 
    1113#include "VspBspTree.h" 
    12 #include <OgreIteratorWrappers.h> 
     14#include "Containers.h" 
     15#include "ViewCellsManager.h" 
    1316 
    1417namespace Ogre { 
     
    3841        mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 
    3942         
    40         //mDisplayNodes = true; 
    41         //mShowBoundingBoxes = true; 
    42         //mShowBoxes = true; 
    43 //std::stringstream d; d << "here555"; 
    44 //mDummyLog.open(""); 
    45  
     43#if 0 
     44        mDisplayNodes = true; 
     45        mShowBoundingBoxes = true; 
     46        mShowBoxes = true; 
     47#endif 
    4648        // TODO: set maxdepth to reasonable value 
    4749        mMaxDepth = 50; 
     
    836838} 
    837839 
    838 /*bool OcclusionCullingSceneManager::CompareBoundingBoxes(const AxisAlignedBox &boxa,  
    839                                                                                                                 const AxisAlignedBox &boxb) 
    840 { 
    841 } 
    842 */ 
    843 void OcclusionCullingSceneManager::LoadViewCells(string filename) 
    844 { 
    845         ObjectContainer objects; 
    846         mViewCellsManager->LoadViewCells(filename, &objects); 
    847  
    848         AxisAlignedBox box; 
     840 
     841MovableObject *OcclusionCullingSceneManager::FindCorrespondingObject(const AxisAlignedBox &box) 
     842{ 
    849843        list<SceneNode *> sceneNodeList; 
    850844 
     
    853847        list<SceneNode *>::const_iterator sit, sit_end = sceneNodeList.end(); 
    854848 
    855         for (sit = sceneNodeList.begin(); sit != sceneNodeList.end(); ++ sit) 
     849        bool overlap = false; 
     850 
     851        MovableObject *bestFittingObj = NULL; 
     852        float bestFit = 0.0; 
     853         
     854        // find the bbox which is closest to the current bbox 
     855        for (sit = sceneNodeList.begin(); sit != sceneNodeList.end(), !overlap; ++ sit) 
    856856        { 
    857857                SceneNode *sn = *sit; 
    858858                SceneNode::ObjectIterator oit = sn->getAttachedObjectIterator(); 
    859859 
    860                 while (oit.hasMoreElements()) 
    861                  { 
     860        while (oit.hasMoreElements()) 
     861                { 
    862862                         MovableObject *mo = oit.getNext(); 
    863                          AxisAlignedBox bbox = mo->getWorldBoundingBox(); 
    864 //              CompareBoundingBoxes(*oit, box); 
    865                  } 
     863                         const AxisAlignedBox bbox = mo->getWorldBoundingBox(); 
     864                          
     865                         const float overlap = GtpVisibilityPreprocessor::FactorOfOverlap( 
     866                                 OgreTypeConverter::ConvertFromOgre(bbox),  
     867                                 OgreTypeConverter::ConvertFromOgre(box)); 
     868 
     869                         if (overlap > bestFit) 
     870                         { 
     871                                 bestFit = overlap; 
     872                                 bestFittingObj = mo; 
     873 
     874                                 // perfect fit => object found 
     875                                 if (overlap > (1.0 - GtpVisibilityPreprocessor::Limits::Small)) 
     876                                        break; 
     877                         } 
     878                } 
     879        } 
     880 
     881        return bestFittingObj; 
     882} 
     883 
     884 
     885void OcclusionCullingSceneManager::LoadViewCells(string filename) 
     886{ 
     887        GtpVisibilityPreprocessor::ObjectContainer objects; 
     888        // identify the corresponding Ogre meshes using the bounding boxes 
     889        IdentifyObjects(objects); 
     890 
     891        // load the view cells assigning the found objects to the pvss 
     892        mViewCellsManager->LoadViewCells(filename, &objects); 
     893} 
     894 
     895 
     896void OcclusionCullingSceneManager::IdentifyObjects(GtpVisibilityPreprocessor::ObjectContainer &objects) 
     897{ 
     898        const string bboxesFilename = "boxes.out"; 
     899 
     900        GtpVisibilityPreprocessor::IndexedBoundingBoxContainer iboxes; 
     901        mViewCellsManager->LoadBoundingBoxes(bboxesFilename, iboxes); 
     902 
     903        GtpVisibilityPreprocessor::IndexedBoundingBoxContainer:: 
     904                const_iterator iit, iit_end = iboxes.end(); 
     905 
     906        for (iit = iboxes.begin(); iit != iit_end; ++ iit) 
     907        { 
     908                  const GtpVisibilityPreprocessor::AxisAlignedBox3 box = (*iit).second; 
     909                  const AxisAlignedBox currentBox = OgreTypeConverter::ConvertToOgre(box); 
     910                   
     911                  MovableObject *mo = FindCorrespondingObject(currentBox); 
     912 
     913                  //objects.push_back(mi); 
    866914        } 
    867915} 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTypeConverter.cpp

    r860 r863  
    22 
    33 
    4 GtpVisibilityPreprocessor::AxisAlignedBox3 Ogre::OgreTypeConverter::ConvertFromOgre(const Ogre::AxisAlignedBox &box) 
     4namespace Ogre 
    55{ 
     6 
     7GtpVisibilityPreprocessor::AxisAlignedBox3 OgreTypeConverter::ConvertFromOgre(const AxisAlignedBox &box) 
     8{ 
     9        const GtpVisibilityPreprocessor::Vector3 bmin = ConvertFromOgre(box.getMinimum()); 
     10        const GtpVisibilityPreprocessor::Vector3 bmax = ConvertFromOgre(box.getMaximum()); 
     11 
     12        return GtpVisibilityPreprocessor::AxisAlignedBox3(bmin, bmax); 
    613} 
    714 
    8 GtpVisibilityPreprocessor::Vector3 Ogre::OgreTypeConverter::ConvertFromOgre(const Ogre::Vector3 &v) 
     15GtpVisibilityPreprocessor::Vector3 OgreTypeConverter::ConvertFromOgre(const Vector3 &v) 
    916{ 
     17    return GtpVisibilityPreprocessor::Vector3(v.x, v.y, v.z); 
    1018} 
    1119         
    12 Ogre::AxisAlignedBox Ogre::OgreTypeConverter::ConvertToOgre(const GtpVibilityPreprocessor::AxisAlignedBox3 &box) 
     20AxisAlignedBox OgreTypeConverter::ConvertToOgre(const GtpVisibilityPreprocessor::AxisAlignedBox3 &box) 
    1321{ 
     22        const Vector3 bmin = ConvertToOgre(box.Min()); 
     23        const Vector3 bmax = ConvertToOgre(box.Max()); 
     24 
     25        return AxisAlignedBox(bmin, bmax); 
    1426} 
    1527 
    16 Ogre::Vector3 Ogre::OgreTypeConverter::ConvertToOgre(const GtpVibilityPreprocessor::Vector3 &v) 
     28Vector3 OgreTypeConverter::ConvertToOgre(const GtpVisibilityPreprocessor::Vector3 &v) 
    1729{ 
     30        return Vector3(v.getX(), v.getY(), v.getZ()); 
    1831} 
     32} 
  • GTP/trunk/Lib/Vis/Preprocessing/include/Containers.h

    r68 r863  
    99  class ViewCell; 
    1010  class HierarchyNode; 
     11 
    1112  /** Container for Mesh pointers primarily for the use within the kDTree and 
    1213      BSP hierarchies */ 
     
    1819      BSP hierarchies */ 
    1920  typedef vector<HierarchyNode *> NodeContainer; 
     21 
    2022}; 
    21  
    2223 
    2324#endif // _Container_H__ 
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj

    r860 r863  
    7676                                RuntimeTypeInfo="TRUE" 
    7777                                UsePrecompiledHeader="0" 
    78                                 WarningLevel="3" 
     78                                WarningLevel="2" 
    7979                                Detect64BitPortabilityProblems="TRUE" 
    8080                                DebugInformationFormat="3"/> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp

    r860 r863  
    99#include "Mesh.h" 
    1010 
    11 using namespace GtpVisibilityPreprocessor { 
     11namespace GtpVisibilityPreprocessor { 
    1212 
    1313#define FATAL Debug 
  • GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h

    r860 r863  
    88#include "Containers.h" 
    99 
     10namespace GtpVisibilityPreprocessor { 
     11 
    1012class Ray; 
    1113class Polygon3; 
    1214class Mesh; 
    1315 
    14 // -------------------------------------------------------- 
    15 // CAABox class. 
    16 //  This is a box in 3-space, defined by min and max 
    17 //  corner vectors.  Many useful operations are defined 
    18 //  on this 
    19 // -------------------------------------------------------- 
     16/** 
     17        CAABox class. 
     18        This is a box in 3-space, defined by min and max 
     19        corner vectors.  Many useful operations are defined 
     20        on this 
     21*/ 
    2022class AxisAlignedBox3 
    2123{ 
    2224protected: 
    23   Vector3 mMin, mMax; 
     25        Vector3 mMin, mMax; 
    2426public: 
    2527  // Constructors. 
     
    3436  //                                                  max(center + Vector3(radius)) {} 
    3537 
    36   // initialization to the non existing bounding box 
     38  /** initialization to the non existing bounding box 
     39  */ 
    3740  void Initialize() { 
    3841    mMin = Vector3(MAXFLOAT); 
     
    4043  } 
    4144 
    42   // The center of the box 
     45  /** The center of the box 
     46  */ 
    4347  Vector3 Center() const { return 0.5 * (mMin + mMax); } 
    4448   
    45   // The diagonal of the box 
     49  /** The diagonal of the box 
     50  */ 
    4651  Vector3 Diagonal() const { return (mMax -mMin); } 
    4752 
     
    110115  void Include (const PolygonContainer &polys); 
    111116  void Include(Mesh *mesh); 
    112   // Expand the axis-aligned box to include given values in particular axis 
     117 
     118  /** Expand the axis-aligned box to include given values in particular axis. 
     119  */ 
    113120  void Include(const int &axis, const float &newBound); 
    114121 
     
    123130  friend inline bool OverlapS(const AxisAlignedBox3 &,const AxisAlignedBox3 &); 
    124131 
    125   // Overlap returns 1 if the two axis-aligned boxes overlap for a given 
    126   // epsilon. If eps > 0.0, then the boxes has to have the real intersection 
    127   // box, if eps < 0.0, then the boxes need not intersect really, they 
    128   // can be at eps distance in the projection 
     132  /** Overlap returns 1 if the two axis-aligned boxes overlap for a given 
     133          epsilon. If eps > 0.0, then the boxes has to have the real intersection 
     134          box, if eps < 0.0, then the boxes need not intersect really, they 
     135          can be at eps distance in the projection. 
     136          */ 
    129137  friend inline bool Overlap(const AxisAlignedBox3 &, 
    130                              const AxisAlignedBox3 &, 
    131                              float eps); 
    132  
    133   // Includes returns true if a includes b (completely 
     138                                                         const AxisAlignedBox3 &, 
     139                                                         float eps); 
     140 
     141  /** Returns 'factor' of overlap of first box with the second box. i.e., a number 
     142        between 0 (no overlap) and 1 (same box). 
     143  */ 
     144  friend inline float FactorOfOverlap(const AxisAlignedBox3 &, const AxisAlignedBox3 &); 
     145 
     146  /** Includes returns true if a includes b (completely) 
     147  */ 
    134148  bool Includes(const AxisAlignedBox3 &b) const; 
    135149 
    136150  virtual int IsInside(const Vector3 &v) const; 
    137151   
    138   // Test if the box is really sensefull 
     152  /** Test if the box makes sense. 
     153  */ 
    139154  virtual bool IsCorrect(); 
    140155 
    141   // To answer true requires the box of real volume of non-zero value 
     156  /** To answer true requires the box of real volume of non-zero value. 
     157  */ 
    142158  bool IsSingularOrIncorrect() const; 
    143159 
    144   // When the box is not of non-zero or negative surface area 
     160  /** When the box is not of non-zero or negative surface area. 
     161  */ 
    145162  bool IsCorrectAndNotPoint() const; 
    146163 
    147   // Returns true when the box degenerates to a point 
     164  /** Returns true when the box degenerates to a point. 
     165  */ 
    148166  bool IsPoint() const; 
    149167 
     168  /** Scales the box with the factor. 
     169  */ 
    150170  void Scale(const float scale) { 
    151171        Vector3 newSize = Size()*(scale*0.5f); 
     
    155175  } 
    156176   
     177  /** Returns the square of the minimal and maximal distance to  
     178        a point on the box. 
     179        */ 
    157180  void 
    158181  GetSqrDistances(const Vector3 &point, 
     
    348371          @returns true if ray hits the bounding box. 
    349372  */ 
    350   bool GetRaySegment(const Ray &ray,  
    351                                 float &minT,  
    352                                 float &maxT) const; 
     373  bool GetRaySegment(const Ray &ray, float &minT, float &maxT) const; 
    353374 
    354375  /** If the boxes are intersecting on a common face, this function  
     
    519540} 
    520541 
     542inline float FactorOfOverlap(const AxisAlignedBox3 &box1, const AxisAlignedBox3 &box2) 
     543{ 
     544        const AxisAlignedBox3 isect = Intersect(box1, box2); 
     545        return isect.GetVolume() / box1.GetVolume(); 
     546} 
    521547 
    522548inline int operator==(const AxisAlignedBox3 &A, const AxisAlignedBox3 &B) 
     
    526552 
    527553   
    528  
     554} 
    529555 
    530556 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Beam.cpp

    r860 r863  
    44#include "Polygon3.h" 
    55 
    6 using namespace GtpVisibilityPreprocessor { 
     6namespace GtpVisibilityPreprocessor { 
    77 
    88void 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Beam.h

    r860 r863  
    88using namespace std; 
    99 
     10namespace GtpVisibilityPreprocessor { 
     11 
    1012class KdNode; 
    1113class Intersectable; 
    1214class Mesh; 
    1315 
    14 namespace GtpVisibilityPreprocessor { 
    1516 
    1617// the values need for rss tree update computed already inside the glrendererbuffer 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp

    r860 r863  
    1414 
    1515 
    16 using namespace GtpVisibilityPreprocessor { 
     16namespace GtpVisibilityPreprocessor { 
    1717 
    1818 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Camera.h

    r860 r863  
    7676}; 
    7777 
    78 } 
     78}; 
    7979 
    8080#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h

    r860 r863  
    1818 
    1919struct IndexedBoundingBox; 
     20struct VisibilityPoint; 
    2021 
    21 struct VisibilityPoint; 
    2222 
    2323/** Container storing polygons used during BSP tree construction. 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r860 r863  
    2020#include "Vector3.h" 
    2121 
    22    
    23 using namespace GtpVisibilityPreprocessor { 
     22using namespace std; 
     23   
     24namespace GtpVisibilityPreprocessor { 
     25 
     26 
    2427 
    2528Environment *environment = NULL; 
     
    269272  // new option 
    270273  options[numOptions].type = type; 
    271   options[numOptions].name = strdup(name); 
     274  options[numOptions].name = ::strdup(name); 
    272275  // assign abbreviation, if requested 
    273276  if (abbrev != NULL) { 
    274     options[numOptions].abbrev = strdup(abbrev); 
     277          options[numOptions].abbrev = ::strdup(abbrev); 
    275278  } 
    276279  // assign default value, if requested 
    277280  if (defValue != NULL) { 
    278     options[numOptions].defaultValue = strdup(defValue); 
     281          options[numOptions].defaultValue = ::strdup(defValue); 
    279282    if (!CheckType(defValue, type)) { 
    280283      Debug << "Internal error: Inconsistent type and default value in option " 
     
    610613  if (options[i].type == optString) { 
    611614    delete options[i].value; 
    612     options[i].value = strdup(value); 
     615        options[i].value = ::strdup(value); 
    613616  } 
    614617  else { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.cpp

    r860 r863  
    11#include "ExactPreprocessor.h" 
    22 
    3 using namespace GtpVisibilityPreprocessor { 
     3namespace GtpVisibilityPreprocessor { 
    44 
    55bool 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.h

    r860 r863  
    22#define _ExactPreprocessor_H__ 
    33 
     4 
     5#include "Preprocessor.h" 
     6 
     7 
    48namespace GtpVisibilityPreprocessor { 
    59 
    6 #include "Preprocessor.h" 
    710 
    811  /** Exact visibility preprocessing. The implementation is based on 6D BSP and 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp

    r860 r863  
    33#include "VrmlExporter.h" 
    44 
    5 using namespace GtpVisibilityPreprocessor { 
     5namespace GtpVisibilityPreprocessor { 
    66 
    77Exporter * 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h

    r860 r863  
    66using namespace std; 
    77 
    8 namespace GtpVisibilityPreprocessor { 
     8 
    99 
    1010#include "Material.h" 
    1111#include "Containers.h" 
    1212#include "VssRay.h" 
     13 
     14namespace GtpVisibilityPreprocessor { 
    1315 
    1416class KdTree; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp

    r860 r863  
    1818#include "Beam.h" 
    1919 
    20 using namespace GtpVisibilityPreprocessor { 
     20namespace GtpVisibilityPreprocessor { 
    2121 
    2222#define USE_FIXEDPOINT_T 0 
  • GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.h

    r860 r863  
    1414 
    1515class ViewCell; 
    16 //class BspViewCell; 
    1716class Plane3; 
    1817class FromPointVisibilityTree;   
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r860 r863  
    1616#include <QVBoxLayout> 
    1717 
    18 using namespace GtpVisibilityPreprocessor { 
     18namespace GtpVisibilityPreprocessor { 
    1919 
    2020static CGcontext sCgContext = NULL; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r860 r863  
    1111#include "Renderer.h" 
    1212#include "Beam.h" 
     13 
     14class QWidget; 
    1315 
    1416namespace GtpVisibilityPreprocessor { 
     
    2224class Beam; 
    2325class KdTree; 
    24 class QWidget; 
    2526class GlRendererBuffer; 
    2627class BeamSampleStatistics; 
     
    428429extern GlDebuggerWidget *debuggerWidget; 
    429430 
    430 } 
     431}; 
    431432 
    432433#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Halton.cpp

    r860 r863  
    22#include "Halton.h" 
    33 
    4 using namespace GtpVisibilityPreprocessor { 
     4namespace GtpVisibilityPreprocessor { 
    55 
    66// global halton generator 
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp

    r860 r863  
    88#include "Beam.h" 
    99 
     10 
     11 
     12namespace GtpVisibilityPreprocessor { 
     13 
    1014int KdNode::mailID = 1; 
    11  
    12 using namespace GtpVisibilityPreprocessor { 
    13  
    1415 
    1516KdNode::KdNode(KdInterior *parent):mParent(parent), mailbox(0) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Material.cpp

    r860 r863  
    22#include "Material.h" 
    33 
    4 using namespace GtpVisibilityPreprocessor { 
     4namespace GtpVisibilityPreprocessor { 
    55 
    66 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.cpp

    r860 r863  
    66using namespace std; 
    77 
    8 using namespace GtpVisibilityPreprocessor { 
     8namespace GtpVisibilityPreprocessor { 
    99 
    1010 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp

    r860 r863  
    44#include "Triangle3.h" 
    55 
    6 using namespace GtpVisibilityPreprocessor { 
     6namespace GtpVisibilityPreprocessor { 
    77 
    88 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h

    r860 r863  
    99#include "AxisAlignedBox3.h" 
    1010#include "Material.h" 
     11#include "Containers.h" 
     12 
    1113 
    1214namespace GtpVisibilityPreprocessor { 
     
    5153  VertexIndexContainer mVertexIndices;   
    5254}; 
     55 
     56 
     57 
     58/// default vertex container for Mesh 
     59typedef vector<Vector3> VertexContainer; 
     60 
     61/// vertex index container 
     62typedef vector<short> VertexIndexContainer; 
    5363 
    5464/// default patch container for Mesh 
  • GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.cpp

    r860 r863  
    66#include "MeshKdTree.h" 
    77 
    8 using namespace GtpVisibilityPreprocessor { 
     8namespace GtpVisibilityPreprocessor { 
    99 
    1010 
  • GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp

    r860 r863  
    1111#include "SceneGraph.h" 
    1212 
    13 using namespace GtpVisibilityPreprocessor { 
     13namespace GtpVisibilityPreprocessor { 
    1414 
    1515void 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h

    r860 r863  
    33 
    44#include <string> 
    5 using namespace std; 
    65 
    76namespace GtpVisibilityPreprocessor { 
     
    1615  Parser() {} 
    1716 
    18   virtual bool ParseFile(const string filename,  
     17  virtual bool ParseFile(const std::string filename,  
    1918                                                 SceneGraphNode **root,  
    2019                                                 const bool loadPolygonsAsMeshes = false) {return false;}; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.cpp

    r860 r863  
    33 
    44 
    5 using namespace GtpVisibilityPreprocessor { 
     5namespace GtpVisibilityPreprocessor { 
    66 
    77 
  • GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp

    r860 r863  
    99#include "Mesh.h" 
    1010 
    11 using namespace GtpVisibilityPreprocessor { 
     11namespace GtpVisibilityPreprocessor { 
    1212 
    1313// int facesPerMesh = 100000000; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h

    r860 r863  
    55#include "Containers.h" 
    66 
    7 using namespace GtpVisibilityPreprocessor { 
     7namespace GtpVisibilityPreprocessor { 
    88 
    99class ViewCellsManager; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp

    r860 r863  
    66 
    77 
    8 using namespace GtpVisibilityPreprocessor { 
     8namespace GtpVisibilityPreprocessor { 
    99 
    1010 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Polytope.cpp

    r860 r863  
    11#include "Polytope.h" 
    22 
    3 using namespace GtpVisibilityPreprocessor { 
     3namespace GtpVisibilityPreprocessor { 
    44 
    55/************************************************ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r860 r863  
    1414#include "PlyParser.h" 
    1515 
    16 using namespace GtpVisibilityPreprocessor { 
     16namespace GtpVisibilityPreprocessor { 
    1717 
    1818 
  • GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp

    r860 r863  
    88 
    99 
    10 using namespace GtpVisibilityPreprocessor { 
     10namespace GtpVisibilityPreprocessor { 
    1111 
    1212 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp

    r860 r863  
    22#include "Pvs.h" 
    33 
    4 using namespace GtpVisibilityPreprocessor { 
     4namespace GtpVisibilityPreprocessor { 
    55 
    66int 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Ray.cpp

    r860 r863  
    33#include "VssRay.h" 
    44 
    5 using namespace GtpVisibilityPreprocessor { 
     5namespace GtpVisibilityPreprocessor { 
    66 
    77// ========================================================= 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp

    r860 r863  
    44#include "Plane3.h" 
    55 
    6 using namespace GtpVisibilityPreprocessor { 
     6namespace GtpVisibilityPreprocessor { 
    77 
    88RayInfo::RayInfo(): mRay(NULL), mMinT(0), 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.cpp

    r860 r863  
    11#include "Rectangle3.h" 
    22 
    3 using namespace GtpVisibilityPreprocessor { 
     3namespace GtpVisibilityPreprocessor { 
    44 
    55 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.h

    r860 r863  
    11#ifndef __RECTANGLE3_H 
    22#define __RECTANGLE3_H 
     3 
    34#include <iostream> 
    45using namespace std; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RenderSimulator.cpp

    r860 r863  
    88 
    99 
    10 using namespace GtpVisibilityPreprocessor { 
     10namespace GtpVisibilityPreprocessor { 
    1111 
    1212 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Renderer.cpp

    r860 r863  
    11#include "Renderer.h" 
    22 
    3 using namespace GtpVisibilityPreprocessor { 
     3namespace GtpVisibilityPreprocessor { 
    44 
    55 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp

    r860 r863  
    1313#include "GlRenderer.h" 
    1414 
    15 using namespace GtpVisibilityPreprocessor { 
     15namespace GtpVisibilityPreprocessor { 
    1616 
    1717 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h

    r860 r863  
    55using namespace std; 
    66 
    7  
    87#include "Preprocessor.h" 
    98#include "VssRay.h" 
     9 
     10namespace GtpVisibilityPreprocessor { 
     11 
     12 
    1013class RssTree; 
    1114class RssTreeLeaf; 
    1215 
    13 namespace GtpVisibilityPreprocessor { 
    1416 
    1517/** Sampling based visibility preprocessing. The implementation is based on heuristical 
     
    141143 
    142144 
    143 } 
     145}; 
    144146 
    145147#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp

    r860 r863  
    3030 
    3131 
    32 using namespace GtpVisibilityPreprocessor { 
     32namespace GtpVisibilityPreprocessor { 
    3333 
    3434 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.h

    r860 r863  
    10811081}; 
    10821082 
    1083 } 
    1084  
    1085 #endif // __LSDS_KDTREE_H__ 
    1086  
     1083}; 
     1084 
     1085#endif // __RSSTREE_H__ 
     1086 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp

    r860 r863  
    1111 
    1212 
    13 using namespace GtpVisibilityPreprocessor { 
     13namespace GtpVisibilityPreprocessor { 
    1414 
    1515 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp

    r860 r863  
    77 
    88 
    9 using namespace GtpVisibilityPreprocessor { 
     9namespace GtpVisibilityPreprocessor { 
    1010 
    1111 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Tetrahedron3.cpp

    r860 r863  
    22 
    33 
    4 using namespace GtpVisibilityPreprocessor { 
     4namespace GtpVisibilityPreprocessor { 
    55 
    66 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Triangle3.cpp

    r860 r863  
    11#include "Triangle3.h" 
    22 
    3 using namespace GtpVisibilityPreprocessor { 
     3namespace GtpVisibilityPreprocessor { 
    44 
    55float 
  • GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp

    r860 r863  
    1313#include "Environment.h" 
    1414 
    15 using namespace GtpVisibilityPreprocessor { 
     15namespace GtpVisibilityPreprocessor { 
    1616 
    1717#define ROTATE_SCENE 0 
  • GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h

    r860 r863  
    33 
    44#include <string> 
    5 using namespace std; 
    65#include "Parser.h" 
    76 
     
    1615  UnigraphicsParser(): Parser() {} 
    1716   
    18   virtual bool ParseFile(const string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false); 
     17  virtual bool ParseFile(const std::string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false); 
    1918   
    2019}; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.cpp

    r860 r863  
    33#include "Halton.h" 
    44 
    5 using namespace GtpVisibilityPreprocessor { 
     5namespace GtpVisibilityPreprocessor { 
    66 
    77// Given min a vector to minimize and a candidate vector, replace 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.h

    r860 r863  
    77#include "common.h" 
    88 
     9 
    910namespace GtpVisibilityPreprocessor { 
    1011 
     
    1213class Matrix4x4; 
    1314class Vector2; 
     15 
    1416 
    1517// HACK of returning vector components as array fields. 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r860 r863  
    1313#include <stack> 
    1414 
    15 using namespace GtpVisibilityPreprocessor { 
     15namespace GtpVisibilityPreprocessor { 
    1616 
    1717 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r860 r863  
    1515#include <stack> 
    1616 
    17 using namespace GtpVisibilityPreprocessor { 
     17namespace GtpVisibilityPreprocessor { 
    1818 
    1919 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r860 r863  
    1616#include "RssPreprocessor.h" 
    1717 
    18 using namespace GtpVisibilityPreprocessor { 
     18namespace GtpVisibilityPreprocessor { 
    1919 
    2020 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r860 r863  
    3131#include "ViewCellsManager.h" 
    3232 
    33 using namespace GtpVisibilityPreprocessor { 
     33namespace GtpVisibilityPreprocessor { 
    3434 
    3535 
     
    132132} 
    133133 
    134 inline bool vlt(ViewCell *v1, ViewCell *v2) 
     134inline static bool vlt(ViewCell *v1, ViewCell *v2) 
    135135{ 
    136136        return v1->mId < v2->mId; 
     
    297297 
    298298                                ObjectContainer::iterator oit = 
    299                                   lower_bound(mObjects->begin(), mObjects->end(), &dummyInst, ilt); 
     299                                  lower_bound(mObjects->begin(), mObjects->end(), (Intersectable *)&dummyInst, ilt); 
    300300                                 
    301301                                Intersectable *obj = *oit; 
     
    444444        else 
    445445        { 
     446                // add to invalid view space 
    446447                if (mViewCellsManager->GetType() == ViewCellsManager::VSP_BSP) 
    447448                { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp

    r860 r863  
    1515#include "Beam.h" 
    1616 
    17 using namespace GtpVisibilityPreprocessor { 
     17namespace GtpVisibilityPreprocessor { 
    1818 
    1919 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r860 r863  
    1818#include "Beam.h" 
    1919 
    20 using namespace GtpVisibilityPreprocessor { 
     20namespace GtpVisibilityPreprocessor { 
    2121 
    2222#define USE_FIXEDPOINT_T 0 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h

    r860 r863  
    1010#include "RayInfo.h" 
    1111#include "ViewCellBsp.h" 
     12 
     13namespace GtpVisibilityPreprocessor { 
    1214 
    1315class ViewCell; 
     
    2527class ViewCellsTree; 
    2628 
    27 namespace GtpVisibilityPreprocessor { 
    2829 
    2930/** 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.cpp

    r860 r863  
    2828#include "ViewCellBsp.h" 
    2929 
    30 using namespace GtpVisibilityPreprocessor { 
     30namespace GtpVisibilityPreprocessor { 
    3131 
    3232// Static variables 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp

    r860 r863  
    1515#include "ViewCellBsp.h" 
    1616 
    17 using namespace GtpVisibilityPreprocessor { 
     17namespace GtpVisibilityPreprocessor { 
    1818 
    1919bool use2dSampling = false; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.cpp

    r860 r863  
    22#include "AxisAlignedBox3.h" 
    33 
    4 using namespace GtpVisibilityPreprocessor { 
     4namespace GtpVisibilityPreprocessor { 
    55 
    66// Static variables 
     
    106106bool 
    107107VssRay::Intersects(const AxisAlignedBox3 &box, 
    108                                                                                                         float &tmin, 
    109                                                                                                         float &tmax) const 
     108                                   float &tmin, 
     109                                   float &tmax) const 
    110110{ 
    111111  if (!ComputeMinMaxT(box, tmin, tmax)) 
     
    124124bool 
    125125VssRay::IntersectsSphere(const Vector3 &center, 
    126                                                                                                                                 const float sqrRadius, 
    127                                                                                                                                 Vector3 &point, 
    128                                                                                                                                 float &t) const 
     126                                                 const float sqrRadius, 
     127                                                 Vector3 &point, 
     128                                                 float &t) const 
    129129{ 
    130130  // compute ray/plane intersection 
     
    141141  point = GetOrigin() + t*dir; 
    142142   
    143   return ::SqrDistance(point, center) < sqrRadius; 
     143  return GtpVisibilityPreprocessor::SqrDistance(point, center) < sqrRadius; 
    144144} 
    145145 
     
    239239          selected.push_back(*it); 
    240240   
    241   return selected.size(); 
     241  return (int)selected.size(); 
    242242} 
    243243 
     
    255255          selected.push_back(ray); 
    256256  } 
    257   return selected.size(); 
    258 } 
    259  
    260 } 
     257  return (int)selected.size(); 
     258} 
     259 
     260} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h

    r860 r863  
    320320}; 
    321321 
    322 } 
     322}; 
    323323 
    324324#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp

    r860 r863  
    2525#include "Ray.h" 
    2626 
    27 using namespace GtpVisibilityPreprocessor { 
     27namespace GtpVisibilityPreprocessor { 
    2828 
    2929#define DEBUG_SPLIT_COST 0 
     
    18361836  if (1) { 
    18371837        //      return GetAvgRayContribution(); 
    1838         return GetPvsSize(); 
     1838        return (float)GetPvsSize(); 
    18391839  } else { 
    18401840        // return GetAvgRayContribution()*mEntropyImportance; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.h

    r860 r863  
    924924 
    925925  int 
    926   CollectRays(VssRayContainer &rays 
    927                           ); 
     926  CollectRays(VssRayContainer &rays); 
    928927   
    929928}; 
    930929 
    931 } 
     930}; 
    932931 
    933932#endif // __LSDS_KDTREE_H__ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp

    r860 r863  
    1515#include "Beam.h" 
    1616 
    17 using namespace GtpVisibilityPreprocessor { 
     17namespace GtpVisibilityPreprocessor { 
    1818 
    1919 
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.h

    r860 r863  
    147147}; 
    148148 
    149 } 
     149}; 
    150150 
    151151#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp

    r860 r863  
    3030#include "ViewCellsManager.h" 
    3131 
    32 using namespace GtpVisibilityPreprocessor { 
     32namespace GtpVisibilityPreprocessor { 
    3333 
    3434 
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h

    r860 r863  
    1212{ 
    1313public: 
    14   X3dParser():Parser(), mViewCellHeight(5.0f) {} 
     14        X3dParser():Parser(), mViewCellHeight(5.0f) {} 
    1515   
    16   bool ParseFile(const string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false); 
    17   bool ParseFile(const string filename, ViewCellsManager &viewCells); 
     16        bool ParseFile(const string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false); 
     17        bool ParseFile(const string filename, ViewCellsManager &viewCells); 
    1818  
    19  
    20  
    21   /// height of a loaded view cell 
    22   float mViewCellHeight; 
     19        /// height of a loaded view cell 
     20        float mViewCellHeight; 
    2321}; 
    2422 
    25 } 
     23}; 
    2624 
    2725#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/common.cpp

    r542 r863  
    2323#endif 
    2424 
     25namespace GtpVisibilityPreprocessor { 
    2526 
    2627 
     
    4647Real Limits::Threshold = 1e-6f; 
    4748Real Limits::Small = 0.01f; 
    48 Real Limits::Infinity = 1e20; 
     49Real Limits::Infinity = 1e20f; 
    4950 
    5051 
     
    284285  return false; 
    285286} 
    286 #endif 
     287 
     288#endif 
     289 
     290} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/common.h

    r860 r863  
    1919#include <iostream> 
    2020#include <fstream> 
     21#include <limits.h> 
    2122 
    2223using namespace std; 
    2324 
    24 #include <limits.h> 
     25 
     26 
     27namespace GtpVisibilityPreprocessor { 
     28 
    2529 
    2630 
     
    475479GetPath(const char *s); 
    476480 
    477 #endif 
    478  
    479  
    480  
    481  
    482  
    483  
    484  
    485  
    486  
    487  
    488  
     481} 
     482 
     483#endif 
     484 
     485 
     486 
     487 
     488 
     489 
     490 
     491 
     492 
     493 
     494 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r840 r863  
    2424#include <crtdbg.h> 
    2525 
    26  
     26using namespace GtpVisibilityPreprocessor; 
    2727 
    2828int 
Note: See TracChangeset for help on using the changeset viewer.