001: /*
002: * This file is part of the GeOxygene project source files.
003: *
004: * GeOxygene aims at providing an open framework which implements OGC/ISO specifications for
005: * the development and deployment of geographic (GIS) applications. It is a open source
006: * contribution of the COGIT laboratory at the Institut G�ographique National (the French
007: * National Mapping Agency).
008: *
009: * See: http://oxygene-project.sourceforge.net
010: *
011: * Copyright (C) 2005 Institut G�ographique National
012: *
013: * This library is free software; you can redistribute it and/or modify it under the terms
014: * of the GNU Lesser General Public License as published by the Free Software Foundation;
015: * either version 2.1 of the License, or any later version.
016: *
017: * This library is distributed in the hope that it will be useful, but WITHOUT ANY
018: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
019: * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
020: *
021: * You should have received a copy of the GNU Lesser General Public License along with
022: * this library (see file LICENSE if present); if not, write to the Free Software
023: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024: *
025: */
026:
027: package fr.ign.cogit.geoxygene.spatial.geomcomp;
028:
029: import java.util.ArrayList;
030: import java.util.List;
031:
032: //import spatial.geomprim.GM_Solid;
033: //import spatial.geomprim.GM_SolidBoundary;
034:
035: /** NON UTILISE.
036: * Complexe ayant toutes les propri�tes g�om�triques d'un solide. C'est un set de solides (GM_Solid) partageant des surfaces communes.
037: * H�rite de GM_Solid, mais le lien n'appara�t pas explicitement (probl�me de double h�ritage en java). Les m�thodes et attributs ont �t� report�s.
038: *
039: * <P> ATTENTION : normalement, il faudrait remplir le set "element" (contrainte : toutes les primitives du generateur
040: * sont dans le complexe). Ceci n'est pas impl�ment� pour le moment.
041: * <P> A FAIRE AUSSI : iterateur sur "generator"
042: *
043: * @author Thierry Badard & Arnaud Braun
044: * @version 1.0
045: *
046: */
047:
048: class GM_CompositeSolid extends GM_Composite {
049:
050: ////////////////////////////////////////////////////////////////////////
051: // Attribut "generator" et m�thodes pour le traiter ////////////////////
052: ////////////////////////////////////////////////////////////////////////
053:
054: /** Les GM_Solid constituant self. */
055: protected List generator;
056:
057: /** Renvoie la liste des GM_Solid */
058: public List getGenerator() {
059: return generator;
060: }
061:
062: /** Renvoie le GM_Solid de rang i */
063: //public GM_Solid getGenerator (int i) {return (GM_Solid)this.generator.get(i);}
064: /** Affecte un GM_Solid au rang i. Attention : aucun contr�le de coh�rence n'est effectu�. */
065: //protected void setGenerator (int i, GM_Solid value) {this.generator.set(i, value);}
066: /** Ajoute un GM_Solid en fin de liste. Attention : aucun contr�le de coh�rence n'est effectu�. */
067: //protected void addGenerator (GM_Solid value) {this.generator.add(value);}
068: /** Ajoute un GM_Solid au rang i. Attention : aucun contr�le de coh�rence n'est effectu�. */
069: //protected void addGenerator (int i, GM_Solid value) {this.generator.add(i, value);}
070: /** Efface le (ou les) GM_Solid pass� en param�tre. Attention : aucun contr�le de coh�rence n'est effectu�. */
071: /*protected void removeGenerator (GM_Solid value) throws Exception {
072: if (this.generator.size() == 1)
073: throw new Exception ( "Dr Cogit - error 4.001" );
074: else
075: this.generator.remove(value);
076: }*/
077:
078: /** Efface le GM_Solid de rang i. Attention : aucun contr�le de coh�rence n'est effectu�. */
079: protected void removeGenerator(int i) throws Exception {
080: if (this .generator.size() == 1)
081: throw new Exception(
082: "Il n'y a qu'un objet dans l'association.");
083: else
084: this .generator.remove(i);
085: }
086:
087: /** Nombre de GM_Solid constituant self */
088: public int sizeGenerator() {
089: return this .generator.size();
090: }
091:
092: /////////////////////////////////////////////////////////////////////////////////////////
093: // M�thodes h�rit�es de GM_Solid (h�ritage simul�) //////////////////////////////////////
094: /////////////////////////////////////////////////////////////////////////////////////////
095:
096: /** NON IMPLEMETE (renvoie 0.0).
097: * Aire. */
098: // Dans la norme, le r�sultat est de type Area.
099: public double area() {
100: return 0.0;
101: }
102:
103: /** NON IMPLEMETE (renvoie 0.0).
104: * Volume. */
105: // Dans la norme, le r�sultat est de type Volume.
106: public double volume() {
107: return 0.0;
108: }
109:
110: /** NON IMPLEMENTE (Renvoie null).
111: * Red�finition de l'op�rateur "boundary" sur GM_Object. Renvoie une GM_SolidBoundary,
112: * c'est-�-dire un shell ext�rieur et �ventuellement un (des) shell(s) int�rieur(s). */
113: //public GM_SolidBoundary boundary() {return null;}
114:
115: /////////////////////////////////////////////////////////////////////////////////////////
116: // Constructeurs ////////////////////////////////////////////////////////////////////////
117: /////////////////////////////////////////////////////////////////////////////////////////
118: /** Constructeur par d�faut. */
119: public GM_CompositeSolid() {
120: generator = new ArrayList();
121: }
122:
123: /** Constructeur � partir d'un GM_Solid. */
124: /* public GM_CompositeSolid (GM_Solid theSolid) {
125: generator = new ArrayList();
126: generator.add(theSolid);
127: }*/
128: }
|