Ignore:
Timestamp:
09/27/06 16:24:39 (18 years ago)
Author:
mattausch
Message:

moved raycasting out of preprocessor into specific ray casting interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r1486 r1520  
    88#include "KdTree.h" 
    99 
    10 // matt: remove qt dependencies 
    11 //#include <QObject> 
     10 
    1211 
    1312namespace GtpVisibilityPreprocessor { 
     
    2928class Intersectable; 
    3029class VssRay; 
     30class RayCaster; 
     31 
    3132 
    3233/** Namespace for the external visibility preprocessor 
     
    4546{ 
    4647  //Q_OBJECT 
    47  
     48        friend class RayCaster; 
     49        friend class IntelRayCaster; 
     50        friend class InternalRayCaster; 
     51         
    4852public: 
    4953        /** Default constructor initialising e.g., KD tree and BSP tree. 
     
    5155        Preprocessor(); 
    5256 
    53    virtual ~Preprocessor(); 
     57        virtual ~Preprocessor(); 
    5458 
    5559  /** Load the input scene.  
     
    123127  bool ExportKdTree(const string filename); 
    124128 
    125   /** Get Sample rays of particular type, returns false if this 
    126           type of rays is not supported by the preprocessor 
    127   */ 
    128   enum { 
    129         OBJECT_BASED_DISTRIBUTION, 
    130         DIRECTION_BASED_DISTRIBUTION, 
    131         DIRECTION_BOX_BASED_DISTRIBUTION, 
    132         SPATIAL_BOX_BASED_DISTRIBUTION, 
    133         RSS_BASED_DISTRIBUTION, 
    134         RSS_SILHOUETTE_BASED_DISTRIBUTION, 
    135         VSS_BASED_DISTRIBUTION, 
    136         OBJECT_DIRECTION_BASED_DISTRIBUTION, 
    137         OBJECTS_INTERIOR_DISTRIBUTION 
    138   }; 
    139    
    140   enum { 
    141           INTERNAL_RAYCASTER = 0, 
    142           INTEL_RAYCASTER 
    143   }; 
    144  
    145129  virtual bool 
    146130  GenerateRays( 
     
    157141 
    158142  virtual void CastRays(SimpleRayContainer &rays, 
    159                                                 VssRayContainer &vssRays); 
     143                                                VssRayContainer &vssRays, 
     144                                                const bool castDoubleRays); 
    160145 
    161146  /** Returns a view cells manager of the given name. 
     
    178163          ); 
    179164 
    180   Intersectable * 
    181   CastSimpleRay( 
    182                                 const Vector3 &viewPoint, 
    183                                 const Vector3 &direction, 
    184                                 const AxisAlignedBox3 &box, 
    185                                 Vector3 &point, 
    186                                 Vector3 &normal 
    187                                 ); 
    188165   
    189166  //////////////////////////////////////////////// 
     
    234211  float mVisibilityFilterWidth; 
    235212  
    236   int GetRayCastMethod() { return mRayCastMethod; } 
    237   void SetRayCastMethod(int rayCastMethod) { mRayCastMethod = rayCastMethod; } 
     213  //int GetRayCastMethod() { return mRayCastMethod; } 
     214  //void SetRayCastMethod(int rayCastMethod) { mRayCastMethod = rayCastMethod; } 
    238215 
    239216  int mPass; 
     
    241218protected: 
    242219 
    243         void SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction); 
    244  
    245   int 
    246   ProcessRay( 
    247                          const Vector3 &viewPoint, 
    248                          const Vector3 &direction, 
    249                          Intersectable *objectA, 
    250                          Vector3 &pointA, 
    251                          const Vector3 &normalA, 
    252                          Intersectable *objectB, 
    253                          Vector3 &pointB, 
    254                          const Vector3 &normalB, 
    255                          const float probability, 
    256                          VssRayContainer &vssRays, 
    257                          const AxisAlignedBox3 &box); 
    258    
    259   int CastInternalRay( 
    260                                           const Vector3 &viewPoint, 
    261                                           const Vector3 &direction, 
    262                                           const float probability, 
    263                                           VssRayContainer &vssRays, 
    264                                           const AxisAlignedBox3 &box); 
    265    
    266   int CastIntelDoubleRay( 
    267                                                  const Vector3 &viewPoint, 
    268                                                  const Vector3 &direction, 
    269                                                  const float probability, 
    270                                                  VssRayContainer &vssRays, 
    271                                                  const AxisAlignedBox3 &box); 
    272    
    273   Intersectable *CastIntelSingleRay( 
    274                                                                         const Vector3 &viewPoint, 
    275                                                                         const Vector3 &direction, 
    276                                                                         Vector3 &tPoint, 
    277                                                                         const AxisAlignedBox3 &box); 
    278    
    279   ///////////////////////// 
    280  
    281   int mRayCastMethod; 
     220        void SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction) const; 
     221 
     222        // matt: previously was a signal 
     223        void EvalPvsStat(); 
     224 
     225        ///////////////////////// 
     226 
     227  RayCaster *mRayCaster; 
    282228  /// samples used for construction of the BSP view cells tree. 
    283229  int mBspConstructionSamples; 
     
    287233  */ 
    288234  RenderSimulator *mRenderSimulator; 
    289  
    290235   
    291236  vector<FaceParentInfo> mFaceParents; 
    292    
     237 
    293238  GlRendererBuffer *renderer; 
    294 // matt: remove qt dependencies  
    295 //signals: 
    296   void EvalPvsStat(); 
    297  
    298   protected: 
    299  
    300    
    301   void CastRays16(const int i, 
    302                                   SimpleRayContainer &rays,  
    303                                   VssRayContainer &vssRays, 
    304                                   const AxisAlignedBox3 &sbox); 
     239 
    305240   
    306241}; 
    307242 
    308 //extern Preprocessor *preprocessor; 
    309243 
    310244} 
Note: See TracChangeset for help on using the changeset viewer.