Ignore:
Timestamp:
11/15/06 14:56:00 (18 years ago)
Author:
bittner
Message:

pvs updates

File:
1 edited

Legend:

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

    r1533 r1757  
    66#include "ArchModeler2MLRT.hxx" 
    77 
    8 #define DEBUG_RAYCAST 0 
     8#define DEBUG_RAYCAST 0  
    99 
    1010 
     
    131131 
    132132        for (i=0; i < num; i++) { 
    133                 mlrtaStoreRayAS16(&rays[index + i].mOrigin.x, 
    134                         &rays[index + i].mDirection.x, 
    135                         i); 
    136         } 
     133          mlrtaStoreRayAS16(&rays[index + i].mOrigin.x, 
     134                                                &rays[index + i].mDirection.x, 
     135                                                i); 
     136        } 
     137 
     138#if DEBUG_RAYCAST 
     139                Debug<<"TA\n"<<flush; 
     140#endif 
    137141 
    138142        mlrtaTraverseGroupAS16(&min.x, 
    139                 &max.x, 
    140                 forward_hit_triangles, 
    141                 forward_dist); 
    142  
     143                                                   &max.x, 
     144                                                   forward_hit_triangles, 
     145                                                   forward_dist); 
     146         
    143147        if (castDoubleRay) 
    144         { 
     148          { 
    145149                for (i=0; i < num; i++)  
    146                 { 
     150                  { 
    147151                        Vector3 dir = -rays[index + i].mDirection; 
    148152                        mlrtaStoreRayAS16(&rays[index+i].mOrigin.x, 
    149                                 &dir.x, 
    150                                 i); 
    151                 } 
     153                                                          &dir.x, 
     154                                                          i); 
     155                  } 
     156 
     157#if DEBUG_RAYCAST 
     158                Debug<<"TB\n"<<flush; 
     159#endif 
    152160 
    153161                mlrtaTraverseGroupAS16(&min.x, 
    154                         &max.x, 
    155                         backward_hit_triangles, 
    156                         backward_dist); 
    157         } 
     162                                                           &max.x, 
     163                                                           backward_hit_triangles, 
     164                                                           backward_dist); 
     165          } 
     166 
     167#if DEBUG_RAYCAST 
     168        Debug<<"BBB\n"<<flush; 
     169#endif 
    158170 
    159171        for (i=0; i < num; i++)  
    160         { 
     172          { 
    161173                Intersection hitA(rays[i].mOrigin), hitB(rays[i].mOrigin); 
     174 
     175#if DEBUG_RAYCAST 
     176          Debug<<"FH\n"<<flush; 
     177#endif 
    162178                 
    163179                if (forward_hit_triangles[i] != -1 ) { 
    164                         if (forward_hit_triangles[i] >= mPreprocessor.mFaceParents.size()) 
    165                                 cerr<<"Warning: triangle index out of range! "<<forward_hit_triangles[i]<<endl; 
    166                         else {  
    167                                 hitA.mObject = mPreprocessor.mFaceParents[forward_hit_triangles[i]].mObject; 
    168                                 // Get the normal of that face 
    169                                 hitA.mNormal = hitA.mObject->GetNormal(mPreprocessor.mFaceParents[forward_hit_triangles[i]].mFaceIndex); 
    170                                 //-rays[index+i].mDirection; // $$ temporary 
    171                                 hitA.mPoint = rays[index+i].Extrap(forward_dist[i]); 
     180                  if (forward_hit_triangles[i] >= mPreprocessor.mFaceParents.size()) 
     181                        cerr<<"Warning: triangle index out of range! "<<forward_hit_triangles[i]<<endl; 
     182                  else {  
     183                        hitA.mObject = mPreprocessor.mFaceParents[forward_hit_triangles[i]].mObject; 
     184                        // Get the normal of that face 
     185                        hitA.mNormal = hitA.mObject->GetNormal(mPreprocessor.mFaceParents[forward_hit_triangles[i]].mFaceIndex); 
     186                        //-rays[index+i].mDirection; // $$ temporary 
     187                        hitA.mPoint = rays[index+i].Extrap(forward_dist[i]); 
    172188                        } 
     189          } 
     190#if DEBUG_RAYCAST 
     191          Debug<<"BH\n"<<flush; 
     192#endif 
     193           
     194          if (castDoubleRay && (backward_hit_triangles[i] != -1)) { 
     195                if (backward_hit_triangles[i] >= mPreprocessor.mFaceParents.size()) 
     196                  cerr<<"Warning: triangle  index out of range! "<<backward_hit_triangles[i]<<endl; 
     197                else {  
     198                  hitB.mObject = mPreprocessor.mFaceParents[backward_hit_triangles[i]].mObject; 
     199                  hitB.mNormal = hitB.mObject->GetNormal(mPreprocessor.mFaceParents[backward_hit_triangles[i]].mFaceIndex); 
     200                   
     201                  // normalB = rays[index+i].mDirection; // $$ temporary 
     202                  hitB.mPoint = rays[index+i].Extrap(-backward_dist[i]); 
    173203                } 
    174  
    175                 if (castDoubleRay && (backward_hit_triangles[i] != -1)) { 
    176                         if (backward_hit_triangles[i] >= mPreprocessor.mFaceParents.size()) 
    177                                 cerr<<"Warning: triangle  index out of range! "<<backward_hit_triangles[i]<<endl; 
    178                         else {  
    179                                 hitB.mObject = mPreprocessor.mFaceParents[backward_hit_triangles[i]].mObject; 
    180                                 hitB.mNormal = hitB.mObject->GetNormal(mPreprocessor.mFaceParents[forward_hit_triangles[i]].mFaceIndex); 
    181  
    182                                 // normalB = rays[index+i].mDirection; // $$ temporary 
    183                                 hitB.mPoint = rays[index+i].Extrap(-backward_dist[i]); 
    184                         } 
    185                 } 
    186  
    187                 ProcessRay( 
    188                         rays[index + i], 
    189                         hitA, 
    190                         hitB, 
    191                         vssRays, 
    192                         sbox, 
    193                         castDoubleRay, 
    194                         pruneInvalidRays 
    195                         ); 
    196         } 
    197  
     204          } 
     205           
     206#if DEBUG_RAYCAST 
     207          Debug<<"PR\n"<<flush; 
     208#endif 
     209           
     210          ProcessRay( 
     211                                 rays[index + i], 
     212                                 hitA, 
     213                                 hitB, 
     214                                 vssRays, 
     215                                 sbox, 
     216                                 castDoubleRay, 
     217                                 pruneInvalidRays 
     218                                 ); 
     219        } 
     220         
    198221#if DEBUG_RAYCAST 
    199222        Debug<<"C16F\n"<<flush; 
Note: See TracChangeset for help on using the changeset viewer.