Changeset 577

Show
Ignore:
Timestamp:
07/02/08 12:25:20 (5 months ago)
Author:
phill
Message:

o GCC hate fixed?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libx42make/topology-split.cpp

    r462 r577  
    109109} 
    110110 
     111struct LeafSortLt 
     112{ 
     113public: 
     114        LeafSortLt( const BoneTopology &topology ) : top( &topology ) { } 
     115 
     116        bool operator () ( const ConstBonePtr &a, const ConstBonePtr &b ) 
     117        { 
     118                return (*top)[a].distanceToLocalRoot < (*top)[b].distanceToLocalRoot; 
     119        } 
     120 
     121private: 
     122        const BoneTopology *top; 
     123}; 
     124 
    111125void TopologicalSplitter::AddSetsStartingAtLeaves( void ) 
    112126{ 
     
    115129 
    116130        std::vector< ConstBonePtr > toVisit; 
    117          
    118         struct LeafSort 
    119         { 
    120         public: 
    121                 LeafSort( const BoneTopology &topology ) : top( &topology ) { } 
    122  
    123                 bool operator () ( ConstBonePtr a, ConstBonePtr b ) 
    124                 { 
    125                         return (*top)[a].distanceToLocalRoot < (*top)[b].distanceToLocalRoot; 
    126                 } 
    127  
    128         private: 
    129                 const BoneTopology *top; 
    130         }; 
    131131 
    132132        toVisit.insert( toVisit.begin(), topology.leaves.begin(), topology.leaves.end() ); 
    133         std::sort( toVisit.begin(), toVisit.end(), LeafSort( topology ) ); 
     133        std::sort( toVisit.begin(), toVisit.end(), LeafSortLt( topology ) ); 
    134134 
    135135        InternalAddSets( toVisit, false, topology ); 
    136136} 
     137 
     138struct LeafSortGt 
     139{ 
     140public: 
     141        LeafSortGt( const BoneTopology &topology ) : top( &topology ) { } 
     142 
     143        bool operator () ( const ConstBonePtr &a, const ConstBonePtr &b ) 
     144        { 
     145                return (*top)[a].distanceToLocalRoot > (*top)[b].distanceToLocalRoot; 
     146        } 
     147 
     148private: 
     149        const BoneTopology *top; 
     150}; 
    137151 
    138152void TopologicalSplitter::AddSetsStartingAtRoot( void ) 
     
    142156 
    143157        std::vector< ConstBonePtr > toVisit; 
    144          
    145         struct LeafSort 
    146         { 
    147         public: 
    148                 LeafSort( const BoneTopology &topology ) : top( &topology ) { } 
    149  
    150                 bool operator () ( ConstBonePtr a, ConstBonePtr b ) 
    151                 { 
    152                         return (*top)[a].distanceToLocalRoot > (*top)[b].distanceToLocalRoot; 
    153                 } 
    154  
    155         private: 
    156                 const BoneTopology *top; 
    157         }; 
    158158 
    159159        toVisit.insert( toVisit.begin(), topology.leaves.begin(), topology.leaves.end() ); 
    160         std::sort( toVisit.begin(), toVisit.end(), LeafSort( topology ) ); 
     160        std::sort( toVisit.begin(), toVisit.end(), LeafSortGt( topology ) ); 
    161161 
    162162        InternalAddSets( toVisit, false, topology );