Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

CLASS BOX


Information sur la source

Catégorie :Divers Niveau : Débutant Date de création : 29/05/2003 Date de mise à jour : 29/05/2003 02:49:25 Vu / téléchargé: 1 526 / 80

Note :
Aucune note

Commentaire sur cette source (0)
Ajouter un commentaire et/ou une note

Description

Class utilisé avec Opengl pour la création de cube 3D  
 

Source

  • /*-----------------------------------------------------------------------*/
  • /* Generic Class Version 1.0
  • /*-----------------------------------------------------------------------*/
  • /* Copyright (c) 2000-2003 Nemesys Group
  • /*-----------------------------------------------------------------------*/
  • /* Authors: Picard Vincent <vincent@nemesys.tv>
  • /*-----------------------------------------------------------------------*/
  • /* Contact : <development@nemesys.tv>
  • /*-----------------------------------------------------------------------*/
  • #ifndef _Class_Box_h_
  • #define _Class_Box_h_
  • /**----------------------------------------------------------------------*/
  • /* Class declaration
  • /*----------------------------------------------------------------------**/
  • class Box
  • {
  • private:
  • int m_X;
  • int m_Y;
  • int m_Z;
  • int m_Width;
  • int m_Height;
  • int m_Lenght;
  • public:
  • /*-------------------------------------------------------------------*/
  • inline int getX() const {return m_X;}
  • inline int getY() const {return m_Y;}
  • inline int getZ() const {return m_Z;}
  • inline int getWidth() const {return m_Width; }
  • inline int getHeight()const {return m_Height;}
  • inline int getLenght()const {return m_Lenght;}
  • /*-------------------------------------------------------------------*/
  • inline void setX(int vi_X){m_X=vi_X;}
  • inline void setY(int vi_Y){m_Y=vi_Y;}
  • inline void setZ(int vi_Y){m_Y=vi_Y;}
  • inline void setWidth (int vi_Width) {m_Width=vi_Width; }
  • inline void setHeight(int vi_Height){m_Height=vi_Height;}
  • inline void setLenght(int vi_Lenght){m_Lenght=vi_Lenght;}
  • /*-------------------------------------------------------------------*/
  • inline void addX(int vi_X){m_X+=vi_X;}
  • inline void addY(int vi_Y){m_Y+=vi_Y;}
  • inline void addZ(int vi_Y){m_Y+=vi_Y;}
  • inline void addWidth (int vi_Width) {m_Width +=vi_Width;}
  • inline void addHeight(int vi_Height){m_Height+=vi_Height;}
  • inline void addLenght(int vi_Lenght){m_Lenght+=vi_Lenght;}
  • /*-------------------------------------------------------------------*/
  • bool isInside(Box * vi_Box);
  • bool isOutside(Box * vi_Box);
  • /*-------------------------------------------------------------------*/
  • Box();
  • Box(Box * vi_Box);
  • Box(Box & vi_Box);
  • Box(int vi_Width, int vi_Height, int vi_Lenght, int vi_X, int vi_Y, int vi_Z);
  • virtual ~Box();
  • };
  • #endif
  • /*-----------------------------------------------------------------------*/
  • /* End of file
  • /*-----------------------------------------------------------------------*/
/*-----------------------------------------------------------------------*/
/*   Generic Class Version 1.0
/*-----------------------------------------------------------------------*/
/*   Copyright (c) 2000-2003 Nemesys Group 
/*-----------------------------------------------------------------------*/
/*   Authors: Picard Vincent <vincent@nemesys.tv>              
/*-----------------------------------------------------------------------*/
/*   Contact : <development@nemesys.tv>
/*-----------------------------------------------------------------------*/

#ifndef _Class_Box_h_
#define _Class_Box_h_

/**----------------------------------------------------------------------*/
/* Class declaration
/*----------------------------------------------------------------------**/

class Box
{
private:

	int m_X;
	int m_Y;
	int m_Z;

	int m_Width;
	int m_Height;
	int m_Lenght;

public:

	/*-------------------------------------------------------------------*/

	inline int getX() const {return m_X;}
	inline int getY() const {return m_Y;}
	inline int getZ() const {return m_Z;}

	inline int getWidth() const {return m_Width; }
	inline int getHeight()const {return m_Height;}
	inline int getLenght()const {return m_Lenght;}

	/*-------------------------------------------------------------------*/

	inline void setX(int vi_X){m_X=vi_X;}
	inline void setY(int vi_Y){m_Y=vi_Y;}
	inline void setZ(int vi_Y){m_Y=vi_Y;}

	inline void setWidth (int vi_Width) {m_Width=vi_Width;  }
	inline void setHeight(int vi_Height){m_Height=vi_Height;}
	inline void setLenght(int vi_Lenght){m_Lenght=vi_Lenght;}

	/*-------------------------------------------------------------------*/

	inline void addX(int vi_X){m_X+=vi_X;}
	inline void addY(int vi_Y){m_Y+=vi_Y;}
	inline void addZ(int vi_Y){m_Y+=vi_Y;}

	inline void addWidth (int vi_Width) {m_Width +=vi_Width;}
	inline void addHeight(int vi_Height){m_Height+=vi_Height;}
	inline void addLenght(int vi_Lenght){m_Lenght+=vi_Lenght;}

	/*-------------------------------------------------------------------*/

	bool isInside(Box * vi_Box);
	bool isOutside(Box * vi_Box);

	/*-------------------------------------------------------------------*/

	Box();
	Box(Box * vi_Box);
	Box(Box & vi_Box);
	Box(int vi_Width, int vi_Height, int vi_Lenght, int vi_X, int vi_Y, int vi_Z);

	virtual ~Box();	
};

#endif

/*-----------------------------------------------------------------------*/
/* End of file
/*-----------------------------------------------------------------------*/  

Fichier Zip

Pour les "Membres Club", vous pouvez télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip

Commentaires et avis

Aucun commentaire pour le moment.

Ajouter un commentaire



Nos sponsors

Sondage...

CalendriCode

Octobre 2008
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
2728293031  

Consulter la suite du CalendriCode



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel BAÏSE, Merci à Vincent pour ses précieux conseils
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés
Temps d'éxécution de la page : 0,140 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.