Ignore:
Timestamp:
03/16/06 15:04:03 (18 years ago)
Author:
mattausch
Message:

implemented first version of the visibility filter

File:
1 edited

Legend:

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

    r697 r704  
    29512951int BspNodeGeometry::ComputeIntersection(const AxisAlignedBox3 &box) const 
    29522952{ 
    2953         AxisAlignedBox3 boundingBox; 
    2954         GetBoundingBox(boundingBox); 
    2955  
    2956         const bool overlap = Overlap(boundingBox, box); 
    2957  
    2958         // no intersections with bounding box 
    2959         if (!overlap) 
    2960         { 
    2961                 return 1; 
    2962         } 
    2963         int result = -1; 
    2964  
    29652953        // 1: box does not intersect geometry 
    29662954        // 0: box intersects geometry 
    29672955        // -1: box contains geometry 
    2968         for (int i = 0; i < 6; ++ i)  
     2956 
     2957        AxisAlignedBox3 boundingBox; 
     2958        GetBoundingBox(boundingBox); 
     2959 
     2960        // no intersections with bounding box 
     2961        if (!Overlap(box, boundingBox)) 
     2962        { 
     2963                return 1; 
     2964        } 
     2965 
     2966        // box cotains bounding box of geometry >=> contains geometry 
     2967        if (box.Includes(boundingBox)) 
     2968                return -1; 
     2969 
     2970        int result = 0; 
     2971 
     2972        // test geometry planes for intersections 
     2973        vector<Plane3>::const_iterator it, it_end = mPlanes.end(); 
     2974 
     2975        for (it = mPlanes.begin(); it != it_end; ++ it) 
    29692976        {                
    2970                 const int side = Side(box.GetPlane(i)); 
     2977                const int side = box.Side(*it); 
    29712978                 
    29722979                // box does not intersects geometry 
    29732980                if (side == 1) 
     2981                { 
    29742982                        return 1; 
    2975  
    2976                 if (side == 0) 
    2977             result = 0; 
     2983                } 
     2984                //if (side == 0) result = 0; 
    29782985  } 
    29792986 
Note: See TracChangeset for help on using the changeset viewer.