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.topoprim;
028:
029: import java.util.Collection;
030: import java.util.List;
031:
032: /**
033: * Solide topologique (orientation positive).
034: * <P> L'opération "CoBoundary" redéfinie sur TP_Object renvoie NULL.
035: * <P> L'opération "Boundary" redéfinie sur TP_Object renvoie un set de TP_DirectedFace avec les orientations adéquates. Cette opération est aussi une association.
036: * Ceci n'est pas implémenté.
037: *
038: * @author Thierry Badard, Arnaud Braun & Audrey Simon
039: * @version 1.0
040: *
041: */
042:
043: class TP_Solid extends TP_DirectedSolid {
044:
045: /** Les 2 primitives orientées de this. */
046: // hesitation sur le fait : proxy[0] = this ou proxy[0] = new TP_DirectedSolid(id) + proxy[0].topo = this
047: protected TP_DirectedSolid[] proxy;
048:
049: /////////////////////////////////////////////////////////////////////////////////////
050: // constructeur /////////////////////////////////////////////////////////////////////
051: /////////////////////////////////////////////////////////////////////////////////////
052: public TP_Solid() {
053: orientation = +1;
054: proxy = new TP_DirectedSolid[2];
055: proxy[0] = this ;
056: topo = this ;
057: proxy[1] = new TP_DirectedSolid();
058: proxy[1].topo = this ;
059: proxy[1].orientation = -1;
060: }
061:
062: // redefinition pour affecter un bon id au proxy negatif
063: public void setId(int Id) {
064: super .setId(Id);
065: proxy[1].setId(-Id);
066: if (Id < 0)
067: System.out
068: .println("TP_Solid::setId(id) : L'identifiant doit être positif");
069: }
070:
071: /////////////////////////////////////////////////////////////////////////////////////
072: // asTP_DirectedTopo() //////////////////////////////////////////////////////////////
073: /////////////////////////////////////////////////////////////////////////////////////
074: /** Renvoie le TP_DirectedSolid d'orientation "sign". "sign" doit valoir +1 ou -1, sinon renvoie null. */
075: public TP_DirectedSolid asTP_DirectedTopo(int sign) {
076: if (sign == +1)
077: return proxy[0];
078: else if (sign == -1)
079: return proxy[1];
080: else {
081: System.out
082: .println("TP_Solid::asTP_DirectedTopo(sign) : Passer +1 ou -1 en paramètre.");
083: return null;
084: }
085: }
086:
087: /////////////////////////////////////////////////////////////////////////////////////
088: // isolated in (relation inverse de container) //////////////////////////////////////
089: /////////////////////////////////////////////////////////////////////////////////////
090: /** Relation inverse de container sur TP_Edge. */
091: public Collection isolated;
092:
093: public Collection getIsolated() {
094: return isolated;
095: };
096:
097: public void setIsolated(Collection c) {
098: isolated = c;
099: }
100:
101: public void addIsolated(TP_Edge edge) {
102: isolated.add(edge);
103: }
104:
105: /////////////////////////////////////////////////////////////////////////////////////
106: // boundary() ///////////////////////////////////////////////////////////////////////
107: /////////////////////////////////////////////////////////////////////////////////////
108: /** non implémenté (renvoie null). Renvoie la frontière de self.*/
109: public TP_SolidBoundary boundary() {
110: return null;
111: }
112:
113: /////////////////////////////////////////////////////////////////////////////////////
114: // coBounfdary() ////////////////////////////////////////////////////////////////////
115: /////////////////////////////////////////////////////////////////////////////////////
116: /** Renvoie null. */
117: public List coBoundary() {
118: return null;
119: }
120:
121: }
|