OgreBorderPanelOverlayElement.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __BorderPanelOverlayElement_H__
30 #define __BorderPanelOverlayElement_H__
31 
33 
34 namespace Ogre {
42  class BorderRenderable;
43 
58  {
59  friend class BorderRenderable;
60  public:
62  BorderPanelOverlayElement(const String& name);
63  virtual ~BorderPanelOverlayElement();
64 
65  virtual void initialise(void);
66 
67  const String& getTypeName(void) const;
79  void setBorderSize(Real size);
80 
92  void setBorderSize(Real sides, Real topAndBottom);
93 
107  void setBorderSize(Real left, Real right, Real top, Real bottom);
108 
110  Real getLeftBorderSize(void) const;
112  Real getRightBorderSize(void) const;
114  Real getTopBorderSize(void) const;
116  Real getBottomBorderSize(void) const;
117 
128  void setLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
132  void setRightBorderUV(Real u1, Real v1, Real u2, Real v2);
136  void setTopBorderUV(Real u1, Real v1, Real u2, Real v2);
140  void setBottomBorderUV(Real u1, Real v1, Real u2, Real v2);
144  void setTopLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
148  void setTopRightBorderUV(Real u1, Real v1, Real u2, Real v2);
152  void setBottomLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
156  void setBottomRightBorderUV(Real u1, Real v1, Real u2, Real v2);
157 
158  String getLeftBorderUVString() const;
159  String getRightBorderUVString() const;
160  String getTopBorderUVString() const;
161  String getBottomBorderUVString() const;
162  String getTopLeftBorderUVString() const;
163  String getTopRightBorderUVString() const;
164  String getBottomLeftBorderUVString() const;
165  String getBottomRightBorderUVString() const;
166 
167 
168 
169 
171  void setBorderMaterialName(const String& name);
173  const String& getBorderMaterialName(void) const;
174 
176  void _updateRenderQueue(RenderQueue* queue);
178  void visitRenderables(Renderable::Visitor* visitor,
179  bool debugRenderables = false);
180 
182  void setMetricsMode(GuiMetricsMode gmm);
183 
185  void _update(void);
186 
187 
190  {
191  public:
192  String doGet(const void* target) const;
193  void doSet(void* target, const String& val);
194  };
197  {
198  public:
199  String doGet(const void* target) const;
200  void doSet(void* target, const String& val);
201  };
204  {
205  public:
206  String doGet(const void* target) const;
207  void doSet(void* target, const String& val);
208  };
211  {
212  public:
213  String doGet(const void* target) const;
214  void doSet(void* target, const String& val);
215  };
218  {
219  public:
220  String doGet(const void* target) const;
221  void doSet(void* target, const String& val);
222  };
225  {
226  public:
227  String doGet(const void* target) const;
228  void doSet(void* target, const String& val);
229  };
232  {
233  public:
234  String doGet(const void* target) const;
235  void doSet(void* target, const String& val);
236  };
239  {
240  public:
241  String doGet(const void* target) const;
242  void doSet(void* target, const String& val);
243  };
246  {
247  public:
248  String doGet(const void* target) const;
249  void doSet(void* target, const String& val);
250  };
253  {
254  public:
255  String doGet(const void* target) const;
256  void doSet(void* target, const String& val);
257  };
258  protected:
263  struct CellUV {
264  Real u1, v1, u2, v2;
265  };
266  CellUV mBorderUV[8];
267 
272 
275 
278 
280 
282  void updatePositionGeometry(void);
284  void updateTextureGeometry(void);
286  void addBaseParameters(void);
287 
289  BCELL_TOP_LEFT = 0,
290  BCELL_TOP = 1,
291  BCELL_TOP_RIGHT = 2,
292  BCELL_LEFT = 3,
293  BCELL_RIGHT = 4,
294  BCELL_BOTTOM_LEFT = 5,
295  BCELL_BOTTOM = 6,
296  BCELL_BOTTOM_RIGHT = 7
297  };
298  String getCellUVString(BorderCellIndex idx) const;
299 
300  // Command objects
311 
313  };
314 
321  {
322  protected:
324  public:
326  BorderRenderable(BorderPanelOverlayElement* parent) : mParent(parent)
327  {
328  mUseIdentityProjection = true;
329  mUseIdentityView = true;
330  }
331  const MaterialPtr& getMaterial(void) const { return mParent->mBorderMaterial; }
332  void getRenderOperation(RenderOperation& op) { op = mParent->mRenderOp2; }
333  void getWorldTransforms(Matrix4* xform) const { mParent->getWorldTransforms(xform); }
334  unsigned short getNumWorldTransforms(void) const { return 1; }
335  Real getSquaredViewDepth(const Camera* cam) const { return mParent->getSquaredViewDepth(cam); }
336  const LightList& getLights(void) const
337  {
338  // N/A, panels are not lit
339  static LightList ll;
340  return ll;
341  }
342  bool getPolygonModeOverrideable(void) const
343  {
344  return mParent->getPolygonModeOverrideable();
345  }
346  };
350 } // namespace Ogre
351 
352 #endif // __BorderPanelOverlayElement_H__
Ogre::HashedVector< Light * >
Ogre::BorderPanelOverlayElement::CmdBorderTopUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:210
Ogre::BorderPanelOverlayElement::mBorderMaterialName
String mBorderMaterialName
Definition: OgreBorderPanelOverlayElement.h:273
Ogre::BorderPanelOverlayElement::CellUV
Definition: OgreBorderPanelOverlayElement.h:263
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::BorderPanelOverlayElement
A specialisation of the PanelOverlayElement to provide a panel with a border.
Definition: OgreBorderPanelOverlayElement.h:57
Ogre::PanelOverlayElement
OverlayElement representing a flat, single-material (or transparent) panel which can contain other el...
Definition: OgrePanelOverlayElement.h:58
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre::BorderRenderable::getRenderOperation
void getRenderOperation(RenderOperation &op)
Gets the render operation required to send this object to the frame buffer.
Definition: OgreBorderPanelOverlayElement.h:332
Ogre::BorderPanelOverlayElement::mPixelTopBorderSize
ushort mPixelTopBorderSize
Definition: OgreBorderPanelOverlayElement.h:270
Ogre::BorderRenderable
Class for rendering the border of a BorderPanelOverlayElement.
Definition: OgreBorderPanelOverlayElement.h:320
Ogre::BorderPanelOverlayElement::mPixelRightBorderSize
ushort mPixelRightBorderSize
Definition: OgreBorderPanelOverlayElement.h:269
Ogre::GuiMetricsMode
GuiMetricsMode
Enum describing how the position / size of an element is to be recorded.
Definition: OgreOverlayElement.h:58
Ogre::BorderPanelOverlayElement::CmdBorderTopLeftUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:231
Ogre::BorderRenderable::getPolygonModeOverrideable
bool getPolygonModeOverrideable(void) const
Gets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setti...
Definition: OgreBorderPanelOverlayElement.h:342
Ogre::BorderPanelOverlayElement::CmdBorderTopRightUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:252
Ogre::BorderPanelOverlayElement::msTypeName
static String msTypeName
Definition: OgreBorderPanelOverlayElement.h:279
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::BorderPanelOverlayElement::mBottomBorderSize
Real mBottomBorderSize
Definition: OgreBorderPanelOverlayElement.h:262
Ogre::BorderPanelOverlayElement::CmdBorderBottomUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:224
Ogre::BorderPanelOverlayElement::CmdBorderSize
Command object for specifying border sizes (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:189
Ogre::ParamCommand
Abstract class which is command object which gets/sets parameters.
Definition: OgreStringInterface.h:79
Ogre::BorderPanelOverlayElement::CmdBorderRightUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:217
Ogre::BorderRenderable::getMaterial
const MaterialPtr & getMaterial(void) const
Retrieves a weak reference to the material this renderable object uses.
Definition: OgreBorderPanelOverlayElement.h:331
Ogre::BorderRenderable::BorderRenderable
BorderRenderable(BorderPanelOverlayElement *parent)
Constructed with pointers to parent.
Definition: OgreBorderPanelOverlayElement.h:326
Ogre::BorderPanelOverlayElement::mLeftBorderSize
Real mLeftBorderSize
Definition: OgreBorderPanelOverlayElement.h:259
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Ogre::BorderPanelOverlayElement::mRenderOp2
RenderOperation mRenderOp2
Render operation for the border area.
Definition: OgreBorderPanelOverlayElement.h:277
Ogre::BorderPanelOverlayElement::CmdBorderBottomRightUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:245
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::BorderRenderable::getNumWorldTransforms
unsigned short getNumWorldTransforms(void) const
Returns the number of world transform matrices this renderable requires.
Definition: OgreBorderPanelOverlayElement.h:334
Ogre::BorderPanelOverlayElement::mPixelBottomBorderSize
ushort mPixelBottomBorderSize
Definition: OgreBorderPanelOverlayElement.h:271
Ogre::BorderPanelOverlayElement::BorderCellIndex
BorderCellIndex
Definition: OgreBorderPanelOverlayElement.h:288
Ogre::OverlayElement::getWorldTransforms
void getWorldTransforms(Matrix4 *xform) const
See Renderable.
Ogre::BorderPanelOverlayElement::msCmdBorderMaterial
static CmdBorderMaterial msCmdBorderMaterial
Definition: OgreBorderPanelOverlayElement.h:302
Ogre::BorderPanelOverlayElement::mBorderMaterial
MaterialPtr mBorderMaterial
Definition: OgreBorderPanelOverlayElement.h:274
OgrePanelOverlayElement.h
Ogre::BorderRenderable::mParent
BorderPanelOverlayElement * mParent
Definition: OgreBorderPanelOverlayElement.h:323
Ogre::SharedPtr< Material >
Ogre::OverlayElement::getSquaredViewDepth
Real getSquaredViewDepth(const Camera *cam) const
Overridden from Renderable.
Definition: OgreOverlayElement.h:469
Ogre::BorderPanelOverlayElement::msCmdBorderTopRightUV
static CmdBorderTopRightUV msCmdBorderTopRightUV
Definition: OgreBorderPanelOverlayElement.h:309
Ogre::BorderPanelOverlayElement::CmdBorderMaterial
Command object for specifying the Material for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:196
Ogre::BorderPanelOverlayElement::msCmdBorderRightUV
static CmdBorderRightUV msCmdBorderRightUV
Definition: OgreBorderPanelOverlayElement.h:306
Ogre::BorderPanelOverlayElement::mRightBorderSize
Real mRightBorderSize
Definition: OgreBorderPanelOverlayElement.h:260
Ogre::Renderable::getPolygonModeOverrideable
virtual bool getPolygonModeOverrideable(void) const
Gets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setti...
Definition: OgreRenderable.h:332
Ogre::BorderPanelOverlayElement::msCmdBorderLeftUV
static CmdBorderLeftUV msCmdBorderLeftUV
Definition: OgreBorderPanelOverlayElement.h:303
Ogre::BorderPanelOverlayElement::msCmdBorderTopUV
static CmdBorderTopUV msCmdBorderTopUV
Definition: OgreBorderPanelOverlayElement.h:304
Ogre::BorderPanelOverlayElement::mPixelLeftBorderSize
ushort mPixelLeftBorderSize
Definition: OgreBorderPanelOverlayElement.h:268
Ogre::Renderable::Visitor
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
Definition: OgreRenderable.h:377
_OgrePrivate
#define _OgrePrivate
Definition: OgrePlatform.h:258
Ogre::Renderable
Abstract class defining the interface all renderable objects must implement.
Definition: OgreRenderable.h:63
Ogre::BorderPanelOverlayElement::msCmdBorderBottomUV
static CmdBorderBottomUV msCmdBorderBottomUV
Definition: OgreBorderPanelOverlayElement.h:305
Ogre::BorderRenderable::getLights
const LightList & getLights(void) const
Gets a list of lights, ordered relative to how close they are to this renderable.
Definition: OgreBorderPanelOverlayElement.h:336
Ogre::BorderPanelOverlayElement::msCmdBorderTopLeftUV
static CmdBorderTopLeftUV msCmdBorderTopLeftUV
Definition: OgreBorderPanelOverlayElement.h:307
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::BorderPanelOverlayElement::CmdBorderBottomLeftUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:238
Ogre::BorderPanelOverlayElement::CmdBorderLeftUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:203
Ogre::BorderPanelOverlayElement::mBorderRenderable
BorderRenderable * mBorderRenderable
Definition: OgreBorderPanelOverlayElement.h:312
Ogre::BorderRenderable::getSquaredViewDepth
Real getSquaredViewDepth(const Camera *cam) const
Returns the camera-relative squared depth of this renderable.
Definition: OgreBorderPanelOverlayElement.h:335
Ogre::BorderRenderable::getWorldTransforms
void getWorldTransforms(Matrix4 *xform) const
Gets the world transform matrix / matrices for this renderable object.
Definition: OgreBorderPanelOverlayElement.h:333
Ogre::RenderOperation
'New' rendering operation using vertex buffers.
Definition: OgreRenderOperation.h:45
Ogre::BorderPanelOverlayElement::mTopBorderSize
Real mTopBorderSize
Definition: OgreBorderPanelOverlayElement.h:261
Ogre::RenderQueue
Class to manage the scene object rendering queue.
Definition: OgreRenderQueue.h:92
Ogre::BorderPanelOverlayElement::msCmdBorderBottomLeftUV
static CmdBorderBottomLeftUV msCmdBorderBottomLeftUV
Definition: OgreBorderPanelOverlayElement.h:308
Ogre::BorderPanelOverlayElement::msCmdBorderSize
static CmdBorderSize msCmdBorderSize
Definition: OgreBorderPanelOverlayElement.h:301
Ogre::BorderPanelOverlayElement::CellUV::v2
Real v2
Definition: OgreBorderPanelOverlayElement.h:264
Ogre::BorderPanelOverlayElement::msCmdBorderBottomRightUV
static CmdBorderBottomRightUV msCmdBorderBottomRightUV
Definition: OgreBorderPanelOverlayElement.h:310

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.