LCOV - code coverage report
Current view: top level - eq/fabric - projection.h (source / functions) Hit Total Coverage
Test: lcov2.info Lines: 1 7 14.3 %
Date: 2014-06-18 Functions: 2 3 66.7 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2006-2010, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *
       4             :  * This library is free software; you can redistribute it and/or modify it under
       5             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       6             :  * by the Free Software Foundation.
       7             :  *
       8             :  * This library is distributed in the hope that it will be useful, but WITHOUT
       9             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      10             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      11             :  * details.
      12             :  *
      13             :  * You should have received a copy of the GNU Lesser General Public License
      14             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      15             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      16             :  */
      17             : 
      18             : #ifndef EQFABRIC_PROJECTION_H
      19             : #define EQFABRIC_PROJECTION_H
      20             : 
      21             : #include <eq/fabric/types.h>
      22             : #include <eq/fabric/api.h>
      23             : 
      24             : #include <iostream>
      25             : 
      26             : namespace eq
      27             : {
      28             : namespace fabric
      29             : {
      30             :     /**
      31             :      * A projector definition defining a view frustum.
      32             :      *
      33             :      * The frustum is defined by a projection system positioned at origin,
      34             :      * orientated as defined by the head-pitch-roll angles projecting to a
      35             :      * wall at the given distance. The fov defines the horizontal and
      36             :      * vertical field of view of the projector.
      37             :      */
      38         229 :     class Projection
      39             :     {
      40             :     public:
      41             :         EQFABRIC_API Projection();
      42             : 
      43             :         /**
      44             :          * Resize the horizontal FOV.
      45             :          *
      46             :          * @param ratio the amount by which the FOV is grown or shrunk.
      47             :          * @version 1.0
      48             :          */
      49             :         EQFABRIC_API void resizeHorizontal( const float ratio );
      50             : 
      51             :         /**
      52             :          * Resize the vertical FOV.
      53             :          *
      54             :          * @param ratio the amount by which the FOV is grown or shrunk.
      55             :          * @version 1.0
      56             :          */
      57             :         EQFABRIC_API void resizeVertical( const float ratio );
      58             : 
      59             :         /**
      60             :          * Convert the projection parameters from a wall description.
      61             :          * @version 1.0
      62             :          */
      63             :         EQFABRIC_API Projection& operator = ( const Wall& wall );
      64             : 
      65             :         /**
      66             :          * @return true if the two projection definitions are identical.
      67             :          * @version 1.0
      68             :          */
      69             :         EQFABRIC_API bool operator == ( const Projection& rhs ) const;
      70             : 
      71             :         /**
      72             :          * @return true if the two projection definitions are not identical.
      73             :          * @version 1.0
      74             :          */
      75             :         EQFABRIC_API bool operator != ( const Projection& rhs ) const;
      76             : 
      77             :         Vector3f origin;   //!< The position of the projection
      78             :         float    distance; //!< The distance of the projection surface
      79             :         Vector2f fov;      //!< The x and y opening angle of the projection
      80             :         Vector3f hpr;      //!< The orientation (head, pitch, roll)
      81             :     };
      82             : 
      83             :     EQFABRIC_API std::ostream& operator << ( std::ostream& os, const Projection& );
      84             : }
      85             : }
      86             : namespace lunchbox
      87             : {
      88           0 : template<> inline void byteswap( eq::fabric::Projection& value )
      89             : {
      90           0 :     byteswap( value.origin );
      91           0 :     byteswap( value.distance );
      92           0 :     byteswap( value.fov );
      93           0 :     byteswap( value.hpr );
      94           0 : }
      95             : }
      96             : #endif // EQFABRIC_PROJECTION_H
      97             : 

Generated by: LCOV version 1.10