Ignore:
Timestamp:
02/08/06 18:25:17 (18 years ago)
Author:
mattausch
Message:

added method for associating spatial hierarchy leaf with view cell

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp

    r605 r607  
    113113 
    114114 
     115 
    115116/// helper function which destroys rays or copies them into the output ray container 
    116117inline void addOutRays(VssRayContainer &rays, VssRayContainer *outRays) 
     
    26122613 
    26132614 
     2615bool VspBspViewCellsManager::EqualToSpatialNode(ViewCell *viewCell) 
     2616{ 
     2617        BspNode *node; 
     2618        return EqualToSpatialNode(viewCell, &node); 
     2619} 
     2620 
     2621 
     2622bool VspBspViewCellsManager::EqualToSpatialNode(ViewCell *viewCell, BspNode **node) 
     2623{ 
     2624        if (!viewCell->IsLeaf()) 
     2625        { 
     2626                BspViewCell *bspVc = dynamic_cast<BspViewCell *>(viewCell); 
     2627 
     2628                *node = bspVc->mLeaf; 
     2629        return true; 
     2630        } 
     2631        else 
     2632        { 
     2633                ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(viewCell); 
     2634 
     2635                // cannot be node of binary tree 
     2636                if (interior->mChildren.size() != 2) 
     2637                        return false; 
     2638 
     2639                ViewCell *left = interior->mChildren[0]; 
     2640                ViewCell *right = interior->mChildren[1]; 
     2641 
     2642                BspNode *leftNode; 
     2643                BspNode *rightNode; 
     2644 
     2645                if (EqualToSpatialNode(left, &leftNode) && EqualToSpatialNode(right, &rightNode)) 
     2646                { 
     2647                        *node = leftNode->GetParent(); 
     2648                        return leftNode->IsSibling(rightNode);   
     2649                } 
     2650 
     2651                *node = NULL; 
     2652 
     2653                return false; 
     2654        } 
     2655} 
     2656 
     2657 
    26142658void VspBspViewCellsManager::RefineViewCells(const VssRayContainer &rays, 
    26152659                                                                                         const ObjectContainer &objects) 
Note: See TracChangeset for help on using the changeset viewer.