Page principale | Liste des namespaces | Hiérarchie des classes | Liste par ordre alphabétique | Liste des composants | Liste des fichiers | Membres des namespaces | Composants | Déclarations

# ExCWindowContent.cpp

Aller à la documentation de ce fichier.

    00001 /*
    00002  * ExNihilo 3D Engine
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  *
    00018  * Please read AUTHORS file !!!
    00019  *
    00020  *
    00021  */
    00022
    00023 #include "ExCWindowContent.h"
    00024 //--------------------------------
    00025 // Constructor // Destructor
    00026 //--------------------------------
    00027 ExCWindowContent::ExCWindowContent(void)
    00028 {
    00029 Guard(ExCWindowContent::ExCWindowContent(void))
    00030         SetName("ExCWindowContent");
    00031         SetType(typeid(this).name());
    00032 UnGuard
    00033 }
    00034
    00035 ExCWindowContent::~ExCWindowContent(void)
    00036 {
    00037 }
    00038 //--------------------------------
    00039 // Methode
    00040 //--------------------------------
    00041 void ExCWindowContent::Draw(void)
    00042 {
    00043 Guard(void ExCWindowContent::Draw(void))
    00044         //------------------------------
    00045         //Draw all Child
    00046         //------------------------------
    00047         for(unsigned int i=0;i<m_VecWindowObject.size();i++)
    00048         {
    00049                 //m_VecWindowObject.at(i).SetParrent(this);
    00050                 glPushMatrix();
    00051                 m_VecWindowObject.at(i)->Draw();
    00052                 glPopMatrix();
    00053         }
    00054 UnGuard
    00055 }
    00056
    00057 void ExCWindowContent::AddObject(ExCWindowObject *object)
    00058 {
    00059 Guard(void ExCWindowContent::AddObject(ExCWindowObject *object))
    00060         m_VecWindowObject.push_back(object);
    00061 UnGuard
    00062 }
    00063
    00064 void ExCWindowContent::SetManagerTexture(ExManagerTexture * Texture)
    00065 {
    00066 Guard(void ExCWindowContent::SetManagerTexture(ExManagerTexture * Texture))
    00067         ManagerTexture=Texture;
    00068         for(unsigned int i=0;i<m_VecWindowObject.size();i++)
    00069         {
    00070                 m_VecWindowObject.at(i)->SetManagerTexture(Texture);
    00071         }
    00072 UnGuard
    00073 }
    00074
    00075 ExCAction ExCWindowContent::InputCommand(ExCCommand Command)
    00076 {
    00077 Guard(ExCAction ExCWindowContent::InputCommand(ExCCommand Command))
    00078         //Transform mouse position
    00079         Command.m_MousePosx-=GetPosition().GetX();
    00080         Command.m_MousePosy-=GetPosition().GetY();
    00081         //Check where mouse has been pressed and route command to control
    00082         for(unsigned int i=0;i<m_VecWindowObject.size();i++)
    00083         {
    00084                 if(m_VecWindowObject.at(i)->PointInWindow(ExCVec2D (Command.m_MousePosx,Command.m_MousePosy)))
    00085                 {
    00086                         return m_VecWindowObject.at(i)->InputCommand(Command);
    00087                 }
    00088         }
    00089         return NOTHING;
    00090 UnGuard
    00091 }
    00092
    00093 ExCAction ExCWindowContent::InputAction(ExCAction Action)
    00094 {
    00095 Guard(ExCAction ExCWindowContent::InputAction(ExCAction Action))
    00096         return Action;
    00097 UnGuard
    00098 }