Changeset 1521 for GTP/trunk/Lib
- Timestamp:
- 09/27/06 17:20:00 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/src/GtpVisibility.vcproj
r1288 r1521 194 194 RuntimeTypeInfo="TRUE" 195 195 UsePrecompiledHeader="0" 196 BrowseInformation="1" 196 197 WarningLevel="3" 197 198 Detect64BitPortabilityProblems="TRUE" -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r1520 r1521 7 7 #include "IntersectableWrapper.h" 8 8 #include "Plane3.h" 9 9 #include "RayCaster.h" 10 10 11 11 … … 47 47 { 48 48 VssRay *newRay = ReverseSampling(currentRay, hitTriangle, oldRay); 49 HandleRay(*newRay); 49 if (!HandleRay(newRay)) 50 delete newRay; 51 50 52 return true; 51 53 } … … 55 57 56 58 57 bool GvsPreprocessor::HandleRay(VssRay &vssRay)58 { 59 if (mViewCellsManager->ComputeSampleContribution( vssRay, true, false))59 bool GvsPreprocessor::HandleRay(VssRay *vssRay) 60 { 61 if (mViewCellsManager->ComputeSampleContribution(*vssRay, true, false)) 60 62 { 61 63 //cout << "h"; 62 mRayQueue.push( &vssRay);64 mRayQueue.push(vssRay); 63 65 return true; 64 66 } … … 155 157 const Vector3 p = (p1 + p2) * 0.5f; 156 158 SimpleRay sray(oldRay.mOrigin, p - oldRay.mOrigin); 157 VssRay *newRay = NULL;158 //VssRay *newRay = CastSingleRay(sray);159 HandleRay(*newRay);160 159 160 VssRay *newRay = mRayCaster->CastSingleRay(sray.mOrigin, sray.mDirection, 1, mViewSpaceBox); 161 bool addedToQueue = HandleRay(newRay); 162 161 163 const int s1 = SubdivideEdge(hitTriangle, p1, p, x, *newRay, oldRay); 162 164 const int s2 = SubdivideEdge(hitTriangle, p, p2, *newRay, y, oldRay); 163 164 return s1 + s2; 165 return s1 + s2; 166 167 if (!addedToQueue) 168 delete newRay; 165 169 } 166 170 } … … 291 295 for (vit = samples.begin(); vit != vit_end; ++ vit) 292 296 { 293 HandleRay(* (*vit));297 HandleRay(*vit); 294 298 } 295 299 } … … 330 334 331 335 castSamples += AdaptiveBorderSampling(*ray); 336 337 delete ray; 332 338 } 333 339 -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r1500 r1521 72 72 b) if triangle was found reverse sampling 73 73 */ 74 bool HandleRay(VssRay &ray);74 bool HandleRay(VssRay *ray); 75 75 76 76 /** The adaptive border sampling step. It aims to find neighbouring -
GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.cpp
r1520 r1521 37 37 VssRayContainer &vssRays, 38 38 const AxisAlignedBox3 &box, 39 const bool castDoubleRay, 40 const int pass 39 const bool castDoubleRay 41 40 ) 42 41 { … … 113 112 VssRayContainer &vssRays, 114 113 const AxisAlignedBox3 &sbox, 115 const bool castDoubleRay, 116 const int pass) 114 const bool castDoubleRay) 117 115 { 118 116 int i; -
GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.cpp
r1520 r1521 21 21 22 22 23 int InternalRayCaster::CastRay( 24 const Vector3 &viewPoint, 23 int InternalRayCaster::CastRay(const Vector3 &viewPoint, 25 24 const Vector3 &direction, 26 25 const float probability, … … 76 75 77 76 78 void InternalRayCaster::CastRays16( 79 const int index, 77 void InternalRayCaster::CastRays16(const int index, 80 78 SimpleRayContainer &rays, 81 79 VssRayContainer &vssRays, … … 83 81 const bool castDoubleRays) 84 82 { 85 int i;86 83 const int num = 16; 87 84 … … 91 88 92 89 // no acceleration for ray bundles implemented right now 93 for (i =index; i < index + num; i++)90 for (int i=index; i < index + num; i++) 94 91 { 95 92 CastRay(rays[i].mOrigin, -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1520 r1521 193 193 } 194 194 195 int 196 SplitFilenames(const string str, vector<string> &filenames) 195 196 GlRendererBuffer *Preprocessor::GetRenderer() 197 { 198 return renderer; 199 } 200 201 202 static int SplitFilenames(const string str, vector<string> &filenames) 197 203 { 198 204 int pos = 0; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r1520 r1521 42 42 viewcell loading/generation and the visibility computation itself. 43 43 */ 44 // matt: remove qt dependencies 45 class Preprocessor// : public QObject 44 class Preprocessor 46 45 { 47 //Q_OBJECT48 46 friend class RayCaster; 49 47 friend class IntelRayCaster; … … 64 62 65 63 /** Export all preprocessed data in a XML format understandable by the 66 PreprocessingInterface of the GtpVisibilityPreprocessor Module. The file can be compressed depending67 64 PreprocessingInterface of the GtpVisibilityPreprocessor Module. 65 The file can be compressed depending on the environement settings. 68 66 @return true on successful export 69 67 */ … … 100 98 SamplingStrategy *GenerateSamplingStrategy(const int strategyId) const; 101 99 102 bool 103 Export( const string filename, 104 const bool scene, 105 const bool kdtree, 106 const bool bsptree 107 ); 108 100 bool Export( 101 const string filename, 102 const bool scene, 103 const bool kdtree, 104 const bool bsptree); 109 105 110 106 virtual void KdTreeStatistics(ostream &s); … … 151 147 HierarchyManager *CreateHierarchyManager(const char *name); 152 148 153 GlRendererBuffer *GetRenderer() { return renderer;}149 GlRendererBuffer *GetRenderer(); 154 150 155 151 bool InitRayCast(const string externKdTree, const string internKdTree); 156 152 157 int CastRay( 158 const Vector3 &viewPoint, 159 const Vector3 &direction, 160 const float probability, 161 VssRayContainer &vssRays, 162 const AxisAlignedBox3 &box 163 ); 164 165 153 166 154 //////////////////////////////////////////////// 167 155 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r1520 r1521 225 225 RuntimeTypeInfo="TRUE" 226 226 UsePrecompiledHeader="0" 227 BrowseInformation="1" 227 228 WarningLevel="2" 228 229 Detect64BitPortabilityProblems="TRUE" -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp
r1520 r1521 14 14 mPreprocessor(preprocessor) 15 15 { 16 } 17 18 19 RayCaster::~RayCaster() 20 { 21 } 22 23 24 VssRay *RayCaster::CastSingleRay(const Vector3 &viewPoint, 25 const Vector3 &direction, 26 const float probability, 27 const AxisAlignedBox3 &box) 28 { 29 VssRayContainer rays; 30 CastRay(viewPoint, direction, probability, rays, box, false); 31 32 if (!rays.empty()) 33 return rays.back(); 16 34 } 17 35 -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r1520 r1521 31 31 RayCaster(const Preprocessor &preprocessor); 32 32 33 virtual ~RayCaster() = 0;33 virtual ~RayCaster(); 34 34 35 35 virtual int Type() const = 0; 36 37 /** Wrapper for casting single ray. 38 */ 39 VssRay *CastSingleRay( 40 const Vector3 &viewPoint, 41 const Vector3 &direction, 42 const float probability, 43 const AxisAlignedBox3 &box 44 ); 36 45 37 46 virtual int CastRay( -
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
r1486 r1521 14 14 #include "GlRenderer.h" 15 15 #include "Intersectable.h" 16 #ifdef GTP_INTERNAL 17 #include "ArchModeler2MLRT.hxx" 18 #endif 16 #include "RayCaster.h" 17 19 18 20 19 namespace GtpVisibilityPreprocessor { … … 488 487 Vector3 direction = GetDirection(viewpoint, &mViewSpaceBox); 489 488 490 sampleContributions = CastRay(viewpoint, direction, 1, mVssRays, mViewSpaceBox);489 sampleContributions = mRayCaster->CastRay(viewpoint, direction, 1, mVssRays, mViewSpaceBox, true); 491 490 492 491 if (sampleContributions) { … … 617 616 618 617 for (int i=0; i < rays.size(); i++) 619 CastRay(rays[i].mOrigin, rays[i].mDirection, 1, vssRays, mViewSpaceBox); 618 { 619 mRayCaster->CastRay(rays[i].mOrigin, rays[i].mDirection, 1, vssRays, mViewSpaceBox, true); 620 } 620 621 621 622 vssTree->AddRays(vssRays);
Note: See TracChangeset
for help on using the changeset viewer.