MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textureatlas.cpp
1 // © Copyright 2010 - 2014 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _uitextureatlas_cpp
41 #define _uitextureatlas_cpp
42 
43 #include "UI/textureatlas.h"
44 #include "UI/glyph.h"
45 #include "UI/sprite.h"
46 #include "stringtool.h"
47 
48 #include "entresol.h"
49 
50 #include <OgreTexture.h>
51 #include <OgreMaterial.h>
52 #include <OgrePass.h>
53 #include <OgreGpuProgram.h>
54 #include <OgreMaterialManager.h>
55 #include <OgreTextureManager.h>
56 #include <OgreRenderSystem.h>
57 #include <OgreRoot.h>
58 
59 namespace Mezzanine
60 {
61  namespace UI
62  {
63  ///////////////////////////////////////////////////////////
64  // TextureAtlasInternalData class and functions
66  {
67  Ogre::TexturePtr TATexture;
68  Ogre::MaterialPtr Mat2D;
69  Ogre::MaterialPtr Mat3D;
70  Ogre::Pass* Pass2D;
71  Ogre::Pass* Pass3D;
72 
74  {
75  TATexture.setNull();
76  Mat2D.setNull();
77  Mat3D.setNull();
78  Pass2D = NULL;
79  Pass3D = NULL;
80  }
81  };//TextureAtlasInternalData
82 
83  ///////////////////////////////////////////////////////////
84  // TextureAtlas functions
85 
86  TextureAtlas::TextureAtlas(const String& Name, const UInt32& Width, const UInt32& Height) :
87  AtlasName(Name)
88  {
89  this->TAID = new TextureAtlasInternalData();
90  /// @todo This is just a starter code sample for proceadurally generated texture atlases. Not ready and needs to be completed.
91  String GroupName = "UI";
92  this->TAID->TATexture = Ogre::TextureManager::getSingletonPtr()->createManual(this->AtlasName+"Texture",GroupName,Ogre::TEX_TYPE_2D,Width,Height,0,Ogre::PF_R8G8B8A8,Ogre::TU_DEFAULT);
93  this->Create2DMaterial();
94  this->Create3DMaterial();
95  }
96 
98  {
99  this->TAID = new TextureAtlasInternalData();
100  // Parse and set the name
101  XML::Attribute NameAttrib = AtlasNode.GetAttribute("Name");
102  if( !NameAttrib.Empty() ) {
103  this->AtlasName = NameAttrib.AsString();
104  }else{
105  MEZZ_EXCEPTION(Exception::II_IDENTITY_INVALID_EXCEPTION,"Empty string being used to set name of Texture Atlas being parsed from XML.");
106  }
107 
108  XML::Node TextureNode = AtlasNode.GetChild("Texture");
109  this->ParseTexture( TextureNode );
110  XML::Node FontsNode = AtlasNode.GetChild("Fonts");
111  this->ParseFonts( FontsNode );
112  XML::Node SpritesNode = AtlasNode.GetChild("Sprites");
113  this->ParseSprites( SpritesNode );
114 
115  this->Create2DMaterial();
116  this->Create3DMaterial();
117  }
118 
120  {
121  for( FontDataIterator FontIt = this->Fonts.begin() ; FontIt != this->Fonts.end() ; ++FontIt )
122  {
123  delete (*FontIt).second;
124  }
125  this->Fonts.clear();
126 
127  for( SpriteIterator SpriteIt = this->Sprites.begin() ; SpriteIt != this->Sprites.end() ; ++SpriteIt )
128  {
129  delete (*SpriteIt).second;
130  }
131  this->Sprites.clear();
132 
133  delete this->TAID;
134  }
135 
136  ///////////////////////////////////////////////////////////////////////////////
137  // Private & Setup Functions
138 
139  void TextureAtlas::ParseTexture(XML::Node& AtlasTextureNode)
140  {
141  XML::Attribute CurrAttrib;
142  String FileName;
143  String GroupName = "UI";
144 
145  // Get the filename
146  CurrAttrib = AtlasTextureNode.GetAttribute("TexFile");
147  if( !CurrAttrib.Empty() )
148  FileName = CurrAttrib.AsString();
149  else{ MEZZ_EXCEPTION(Exception::II_IDENTITY_INVALID_EXCEPTION,"Empty string parsed for texture file name when parsing Texture Atlas from XML."); }
150 
151  // Get the resource group
152  CurrAttrib = AtlasTextureNode.GetAttribute("TexFileGroup");
153  if( !CurrAttrib.Empty() )
154  GroupName = CurrAttrib.AsString();
155 
156  // Setup the texture
157  this->TAID->TATexture = Ogre::TextureManager::getSingletonPtr()->getByName(FileName,GroupName);
158  if(this->TAID->TATexture.isNull())
159  {
160  this->TAID->TATexture = Ogre::TextureManager::getSingletonPtr()->load(FileName,GroupName,Ogre::TEX_TYPE_2D,0);
161  }
162 
163  this->InverseTextureSize.X = 1.0 / this->TAID->TATexture->getWidth();
164  this->InverseTextureSize.Y = 1.0 / this->TAID->TATexture->getHeight();
165 
166  // Get the white pixel location
167  CurrAttrib = AtlasTextureNode.GetAttribute("WhitePixel");
168  if( !CurrAttrib.Empty() )
169  this->WhitePixel = StringTools::ConvertToVector2( CurrAttrib.AsString() );
170 
171  // Convert the white pixel location to relative
172  this->WhitePixel.X *= this->InverseTextureSize.X;
173  this->WhitePixel.Y *= this->InverseTextureSize.Y;
174  }
175 
176  void TextureAtlas::ParseFonts(XML::Node& AtlasFontsNode)
177  {
178  for( XML::NodeIterator FontNode = AtlasFontsNode.begin() ; FontNode != AtlasFontsNode.end() ; ++FontNode )
179  {
180  XML::Attribute CurrAttrib;
181  Vector2 Offset(0,0);
182  FontData* Data = new FontData(this);
183 
184  // Get the name
185  CurrAttrib = (*FontNode).GetAttribute("Name");
186  if( !CurrAttrib.Empty() )
187  Data->_SetName( CurrAttrib.AsString() );
188 
189  // Now that we have the name, quickly check if this is unique before we continue to parse
190  FontDataIterator FontIt = Fonts.find(Data->GetName());
191  if( FontIt == Fonts.end() ) { Fonts[Data->GetName()] = Data; }
192  else { MEZZ_EXCEPTION(Exception::II_DUPLICATE_IDENTITY_EXCEPTION,"Duplicate name of font:\"" + Data->GetName() + "\", found in atlas:\"" + AtlasName + "\"." ); }
193 
194  // Get the horizontal offset if there is any
195  CurrAttrib = (*FontNode).GetAttribute("OffsetX");
196  if( !CurrAttrib.Empty() )
197  Offset.X = CurrAttrib.AsReal();
198 
199  // Get the vertical offset if there is any
200  CurrAttrib = (*FontNode).GetAttribute("OffsetY");
201  if( !CurrAttrib.Empty() )
202  Offset.Y = CurrAttrib.AsReal();
203 
204  // Get the lineheight
205  CurrAttrib = (*FontNode).GetAttribute("LineHeight");
206  if( !CurrAttrib.Empty() )
207  Data->_SetLineHeight( CurrAttrib.AsReal() );
208 
209  // Get the spacelength
210  CurrAttrib = (*FontNode).GetAttribute("SpaceLength");
211  if( !CurrAttrib.Empty() )
212  Data->_SetSpaceLength( CurrAttrib.AsReal() );
213 
214  // Get the baseline
215  CurrAttrib = (*FontNode).GetAttribute("BaseLine");
216  if( !CurrAttrib.Empty() )
217  Data->_SetBaseLine( CurrAttrib.AsReal() );
218 
219  // Get the letterspacing
220  CurrAttrib = (*FontNode).GetAttribute("LetterSpacing");
221  if( !CurrAttrib.Empty() )
222  Data->_SetLetterSpacing( CurrAttrib.AsReal() );
223 
224  // Get the monowidth
225  /*CurrAttrib = (*FontNode).GetAttribute("MonoWidth");
226  if( !CurrAttrib.Empty() )
227  Data->_SetMonoWidth( CurrAttrib.AsReal() );//*/
228 
229  // Get the start of the range
230  /*CurrAttrib = (*FontNode).GetAttribute("RangeBegin");
231  if( !CurrAttrib.Empty() )
232  Data->_SetRangeBegin( CurrAttrib.AsReal() );//*/
233 
234  // Get the end of the range
235  /*CurrAttrib = (*FontNode).GetAttribute("RangeEnd");
236  if( !CurrAttrib.Empty() )
237  Data->_SetRangeEnd( CurrAttrib.AsReal() );//*/
238 
239  // Get the glyphs and parse them
240  XML::Node GlyphsNode = (*FontNode).GetChild("Glyphs");
241  this->ParseGlyphs( GlyphsNode, Offset, Data );
242  // Next parse the kernings for those glyphs
243  XML::Node KerningsNode = (*FontNode).GetChild("Kernings");
244  this->ParseKernings( KerningsNode, Data );
245  // Lastly parse the vertical offsets
246  XML::Node VerticalOffsetsNode = (*FontNode).GetChild("VerticalOffsets");
247  this->ParseVerticalOffsets( VerticalOffsetsNode, Data );
248  }
249  }
250 
251  void TextureAtlas::ParseGlyphs(XML::Node& GlyphsNode, const Vector2& Offset, FontData* FontD)
252  {
253  XML::Attribute CurrAttrib;
254  Ogre::RenderSystem* rs = Ogre::Root::getSingletonPtr()->getRenderSystem();
255 
256  Real TexelX = rs->getHorizontalTexelOffset();
257  Real TexelY = rs->getVerticalTexelOffset();
258 
259  UInt32 ParsedGlyphID = 0;
260  Real Left = 0, Top = 0, Right = 0, Bottom = 0;
261 
262  for( XML::NodeIterator GlyphIt = GlyphsNode.begin() ; GlyphIt != GlyphsNode.end() ; ++GlyphIt )
263  {
264  // Get the ID
265  CurrAttrib = (*GlyphIt).GetAttribute("ID");
266  if( !CurrAttrib.Empty() ) ParsedGlyphID = CurrAttrib.AsUint();
267  else continue;
268 
269  // Get the left position
270  CurrAttrib = (*GlyphIt).GetAttribute("PositionX");
271  if( !CurrAttrib.Empty() ) Left = (Offset.X + CurrAttrib.AsReal()) - TexelX;
272  else continue;
273 
274  // Get the top position
275  CurrAttrib = (*GlyphIt).GetAttribute("PositionY");
276  if( !CurrAttrib.Empty() ) Top = (Offset.Y + CurrAttrib.AsReal()) - TexelY;
277  else continue;
278 
279  // Get the width
280  CurrAttrib = (*GlyphIt).GetAttribute("SizeX");
281  if( !CurrAttrib.Empty() ) Right = (Left + CurrAttrib.AsReal()) - TexelX;
282  else continue;
283 
284  // Get the height
285  CurrAttrib = (*GlyphIt).GetAttribute("SizeY");
286  if( !CurrAttrib.Empty() ) Bottom = (Top + CurrAttrib.AsReal()) - TexelY;
287  else continue;
288 
289  // If we got this far, we have enough data for a valid glyph, create and insert it
290  Glyph* NewGlyph = new Glyph(FontD);
291  NewGlyph->GlyphID = ParsedGlyphID;
292  FontD->_AddGlyph(NewGlyph);
293 
294  // Convert the coordinates to relative
295  Left *= InverseTextureSize.X;
296  Top *= InverseTextureSize.Y;
297  Right *= InverseTextureSize.X;
298  Bottom *= InverseTextureSize.Y;
299 
300  // Assign the values to the glyph
301  NewGlyph->AtlasCoords[QC_TopLeft].SetValues(Left,Top);
302  NewGlyph->AtlasCoords[QC_TopRight].SetValues(Right,Top);
303  NewGlyph->AtlasCoords[QC_BottomRight].SetValues(Right,Bottom);
304  NewGlyph->AtlasCoords[QC_BottomLeft].SetValues(Left,Bottom);
305 
306  // Get or generate the glyph advance
307  CurrAttrib = (*GlyphIt).GetAttribute("Advance");
308  if( !CurrAttrib.Empty() ) NewGlyph->GlyphAdvance = CurrAttrib.AsReal();
309  else NewGlyph->GlyphAdvance = NewGlyph->GetWidth();
310  }
311  }
312 
313  void TextureAtlas::ParseKernings(XML::Node& KerningsNode, FontData* FontD)
314  {
315  XML::Attribute CurrAttrib;
316  UInt32 LeftID = 0;
317  UInt32 RightID = 0;
318  Real Kerning = 0;
319 
320  for( XML::NodeIterator KerningNode = KerningsNode.begin() ; KerningNode != KerningsNode.end() ; ++KerningNode )
321  {
322  // Get the left ID
323  CurrAttrib = (*KerningNode).GetAttribute("Left");
324  if( !CurrAttrib.Empty() ) LeftID = CurrAttrib.AsReal();
325  else continue;
326 
327  // Get the right ID
328  CurrAttrib = (*KerningNode).GetAttribute("Right");
329  if( !CurrAttrib.Empty() ) RightID = CurrAttrib.AsReal();
330  else continue;
331 
332  // Get the kerning adjustment
333  CurrAttrib = (*KerningNode).GetAttribute("Adjust");
334  if( !CurrAttrib.Empty() ) Kerning = CurrAttrib.AsReal();
335  else continue;
336 
337  FontD->GetGlyph(RightID)->Kernings.push_back(KerningInfo(LeftID,Kerning));
338  }
339  }
340 
341  void TextureAtlas::ParseVerticalOffsets(XML::Node& VerticalOffsetsNode, FontData* FontD)
342  {
343  XML::Attribute CurrAttrib;
344  UInt32 GlyphID = 0;
345  Real Offset = 0;
346 
347  for( XML::NodeIterator VerticalOffsetNode = VerticalOffsetsNode.begin() ; VerticalOffsetNode != VerticalOffsetsNode.end() ; ++VerticalOffsetNode )
348  {
349  // Get the glyph ID
350  CurrAttrib = (*VerticalOffsetNode).GetAttribute("GlyphID");
351  if( !CurrAttrib.Empty() ) GlyphID = CurrAttrib.AsUint();
352  else continue;
353 
354  // Get the offset
355  CurrAttrib = (*VerticalOffsetNode).GetAttribute("Offset");
356  if( !CurrAttrib.Empty() ) Offset = CurrAttrib.AsReal();
357  else continue;
358 
359  FontD->GetGlyph(GlyphID)->VerticalOffset = Offset;
360  }
361  }
362 
363  void TextureAtlas::ParseSprites(XML::Node& AtlasSpritesNode)
364  {
365  XML::Attribute CurrAttrib;
366  Ogre::RenderSystem* rs = Ogre::Root::getSingletonPtr()->getRenderSystem();
367 
368  Real TexelX = rs->getHorizontalTexelOffset();
369  Real TexelY = rs->getVerticalTexelOffset();
370 
371  String SpriteName;
372  Real Left = 0, Top = 0, Right = 0, Bottom = 0;
373 
374  for( XML::NodeIterator SpriteIt = AtlasSpritesNode.begin() ; SpriteIt != AtlasSpritesNode.end() ; ++SpriteIt )
375  {
376  // Get the name
377  CurrAttrib = (*SpriteIt).GetAttribute("Name");
378  if( !CurrAttrib.Empty() ) SpriteName = CurrAttrib.AsString();
379  else continue;
380 
381  // Get the left position
382  CurrAttrib = (*SpriteIt).GetAttribute("PositionX");
383  if( !CurrAttrib.Empty() ) Left = CurrAttrib.AsReal() - TexelX;
384  else continue;
385 
386  // Get the top position
387  CurrAttrib = (*SpriteIt).GetAttribute("PositionY");
388  if( !CurrAttrib.Empty() ) Top = CurrAttrib.AsReal() - TexelY;
389  else continue;
390 
391  // Get the width
392  CurrAttrib = (*SpriteIt).GetAttribute("SizeX");
393  if( !CurrAttrib.Empty() ) Right = (Left + CurrAttrib.AsReal()) - TexelX;
394  else continue;
395 
396  // Get the height
397  CurrAttrib = (*SpriteIt).GetAttribute("SizeY");
398  if( !CurrAttrib.Empty() ) Bottom = (Top + CurrAttrib.AsReal()) - TexelY;
399  else continue;
400 
401  // Convert the coordinates to relative
402  Left *= InverseTextureSize.X;
403  Top *= InverseTextureSize.Y;
404  Right *= InverseTextureSize.X;
405  Bottom *= InverseTextureSize.Y;
406 
407  // If we got this far, we have enough data for a valid sprite, create and insert it
408  Sprite* NewSprite = new Sprite(SpriteName,Top,Left,Bottom,Right);
409  SpriteIterator SpIt = this->Sprites.find(SpriteName);
410  if( SpIt == this->Sprites.end() ) {
411  this->Sprites.insert(std::pair<String,Sprite*>(SpriteName,NewSprite));
412  }else{
413  StringStream ExceptionStream;
414  ExceptionStream << "Sprite named \"" << SpriteName << "\" already exists in Atlas: \"" << this->AtlasName << "\".";
415  MEZZ_EXCEPTION(Exception::II_DUPLICATE_IDENTITY_EXCEPTION,ExceptionStream.str());
416  }
417  }
418  }
419 
421  {
422  String MatName = "Mezz2D." + this->TAID->TATexture->getName();
423  this->TAID->Mat2D = Ogre::MaterialManager::getSingletonPtr()->getByName(MatName);
424  if(!this->TAID->Mat2D.isNull())
425  {
426  return;
427  }
428 
429  this->TAID->Mat2D = GetOrCreate2DMasterMaterial()->clone(MatName);
430  this->TAID->Pass2D = this->TAID->Mat2D->getTechnique(0)->getPass(0);
431  this->TAID->Pass2D->getTextureUnitState(0)->setTextureName(this->TAID->TATexture->getName());
432  }
433 
435  {
436  String MatName = "Mezz3D." + this->TAID->TATexture->getName();
437  this->TAID->Mat3D = Ogre::MaterialManager::getSingletonPtr()->getByName(MatName);
438  if(!this->TAID->Mat3D.isNull())
439  {
440  return;
441  }
442 
443  this->TAID->Mat3D = GetOrCreate3DMasterMaterial()->clone(MatName);
444  this->TAID->Pass3D = this->TAID->Mat3D->getTechnique(0)->getPass(0);
445  this->TAID->Pass3D->getTextureUnitState(0)->setTextureName(this->TAID->TATexture->getName());
446  }
447 
449  {
450  Ogre::MaterialPtr Material2D = Ogre::MaterialManager::getSingletonPtr()->getByName("Mezz2D");
451  if(Material2D.isNull() == false)
452  {
453  Ogre::Pass* MatPass = Material2D->getTechnique(0)->getPass(0);
454 
455  if(MatPass->hasVertexProgram())
456  {
457  Ogre::GpuProgramPtr gpuPtr = MatPass->getVertexProgram();
458  gpuPtr->load();
459  }
460 
461  if(MatPass->hasFragmentProgram())
462  {
463  Ogre::GpuProgramPtr gpuPtr = MatPass->getFragmentProgram();
464  gpuPtr->load();
465  }
466 
467  return Material2D;
468  }
469 
470  Material2D = Ogre::MaterialManager::getSingletonPtr()->create("Mezz2D","UI");
471  Ogre::Pass* MatPass = Material2D->getTechnique(0)->getPass(0);
472  MatPass->setCullingMode(Ogre::CULL_NONE);
473  MatPass->setDepthCheckEnabled(false);
474  MatPass->setDepthWriteEnabled(false);
475  MatPass->setLightingEnabled(false);
476  MatPass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
477 
478  Ogre::TextureUnitState* TexUnit = MatPass->createTextureUnitState();
479  TexUnit->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP);
480  TexUnit->setTextureFiltering(Ogre::FO_NONE, Ogre::FO_NONE, Ogre::FO_NONE);
481  return Material2D;
482  }
483 
485  {
486  Ogre::MaterialPtr Material3D = Ogre::MaterialManager::getSingletonPtr()->getByName("Mezz3D");
487  if(Material3D.isNull() == false)
488  {
489  Ogre::Pass* MatPass = Material3D->getTechnique(0)->getPass(0);
490 
491  if(MatPass->hasVertexProgram())
492  {
493  Ogre::GpuProgramPtr gpuPtr = MatPass->getVertexProgram();
494  gpuPtr->load();
495  }
496 
497  if(MatPass->hasFragmentProgram())
498  {
499  Ogre::GpuProgramPtr gpuPtr = MatPass->getFragmentProgram();
500  gpuPtr->load();
501  }
502 
503  return Material3D;
504  }
505 
506  Material3D = Ogre::MaterialManager::getSingletonPtr()->create("Mezz3D","UI");
507  Ogre::Pass* MatPass = Material3D->getTechnique(0)->getPass(0);
508  MatPass->setCullingMode(Ogre::CULL_NONE);
509  MatPass->setDepthCheckEnabled(false);
510  MatPass->setDepthWriteEnabled(false);
511  MatPass->setLightingEnabled(false);
512  MatPass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
513 
514  Ogre::TextureUnitState* TexUnit = MatPass->createTextureUnitState();
515  TexUnit->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP);
516  TexUnit->setTextureFiltering(Ogre::FO_ANISOTROPIC, Ogre::FO_ANISOTROPIC, Ogre::FO_ANISOTROPIC);
517  return Material3D;
518  }
519 
520  ///////////////////////////////////////////////////////////////////////////////
521  // Utility
522 
524  {
525  return AtlasName;
526  }
527 
528  ///////////////////////////////////////////////////////////////////////////////
529  // Information Gathering
530 
531  FontData* TextureAtlas::GetFont(const String& FontName) const
532  {
533  ConstFontDataIterator it = Fonts.find(FontName);
534  if (it == Fonts.end())
535  return 0;
536  return (*it).second;
537  }
538 
539  TextureAtlas::FontDataContainer& TextureAtlas::GetFonts()
540  {
541  return Fonts;
542  }
543 
545  {
546  ConstSpriteIterator it = Sprites.find(Name);
547  if (it == Sprites.end())
548  return NULL;
549  return (*it).second;
550  }
551 
552  TextureAtlas::SpriteContainer& TextureAtlas::GetSprites()
553  { return Sprites; }
554 
556  { return WhitePixel; }
557 
559  { return WhitePixel.X; }
560 
562  { return WhitePixel.Y; }
563 
565  { return Vector2( Real( this->TAID->TATexture->getWidth() ), Real( this->TAID->TATexture->getHeight() ) ); }
566 
568  { return 1.0 / Real(this->TAID->TATexture->getWidth()); }
569 
571  { return 1.0 / Real(this->TAID->TATexture->getHeight()); }
572 
573  ///////////////////////////////////////////////////////////////////////////////
574  // Internal Functions
575 
577  {
578  if(this->TAID->Mat2D.isNull()) {
580  }
581  return this->TAID->Mat2D;
582  }
583 
585  {
586  if(this->TAID->Mat3D.isNull()) {
588  }
589  return this->TAID->Mat3D;
590  }
591 
592  Ogre::TexturePtr TextureAtlas::_GetTexture()
593  { return this->TAID->TATexture; }
594 
595  Ogre::Pass* TextureAtlas::_Get2DPass() const
596  { return this->TAID->Pass2D; }
597 
598  Ogre::Pass* TextureAtlas::_Get3DPass() const
599  { return this->TAID->Pass3D; }
600  }//UI
601 }//Mezzanine
602 
603 #endif