12.05.2013 Views

Fundamentos de análisis geográfico con SEXTANTE - La Salle

Fundamentos de análisis geográfico con SEXTANTE - La Salle

Fundamentos de análisis geográfico con SEXTANTE - La Salle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

324 CAPÍTULO 20. PROGRAMACIÓN DE MÓDULOS DE <strong>SEXTANTE</strong><br />

#inclu<strong>de</strong> "MiModulo.h"<br />

#inclu<strong>de</strong> "MiModuloSimpl.h"<br />

Cada fichero <strong>de</strong> código <strong>de</strong>fine una clase <strong>de</strong> C++. En el siguiente bloque <strong>de</strong> código estas<br />

clases <strong>de</strong>ben especificarse <strong>de</strong>ntro <strong>de</strong>l método Create Module. El or<strong>de</strong>n en el que aparecen <strong>de</strong>ntro<br />

<strong>de</strong>l bloque switch <strong>de</strong>terminará el or<strong>de</strong>n el el que aparezcan en la raíz <strong>de</strong> menús <strong>de</strong>finida unas<br />

líneas antes.<br />

CModule * Create_Module(int i)<br />

{<br />

CModule *pModule;<br />

}<br />

switch( i )<br />

{<br />

case 0:<br />

pModule = new CTemplate;<br />

break;<br />

<strong>de</strong>fault:<br />

pModule = NULL;<br />

break;<br />

}<br />

return( pModule );<br />

Una vez más, hay que cambiar el nombre <strong>de</strong> la clase a la que se llama, poniendo CMiModulo<br />

en lugar <strong>de</strong> CTemplate. A<strong>de</strong>más, <strong>de</strong>bemos incorporar la clase correspondiente al segundo<br />

módulo. Sustituye el bloque anterior <strong>de</strong> código por el siguiente.<br />

CModule * Create_Module(int i)<br />

{<br />

CModule *pModule;<br />

switch( i )<br />

{<br />

case 0:<br />

pModule = new CMyModule;<br />

break;<br />

case 1:<br />

pModule = new CMyModuleSimpl;<br />

break;<br />

<strong>de</strong>fault:<br />

pModule = NULL;<br />

break;<br />

}<br />

return( pModule );<br />

}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!