OgreBorderPanelOverlayElement.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __BorderPanelOverlayElement_H__
#define __BorderPanelOverlayElement_H__
#include "OgrePanelOverlayElement.h"
namespace Ogre {
class BorderRenderable;
class _OgreOverlayExport BorderPanelOverlayElement : public PanelOverlayElement
{
friend class BorderRenderable;
public:
BorderPanelOverlayElement(const String& name);
virtual ~BorderPanelOverlayElement();
virtual void initialise(void);
const String& getTypeName(void) const;
void setBorderSize(Real size);
void setBorderSize(Real sides, Real topAndBottom);
void setBorderSize(Real left, Real right, Real top, Real bottom);
Real getLeftBorderSize(void) const;
Real getRightBorderSize(void) const;
Real getTopBorderSize(void) const;
Real getBottomBorderSize(void) const;
void setLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
void setRightBorderUV(Real u1, Real v1, Real u2, Real v2);
void setTopBorderUV(Real u1, Real v1, Real u2, Real v2);
void setBottomBorderUV(Real u1, Real v1, Real u2, Real v2);
void setTopLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
void setTopRightBorderUV(Real u1, Real v1, Real u2, Real v2);
void setBottomLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
void setBottomRightBorderUV(Real u1, Real v1, Real u2, Real v2);
String getLeftBorderUVString() const;
String getRightBorderUVString() const;
String getTopBorderUVString() const;
String getBottomBorderUVString() const;
String getTopLeftBorderUVString() const;
String getTopRightBorderUVString() const;
String getBottomLeftBorderUVString() const;
String getBottomRightBorderUVString() const;
void setBorderMaterialName(const String& name);
const String& getBorderMaterialName(void) const;
void _updateRenderQueue(RenderQueue* queue);
void visitRenderables(Renderable::Visitor* visitor,
bool debugRenderables = false);
void setMetricsMode(GuiMetricsMode gmm);
void _update(void);
class _OgrePrivate CmdBorderSize : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderMaterial : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderLeftUV : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderTopUV : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderRightUV : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderBottomUV : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderTopLeftUV : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderBottomLeftUV : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderBottomRightUV : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
class _OgrePrivate CmdBorderTopRightUV : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
};
protected:
Real mLeftBorderSize;
Real mRightBorderSize;
Real mTopBorderSize;
Real mBottomBorderSize;
struct CellUV {
Real u1, v1, u2, v2;
};
CellUV mBorderUV[8];
ushort mPixelLeftBorderSize;
ushort mPixelRightBorderSize;
ushort mPixelTopBorderSize;
ushort mPixelBottomBorderSize;
String mBorderMaterialName;
MaterialPtr mBorderMaterial;
RenderOperation mRenderOp2;
static String msTypeName;
void updatePositionGeometry(void);
void updateTextureGeometry(void);
void addBaseParameters(void);
enum BorderCellIndex {
BCELL_TOP_LEFT = 0,
BCELL_TOP = 1,
BCELL_TOP_RIGHT = 2,
BCELL_LEFT = 3,
BCELL_RIGHT = 4,
BCELL_BOTTOM_LEFT = 5,
BCELL_BOTTOM = 6,
BCELL_BOTTOM_RIGHT = 7
};
String getCellUVString(BorderCellIndex idx) const;
// Command objects
static CmdBorderSize msCmdBorderSize;
static CmdBorderMaterial msCmdBorderMaterial;
static CmdBorderLeftUV msCmdBorderLeftUV;
static CmdBorderTopUV msCmdBorderTopUV;
static CmdBorderBottomUV msCmdBorderBottomUV;
static CmdBorderRightUV msCmdBorderRightUV;
static CmdBorderTopLeftUV msCmdBorderTopLeftUV;
static CmdBorderBottomLeftUV msCmdBorderBottomLeftUV;
static CmdBorderTopRightUV msCmdBorderTopRightUV;
static CmdBorderBottomRightUV msCmdBorderBottomRightUV;
BorderRenderable* mBorderRenderable;
};
class _OgreOverlayExport BorderRenderable : public Renderable, public OverlayAlloc
{
protected:
BorderPanelOverlayElement* mParent;
public:
BorderRenderable(BorderPanelOverlayElement* parent) : mParent(parent)
{
mUseIdentityProjection = true;
mUseIdentityView = true;
}
const MaterialPtr& getMaterial(void) const { return mParent->mBorderMaterial; }
void getRenderOperation(RenderOperation& op) { op = mParent->mRenderOp2; }
void getWorldTransforms(Matrix4* xform) const { mParent->getWorldTransforms(xform); }
unsigned short getNumWorldTransforms(void) const { return 1; }
Real getSquaredViewDepth(const Camera* cam) const { return mParent->getSquaredViewDepth(cam); }
const LightList& getLights(void) const
{
// N/A, panels are not lit
static LightList ll;
return ll;
}
bool getPolygonModeOverrideable(void) const
{
return mParent->getPolygonModeOverrideable();
}
};
} // namespace Ogre
#endif // __BorderPanelOverlayElement_H__
Ogre::BorderPanelOverlayElement::msCmdBorderBottomLeftUV
static CmdBorderBottomLeftUV msCmdBorderBottomLeftUV
Definition: OgreBorderPanelOverlayElement.h:308
Ogre::BorderPanelOverlayElement::mPixelBottomBorderSize
ushort mPixelBottomBorderSize
Definition: OgreBorderPanelOverlayElement.h:271
Ogre::Renderable
Abstract class defining the interface all renderable objects must implement.
Definition: OgreRenderable.h:63
Ogre::BorderPanelOverlayElement::CellUV
Definition: OgreBorderPanelOverlayElement.h:263
Ogre::BorderPanelOverlayElement::msCmdBorderMaterial
static CmdBorderMaterial msCmdBorderMaterial
Definition: OgreBorderPanelOverlayElement.h:302
Ogre::BorderPanelOverlayElement::mBorderMaterialName
String mBorderMaterialName
Definition: OgreBorderPanelOverlayElement.h:273
Ogre::BorderPanelOverlayElement::msTypeName
static String msTypeName
Definition: OgreBorderPanelOverlayElement.h:279
Ogre::GuiMetricsMode
GuiMetricsMode
Enum describing how the position / size of an element is to be recorded.
Definition: OgreOverlayElement.h:58
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::BorderPanelOverlayElement::CmdBorderBottomUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:224
Ogre::RenderQueue
Class to manage the scene object rendering queue.
Definition: OgreRenderQueue.h:92
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::BorderRenderable::getWorldTransforms
void getWorldTransforms(Matrix4 *xform) const
Gets the world transform matrix / matrices for this renderable object.
Definition: OgreBorderPanelOverlayElement.h:333
Ogre::BorderPanelOverlayElement::msCmdBorderBottomUV
static CmdBorderBottomUV msCmdBorderBottomUV
Definition: OgreBorderPanelOverlayElement.h:305
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::CmdBorderRightUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:217
Ogre::PanelOverlayElement
OverlayElement representing a flat, single-material (or transparent) panel which can contain other el...
Definition: OgrePanelOverlayElement.h:58
Ogre::BorderPanelOverlayElement::CmdBorderBottomLeftUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:238
Ogre::BorderPanelOverlayElement::CellUV::v2
Real v2
Definition: OgreBorderPanelOverlayElement.h:264
Ogre::BorderPanelOverlayElement::BorderCellIndex
BorderCellIndex
Definition: OgreBorderPanelOverlayElement.h:288
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Ogre::OverlayElement::getWorldTransforms
void getWorldTransforms(Matrix4 *xform) const
See Renderable.
Ogre::BorderPanelOverlayElement::CmdBorderMaterial
Command object for specifying the Material for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:196
Ogre::BorderRenderable::BorderRenderable
BorderRenderable(BorderPanelOverlayElement *parent)
Constructed with pointers to parent.
Definition: OgreBorderPanelOverlayElement.h:326
_OgrePrivate
#define _OgrePrivate
Definition: OgrePlatform.h:258
Ogre::HashedVector
A hashed vector.
Definition: OgreCommon.h:332
Ogre::Renderable::Visitor
Visitor object that can be used to iterate over a collection of Renderable instances abstractly...
Definition: OgreRenderable.h:377
Ogre::OverlayElement::getSquaredViewDepth
Real getSquaredViewDepth(const Camera *cam) const
Overridden from Renderable.
Definition: OgreOverlayElement.h:469
Ogre::BorderRenderable::getPolygonModeOverrideable
bool getPolygonModeOverrideable(void) const
Gets whether this renderable&#39;s chosen detail level can be overridden (downgraded) by the camera setti...
Definition: OgreBorderPanelOverlayElement.h:342
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::Renderable::getPolygonModeOverrideable
virtual bool getPolygonModeOverrideable(void) const
Gets whether this renderable&#39;s chosen detail level can be overridden (downgraded) by the camera setti...
Definition: OgreRenderable.h:332
Ogre::BorderRenderable::getSquaredViewDepth
Real getSquaredViewDepth(const Camera *cam) const
Returns the camera-relative squared depth of this renderable.
Definition: OgreBorderPanelOverlayElement.h:335
Ogre::BorderPanelOverlayElement::mLeftBorderSize
Real mLeftBorderSize
Definition: OgreBorderPanelOverlayElement.h:259
OgrePanelOverlayElement.h
Ogre::BorderPanelOverlayElement::msCmdBorderTopRightUV
static CmdBorderTopRightUV msCmdBorderTopRightUV
Definition: OgreBorderPanelOverlayElement.h:309
Ogre::BorderPanelOverlayElement::msCmdBorderRightUV
static CmdBorderRightUV msCmdBorderRightUV
Definition: OgreBorderPanelOverlayElement.h:306
Ogre::BorderPanelOverlayElement::mRightBorderSize
Real mRightBorderSize
Definition: OgreBorderPanelOverlayElement.h:260
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::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre::BorderPanelOverlayElement::mBorderRenderable
BorderRenderable * mBorderRenderable
Definition: OgreBorderPanelOverlayElement.h:312
Ogre::BorderPanelOverlayElement::mPixelLeftBorderSize
ushort mPixelLeftBorderSize
Definition: OgreBorderPanelOverlayElement.h:268
Ogre::BorderRenderable::mParent
BorderPanelOverlayElement * mParent
Definition: OgreBorderPanelOverlayElement.h:323
Ogre::BorderPanelOverlayElement::msCmdBorderBottomRightUV
static CmdBorderBottomRightUV msCmdBorderBottomRightUV
Definition: OgreBorderPanelOverlayElement.h:310
Ogre::BorderPanelOverlayElement::mPixelRightBorderSize
ushort mPixelRightBorderSize
Definition: OgreBorderPanelOverlayElement.h:269
Ogre::BorderPanelOverlayElement::CmdBorderTopRightUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:252
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::SharedPtr< Material >
Ogre::BorderPanelOverlayElement::mPixelTopBorderSize
ushort mPixelTopBorderSize
Definition: OgreBorderPanelOverlayElement.h:270
Ogre::BorderPanelOverlayElement::msCmdBorderTopUV
static CmdBorderTopUV msCmdBorderTopUV
Definition: OgreBorderPanelOverlayElement.h:304
Ogre::BorderPanelOverlayElement::CmdBorderBottomRightUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:245
Ogre::BorderRenderable
Class for rendering the border of a BorderPanelOverlayElement.
Definition: OgreBorderPanelOverlayElement.h:320
Ogre::BorderPanelOverlayElement::mBorderMaterial
MaterialPtr mBorderMaterial
Definition: OgreBorderPanelOverlayElement.h:274
Ogre::BorderPanelOverlayElement::msCmdBorderSize
static CmdBorderSize msCmdBorderSize
Definition: OgreBorderPanelOverlayElement.h:301
Ogre::BorderPanelOverlayElement
A specialisation of the PanelOverlayElement to provide a panel with a border.
Definition: OgreBorderPanelOverlayElement.h:57
Ogre::RenderOperation
&#39;New&#39; rendering operation using vertex buffers.
Definition: OgreRenderOperation.h:45
Ogre::BorderPanelOverlayElement::mBottomBorderSize
Real mBottomBorderSize
Definition: OgreBorderPanelOverlayElement.h:262
Ogre::BorderRenderable::getMaterial
const MaterialPtr & getMaterial(void) const
Retrieves a weak reference to the material this renderable object uses.
Definition: OgreBorderPanelOverlayElement.h:331
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::ParamCommand
Abstract class which is command object which gets/sets parameters.
Definition: OgreStringInterface.h:79
Ogre::BorderPanelOverlayElement::msCmdBorderLeftUV
static CmdBorderLeftUV msCmdBorderLeftUV
Definition: OgreBorderPanelOverlayElement.h:303
Ogre::BorderPanelOverlayElement::mTopBorderSize
Real mTopBorderSize
Definition: OgreBorderPanelOverlayElement.h:261
Ogre::BorderPanelOverlayElement::CmdBorderTopLeftUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:231
Ogre::BorderPanelOverlayElement::CmdBorderTopUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:210
Ogre::BorderRenderable::getNumWorldTransforms
unsigned short getNumWorldTransforms(void) const
Returns the number of world transform matrices this renderable requires.
Definition: OgreBorderPanelOverlayElement.h:334
Ogre::BorderPanelOverlayElement::CmdBorderSize
Command object for specifying border sizes (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:189
Ogre::BorderPanelOverlayElement::CmdBorderLeftUV
Command object for specifying texture coordinates for the border (see ParamCommand).
Definition: OgreBorderPanelOverlayElement.h:203
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::BorderPanelOverlayElement::msCmdBorderTopLeftUV
static CmdBorderTopLeftUV msCmdBorderTopLeftUV
Definition: OgreBorderPanelOverlayElement.h:307
Ogre::BorderPanelOverlayElement::mRenderOp2
RenderOperation mRenderOp2
Render operation for the border area.
Definition: OgreBorderPanelOverlayElement.h:277

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