#include <Display.h>
Public Methods | |
| Display () | |
| virtual | ~Display () |
| virtual void | config (jccl::ConfigElementPtr element) |
| Takes a display config element and configures the display based one it. More... | |
| void | configDisplayWindow (jccl::ConfigElementPtr element) |
| void | configViewports (jccl::ConfigElementPtr element) |
| void | updateProjections (const float positionScale) |
| Updates the projection data for each contained viewport. More... | |
| bool | isActive () |
| void | setName (std::string name) |
| std::string | getName () |
| Gets the name of this display. More... | |
| bool | shouldDrawBorder () |
| void | setOriginAndSize (int xo, int yo, int xs, int ys, bool updateConfig=false) |
| Explicitly set the origin and size. More... | |
| void | getOriginAndSize (int &xo, int &yo, int &xs, int &ys) |
| Return the current origin and size. More... | |
| void | setPipe (int pipe) |
| int | getPipe () |
| bool | isStereoRequested () |
| Indicates whether stereo rendering has been requested for this display. More... | |
| jccl::ConfigElementPtr | getConfigElement () |
| Gets the config element that configured this display window. More... | |
| jccl::ConfigElementPtr | getGlFrameBufferConfig () |
| friend | VJ_API (std::ostream &) operator<<(std |
| vrj::Viewport * | getViewport (int vpNum) |
Protected Attributes | |
| std::string | mName |
| Name of the window. More... | |
| int | _xo |
| int | _yo |
| int | _xs |
| int | _ys |
| X and Y origin and size of the view. More... | |
| bool | mBorder |
| Should we have a border. More... | |
| int | mPipe |
| Hardware pipe. More... | |
| bool | mActive |
| Is the display active or not? More... | |
| bool | mStereoRequested |
| Has stereo been requested? More... | |
| jccl::ConfigElementPtr | mDisplayElement |
| The config data for this display. More... | |
| std::vector< vrj::Viewport * > | mViewports |
| Contained viewports. More... | |
Stores location of window and viewports within the window.
Definition at line 50 of file Display.h.
|
|
Definition at line 53 of file Display.h.
|
|
|
Definition at line 58 of file Display.h.
00059 {;}
|
|
|
Takes a display config element and configures the display based one it.
Definition at line 66 of file Display.cpp. References configDisplayWindow, and configViewports.
00067 {
00068 vprASSERT(element.get() != NULL);
00069
00070 configDisplayWindow(element);
00071 configViewports(element);
00072 }
|
|
|
Definition at line 74 of file Display.cpp. References mActive, mBorder, mDisplayElement, mStereoRequested, setName, setOriginAndSize, setPipe, and vrjDBG_DISP_MGR. Referenced by config.
00075 {
00076 vprASSERT(element.get() != NULL);
00077
00078 // -- Get config info from element -- //
00079 int originX = element->getProperty<int>("origin", 0);
00080 int originY = element->getProperty<int>("origin", 1);
00081 int sizeX = element->getProperty<int>("size", 0);
00082 int sizeY = element->getProperty<int>("size", 1);
00083 std::string name = element->getName();
00084 mBorder = element->getProperty<bool>("border");
00085 int pipe = element->getProperty<int>("pipe");
00086 mActive = element->getProperty<bool>("active");
00087 mStereoRequested = element->getProperty<bool>("stereo");
00088
00089 // -- Check for error in configuration -- //
00090 // NOTE: If there are errors, set them to some default value
00091 if(sizeX <= 0)
00092 {
00093 vprDEBUG(vrjDBG_DISP_MGR, vprDBG_WARNING_LVL)
00094 << "WARNING: window sizeX set to: " << sizeX
00095 << ". Setting to 10." << std::endl << vprDEBUG_FLUSH;
00096 sizeX = 10;
00097 }
00098
00099 if(sizeY <= 0)
00100 {
00101 vprDEBUG(vrjDBG_DISP_MGR, vprDBG_WARNING_LVL)
00102 << "WARNING: window sizeY set to: " << sizeY
00103 << ". Setting to 10." << std::endl << vprDEBUG_FLUSH;
00104 sizeY = 10;
00105 }
00106
00107 if(pipe < 0)
00108 {
00109 vprDEBUG(vrjDBG_DISP_MGR, vprDBG_WARNING_LVL)
00110 << "WARNING: pipe was negative, pipe set to: " << pipe
00111 << ". Setting to 0.\n" << vprDEBUG_FLUSH;
00112 pipe = 0;
00113 }
00114
00115 // -- Set local window attributes --- //
00116 setOriginAndSize(originX, originY, sizeX, sizeY);
00117
00118 setName(name);
00119 setPipe(pipe);
00120
00121 mDisplayElement = element; // Save the element for later use
00122 }
|
|
|
Definition at line 124 of file Display.cpp. References mViewports. Referenced by config.
00125 {
00126 vprASSERT(element.get() != NULL);
00127
00128 unsigned num_sim_vps = element->getNum("simulator_viewports");
00129 unsigned num_surface_vps = element->getNum("surface_viewports");
00130
00131 jccl::ConfigElementPtr vp_elt;
00132 SimViewport* sim_vp = NULL;
00133 SurfaceViewport* surf_vp = NULL;
00134
00135 unsigned i(0);
00136
00137 // Create sim viewports
00138 // - Set the parent display
00139 // - Configure it
00140 for(i=0;i<num_sim_vps;i++)
00141 {
00142 vp_elt = element->getProperty<jccl::ConfigElementPtr>("simulator_viewports",i);
00143 sim_vp = new SimViewport;
00144 sim_vp->setDisplay(this);
00145 sim_vp->config(vp_elt);
00146 mViewports.push_back(sim_vp);
00147 }
00148
00149 // Create surface viewports
00150 // - Set the parent display
00151 // - Configure it
00152 for(i=0;i<num_surface_vps;i++)
00153 {
00154 vp_elt = element->getProperty<jccl::ConfigElementPtr>("surface_viewports",i);
00155 surf_vp = new SurfaceViewport;
00156 surf_vp->setDisplay(this);
00157 surf_vp->config(vp_elt);
00158 mViewports.push_back(surf_vp);
00159 }
00160 }
|
|
|
Updates the projection data for each contained viewport.
Definition at line 44 of file Display.cpp. References mViewports.
00045 {
00046 for(unsigned i=0;i<mViewports.size();i++)
00047 {
00048 mViewports[i]->updateProjections(positionScale);
00049 }
00050 }
|
|
|
Definition at line 83 of file Display.h.
00084 { return mActive; }
|
|
|
Definition at line 86 of file Display.h. Referenced by configDisplayWindow.
00087 { mName = name; }
|
|
|
Gets the name of this display.
Definition at line 90 of file Display.h. Referenced by vrj::PfDrawManager::configFrameBuffer, vrj::GlWindowXWin::configWindow, vrj::GlWindowWin32::configWindow, vrj::GlWindowOSX::configWindow, vrj::GlWindowXWin::getGlxVisInfo, and vrj::GlWindowWin32::setPixelFormat.
00091 { return mName;}
|
|
|
Definition at line 93 of file Display.h. Referenced by vrj::GlWindow::configWindow.
00094 { return mBorder;}
|
|
||||||||||||||||||||||||
|
Explicitly set the origin and size.
Definition at line 53 of file Display.cpp. References _xo, _xs, _yo, _ys, and mDisplayElement. Referenced by configDisplayWindow.
00054 {
00055 _xo = xo; _yo = yo; _xs = xs; _ys = ys;
00056 if(updateConfig)
00057 {
00058 mDisplayElement->setProperty<int>("origin", 0, xo);
00059 mDisplayElement->setProperty<int>("origin", 1, yo);
00060 mDisplayElement->setProperty<int>("size", 0, xs);
00061 mDisplayElement->setProperty<int>("size", 1, ys);
00062 }
00063 }
|
|
||||||||||||||||||||
|
Return the current origin and size.
Definition at line 102 of file Display.h. Referenced by vrj::GlWindow::configWindow.
|
|
|
Definition at line 108 of file Display.h. Referenced by configDisplayWindow.
00109 { mPipe = pipe; }
|
|
|
Definition at line 110 of file Display.h. Referenced by vrj::GlWindowXWin::configWindow, vrj::GlWindowWin32::configWindow, and vrj::GlWindowOSX::configWindow.
00111 { return mPipe; }
|
|
|
Indicates whether stereo rendering has been requested for this display.
Definition at line 118 of file Display.h. Referenced by vrj::GlWindowXWin::getGlxVisInfo, and vrj::GlWindowWin32::setPixelFormat.
00119 {
00120 return mStereoRequested;
00121 }
|
|
|
Gets the config element that configured this display window.
Definition at line 124 of file Display.h. Referenced by vrj::GlWindowXWin::configWindow, vrj::GlWindowWin32::configWindow, and vrj::GlWindowOSX::configWindow.
00125 {
00126 return mDisplayElement;
00127 }
|
|
|
Definition at line 162 of file Display.cpp. References mDisplayElement. Referenced by vrj::PfDrawManager::configFrameBuffer, vrj::GlWindowXWin::getGlxVisInfo, and vrj::GlWindowWin32::setPixelFormat.
00163 {
00164 jccl::ConfigElementPtr element;
00165
00166 // XXX: Refactor this to allow different frame buffer child elements. Right
00167 // now, this assumes that the child element type is OpenGLFBConfig.
00168 if ( mDisplayElement->getNum("frame_buffer_config") == 1 )
00169 {
00170 element =
00171 mDisplayElement->getProperty<jccl::ConfigElementPtr>("frame_buffer_config");
00172 }
00173
00174 return element;
00175 }
|
|
|
Definition at line 131 of file Display.h.
00135 { return mViewports.size(); }
|
|
|
Definition at line 137 of file Display.h. Referenced by vrj::GlWindow::finishSetup.
00138 { return mViewports[vpNum]; }
|
|
|
Name of the window.
|
|
|
Definition at line 142 of file Display.h. Referenced by setOriginAndSize. |
|
|
Definition at line 142 of file Display.h. Referenced by setOriginAndSize. |
|
|
Definition at line 142 of file Display.h. Referenced by setOriginAndSize. |
|
|
X and Y origin and size of the view.
Definition at line 142 of file Display.h. Referenced by setOriginAndSize. |
|
|
Should we have a border.
Definition at line 143 of file Display.h. Referenced by configDisplayWindow. |
|
|
Hardware pipe. Index of the rendering hardware |
|
|
Is the display active or not?
Definition at line 145 of file Display.h. Referenced by configDisplayWindow. |
|
|
Has stereo been requested?
Definition at line 146 of file Display.h. Referenced by configDisplayWindow. |
|
|
The config data for this display.
Definition at line 147 of file Display.h. Referenced by configDisplayWindow, getGlFrameBufferConfig, and setOriginAndSize. |
|
|
Contained viewports.
Definition at line 149 of file Display.h. Referenced by configViewports, and updateProjections. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002