Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Display.h

Go to the documentation of this file.
00001 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00002  *
00003  * VR Juggler is (C) Copyright 1998-2003 by Iowa State University
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Christopher Just,
00007  *   Patrick Hartling, Kevin Meinert,
00008  *   Carolina Cruz-Neira, Albert Baker
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Library General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Library General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Library General Public
00021  * License along with this library; if not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00023  * Boston, MA 02111-1307, USA.
00024  *
00025  * -----------------------------------------------------------------
00026  * File:          $RCSfile: Display.h,v $
00027  * Date modified: $Date: 2003/12/31 23:25:41 $
00028  * Version:       $Revision: 1.51 $
00029  * -----------------------------------------------------------------
00030  *
00031  *************** <auto-copyright.pl END do not edit this line> ***************/
00032 
00033 #ifndef _VJ_DISPLAY_WINDOW_H_
00034 #define _VJ_DISPLAY_WINDOW_H_
00035 
00036 #include <vrj/vrjConfig.h>
00037 #include <vector>
00038 #include <jccl/Config/ConfigElementPtr.h>
00039 #include <vpr/Util/Assert.h>
00040 namespace vrj
00041 {
00042    class Viewport;
00043 
00050 class VJ_CLASS_API Display
00051 {
00052 public:
00053    Display() : mBorder(true), mPipe(-1), mActive(true), mStereoRequested(false)
00054    {
00055       _xo = _yo = _xs = _ys = -1;
00056    }
00057 
00058    virtual ~Display()
00059    {;}
00060 
00061 public:
00072    virtual void config(jccl::ConfigElementPtr element);
00073 
00074    void configDisplayWindow(jccl::ConfigElementPtr element);
00075    void configViewports(jccl::ConfigElementPtr element);
00076 
00080    void updateProjections(const float positionScale);
00081 
00082 public:
00083    bool isActive()
00084    { return mActive; }
00085 
00086    void setName(std::string name)
00087    { mName = name; }
00088 
00090    std::string getName()
00091    { return mName;}
00092 
00093    bool  shouldDrawBorder()
00094    { return mBorder;}
00095 
00099    void setOriginAndSize(int xo, int yo, int xs, int ys, bool updateConfig=false);
00100    
00102    void getOriginAndSize(int& xo, int& yo, int& xs, int& ys)
00103    {
00104       vprASSERT(_xo != -1);     // Make sure we have been configured
00105       xo = _xo; yo = _yo; xs = _xs; ys = _ys;
00106    }
00107 
00108    void setPipe(int pipe)
00109    { mPipe = pipe; }
00110    int getPipe()
00111    { return mPipe; }
00112 
00118    bool isStereoRequested()
00119    {
00120       return mStereoRequested;
00121    }
00122 
00124    jccl::ConfigElementPtr getConfigElement()
00125    {
00126       return mDisplayElement;
00127    }
00128 
00129    jccl::ConfigElementPtr getGlFrameBufferConfig();
00130 
00131    friend VJ_API(std::ostream&) operator<<(std::ostream& out, vrj::Display& disp);
00132 
00133    // --- Viewport handling --- //
00134    unsigned getNumViewports()
00135    { return mViewports.size(); }
00136 
00137    vrj::Viewport* getViewport(int vpNum)
00138    { return mViewports[vpNum]; }
00139 
00140 protected:
00141    std::string    mName;                
00142    int            _xo, _yo, _xs, _ys;   
00143    bool           mBorder;              
00144    int            mPipe;                
00145    bool           mActive;              
00146    bool           mStereoRequested;     
00147    jccl::ConfigElementPtr mDisplayElement;  
00149    std::vector<vrj::Viewport*>   mViewports;    
00150 };
00151 
00152 VJ_API(std::ostream&) operator<<(std::ostream& out, vrj::Display& disp);
00153 
00154 } // end namespace
00155 
00156 #endif

Generated on Sun May 2 15:10:16 2004 for VR Juggler by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002