Changeset 704 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
- Timestamp:
- 03/16/06 15:04:03 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r697 r704 2951 2951 int BspNodeGeometry::ComputeIntersection(const AxisAlignedBox3 &box) const 2952 2952 { 2953 AxisAlignedBox3 boundingBox;2954 GetBoundingBox(boundingBox);2955 2956 const bool overlap = Overlap(boundingBox, box);2957 2958 // no intersections with bounding box2959 if (!overlap)2960 {2961 return 1;2962 }2963 int result = -1;2964 2965 2953 // 1: box does not intersect geometry 2966 2954 // 0: box intersects geometry 2967 2955 // -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) 2969 2976 { 2970 const int side = Side(box.GetPlane(i));2977 const int side = box.Side(*it); 2971 2978 2972 2979 // box does not intersects geometry 2973 2980 if (side == 1) 2981 { 2974 2982 return 1; 2975 2976 if (side == 0) 2977 result = 0; 2983 } 2984 //if (side == 0) result = 0; 2978 2985 } 2979 2986
Note: See TracChangeset
for help on using the changeset viewer.