lugre_ColourClipPaneOverlay.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef LUGRE_ColourClipPaneOVERLAY_H
00025 #define LUGRE_ColourClipPaneOVERLAY_H
00026 #include "lugre_robrenderable.h"
00027 #include <OgrePrerequisites.h>
00028 #include <OgreOverlayContainer.h>
00029
00030
00031 namespace Lugre {
00032
00033
00034
00035
00036
00037
00038 class cColourClipPaneOverlay : public cRobRenderOp, public Ogre::OverlayContainer { public :
00039 Ogre::RenderOperation mRenderOp;
00040 static Ogre::String msTypeName;
00041
00042 struct Vertex {
00043 Ogre::Real x,y;
00044 Ogre::Real u,v;
00045 Ogre::ColourValue col;
00046
00047 Vertex();
00048 Vertex(const Ogre::Real x,const Ogre::Real y,const Ogre::Real u,const Ogre::Real v,const Ogre::ColourValue& col);
00049 friend Vertex Interpolate (const Vertex& a,const Vertex& b,const float t);
00050 void Print ();
00051 void Draw (cRobRenderOp* pRobRenderOp,const Ogre::Real z);
00052 };
00053
00054 struct VertexRect {
00055 Vertex lt,lb,rt,rb;
00056
00057 VertexRect ();
00058 VertexRect (const Vertex& lt,const Vertex& lb,const Vertex& rt,const Vertex& rb);
00059 void SetLTWH (const Ogre::Real l,const Ogre::Real t,const Ogre::Real w,const Ogre::Real h);
00060 void SetLTRB (const Ogre::Real l,const Ogre::Real t,const Ogre::Real r,const Ogre::Real b);
00061 void SetCol (const Ogre::ColourValue& col);
00062 void SetUV (const Ogre::Real u1,const Ogre::Real v1,const Ogre::Real u2,const Ogre::Real v2);
00063 Vertex Pick (const Ogre::Real x,const Ogre::Real y);
00064 VertexRect Intersect (const Ogre::Rectangle& clippingRegion);
00065 void DrawStrip (cRobRenderOp* pRobRenderOp,const Ogre::Real z);
00066 void DrawList (cRobRenderOp* pRobRenderOp,const Ogre::Real z);
00067 void Print ();
00068 };
00069
00070
00071 bool mTransparent;
00072 bool mbClipInitialized;
00073 VertexRect mForm;
00074 Ogre::Rectangle mClip;
00075
00076 cColourClipPaneOverlay(const Ogre::String& name);
00077 virtual ~cColourClipPaneOverlay();
00078
00080 static void RegisterFactory ();
00081
00083 virtual void initialise (void);
00084
00085 virtual void setColour (const Ogre::ColourValue& col);
00086 virtual void SetColours (const Ogre::ColourValue colLT,const Ogre::ColourValue colRT,const Ogre::ColourValue colLB,const Ogre::ColourValue colRB);
00087 virtual void SetTexCoords (const Ogre::Real fU1,const Ogre::Real fV1,const Ogre::Real fU2,const Ogre::Real fV2);
00088 virtual void SetClip (const Ogre::Real fCL,const Ogre::Real fCT,const Ogre::Real fCW,const Ogre::Real fCH);
00089
00091 void setTransparent(bool isTransparent);
00092
00094 bool isTransparent(void) const;
00095
00097 virtual const Ogre::String& getTypeName(void) const;
00099 void getRenderOperation(Ogre::RenderOperation& op);
00101 void setMaterialName(const Ogre::String& matName);
00103 void _updateRenderQueue(Ogre::RenderQueue* queue);
00104
00106 virtual void updatePositionGeometry(void);
00107
00109 virtual void updateTextureGeometry(void);
00110
00112 void addBaseParameters(void);
00113 };
00114
00115 };
00116
00117 #endif