01: /*
02: * This file is part of the GeOxygene project source files.
03: *
04: * GeOxygene aims at providing an open framework which implements OGC/ISO specifications for
05: * the development and deployment of geographic (GIS) applications. It is a open source
06: * contribution of the COGIT laboratory at the Institut Géographique National (the French
07: * National Mapping Agency).
08: *
09: * See: http://oxygene-project.sourceforge.net
10: *
11: * Copyright (C) 2005 Institut Géographique National
12: *
13: * This library is free software; you can redistribute it and/or modify it under the terms
14: * of the GNU Lesser General Public License as published by the Free Software Foundation;
15: * either version 2.1 of the License, or any later version.
16: *
17: * This library is distributed in the hope that it will be useful, but WITHOUT ANY
18: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19: * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
20: *
21: * You should have received a copy of the GNU Lesser General Public License along with
22: * this library (see file LICENSE if present); if not, write to the Free Software
23: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24: *
25: */
26:
27: package fr.ign.cogit.geoxygene.spatial.topoprim;
28:
29: import java.util.ArrayList;
30: import java.util.List;
31:
32: /**
33: * Frontière d'une face topologique.
34: * Constituée de plusieurs TP_Ring, l'un étant l'extérieur, les autres l'intérieur.
35: * Un TP_Ring est orienté de telle sorte que la face est à sa gauche.
36: * La frontière d'une face est une expression du type :
37: * Face.Boundary() = b : TP_FaceBoundary = b.exterior + b.interior.
38: *
39: * @author Thierry Badard & Arnaud Braun
40: * @version 1.0
41: *
42: */
43:
44: public class TP_FaceBoundary extends TP_PrimitiveBoundary {
45:
46: /** Frontière extérieure. */
47: protected TP_Ring exterior;
48:
49: /** Renvoie la frontière extérieure. */
50: public TP_Ring getExterior() {
51: return (TP_Ring) this .exterior;
52: }
53:
54: /** Frontières intérieures. */
55: protected List interior;
56:
57: /** Renvoie l'anneau intérieure de rang i. */
58: public TP_Ring getInterior(int i) {
59: return (TP_Ring) this .interior.get(i);
60: }
61:
62: /** Ajoute un anneau intérieur. */
63: public void addInterior(TP_Ring ring) {
64: this .interior.add(ring);
65: for (int i = 0; i < ring.sizeTerm(); i++)
66: this .addTerm(ring.getTerm(i));
67: }
68:
69: /** Nombre d'anneaux intérieurs. */
70: public int sizeInterior() {
71: return this .interior.size();
72: }
73:
74: /** Constructeur par défaut. */
75: public TP_FaceBoundary() {
76: exterior = null;
77: interior = new ArrayList();
78: }
79:
80: /** Constructeur à partir d'un anneau extérieur. */
81: public TP_FaceBoundary(TP_Ring ext) {
82: exterior = ext;
83: interior = new ArrayList();
84: for (int i = 0; i < ext.sizeTerm(); i++)
85: this.addTerm(ext.getTerm(i));
86: }
87:
88: }
|