Created
November 17, 2012 16:51
-
-
Save ACruz91/4097581 to your computer and use it in GitHub Desktop.
FIchero que contiene la clase ListaPuntoGrafico2D
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _LISTAPUNTOGRAFICO2D_HPP //Guardas de inclusión | |
#define _LISTAPUNTOGRAFICO2D_HPP | |
//Includes | |
#include <cstring> | |
#include <iostream> | |
#include <cstdlib> | |
#include "contornoGrafico2D.hpp" | |
//Espacios de Nombres | |
using namespace std; | |
namespace poo{ | |
class ListaPuntoGrafico2D : public ContornoGrafico2D { | |
//Declaración de la estructura Lista | |
typedef struct Nodo{ | |
PuntoGrafico2D p; | |
struct Nodo* siguiente; | |
}NodoLista; | |
private: | |
int _n; | |
NodoLista* _cabeza; | |
NodoLista* _cola; | |
NodoLista* _cursor; | |
public: | |
//Métodos Públicos | |
//Constructor | |
inline ListaPuntoGrafico2D(){_n=0; _cabeza=NULL; _cola=NULL; _cursor=NULL;} | |
//Destructor | |
~ListaPuntoGrafico2D(){cout<<endl; cout<<"Destructor Aplicado" <<endl;} | |
//Metodos de Acesso | |
bool vacia(){if(_n==0 && _cabeza==NULL && _cola==NULL){return true;} else {return false;}} | |
inline int longitud(){return _n;} | |
inline NodoLista* get(){return _cursor;} //Preguntar | |
inline ListaPuntoGrafico2D liberarMemoria(ListaPuntoGrafico2D &C){delete _cola; ListaPuntoGrafico2D();} //Preguntar | |
inline bool set(PuntoGrafico2D &p) const{}; | |
//Métodos de Modificación | |
//inline getListaPuntos(); | |
//Funciones de Lectura o Escritura | |
void escribirContornoGrafico2D(); | |
void leerContornoDeFichero(string nombreFichero); | |
void grabarContornoEnFichero(string nombreFichero); | |
//Funciones Auxiliares | |
PuntoGrafico2D calcularCentroide(); | |
void nuevoPrimerPunto(int indice); | |
}; //Cierra la clase | |
} //Cierra el espacio de Nombres | |
#endif //Cierra el guarda |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment