29 #include "framesOrderer.h" 
   46 void orderFrames( 
eq::Frames& frames, 
const eq::Matrix4d& modelviewM,
 
   47                   const eq::Matrix3d& modelviewITM,
 
   48                   const eq::Matrix4f& rotation, 
const bool orthographic )
 
   52         const bool orientation = rotation.array[10] < 0;
 
   53         sort( frames.begin(), frames.end(),
 
   54               orientation ? cmpRangesInc : cmpRangesDec );
 
   59     eq::Vector3d norm = modelviewITM * eq::Vector3d( 0.0, 0.0, 1.0 );
 
   62     sort( frames.begin(), frames.end(), cmpRangesInc );
 
   65     std::vector<double> dotVals;
 
   68     for( eq::Frames::const_iterator i = frames.begin();
 
   69          i != frames.end(); ++i )
 
   72         const double     px    = -1.0 + frame->
getRange().end*2.0;
 
   74         const eq::Vector4d pS = modelviewM * eq::Vector4d( 0.0, 0.0, px , 1.0 );
 
   75         eq::Vector3d pSsub( pS[ 0 ], pS[ 1 ], pS[ 2 ] );
 
   77         dotVals.push_back( norm.dot( pSsub ));
 
   80     const eq::Vector4d pS = modelviewM * eq::Vector4d( 0.0, 0.0,-1.0, 1.0 );
 
   81     eq::Vector3d pSsub( pS[ 0 ], pS[ 1 ], pS[ 2 ] );
 
   83     dotVals.push_back( norm.dot( pSsub ));
 
   85     size_t minPos = std::numeric_limits< size_t >::max();
 
   86     for( 
size_t i=0; i<dotVals.size()-1; i++ )
 
   87         if( dotVals[i] > 0 && dotVals[i+1] > 0 )
 
   88             minPos = 
static_cast< int >( i );
 
   90     const size_t nFrames = frames.size();
 
   92     if( minPos < frames.size()-1 )
 
   97         memcpy( &frames[ nFrames-minPos-1 ], &framesTmp[0],
 
  101         for( 
size_t i=0; i<nFrames-minPos-1; i++ )
 
  102             frames[ i ] = framesTmp[ nFrames-i-1 ];
 
EQ_API const Range & getRange() const 
std::vector< Frame * > Frames
A vector of pointers to eq::Frame. 
A holder for a frame data and related parameters.