Source Code Cross Referenced for TP_Object.java in  » GIS » GeOxygene-1.3 » fr » ign » cogit » geoxygene » spatial » toporoot » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeOxygene 1.3 » fr.ign.cogit.geoxygene.spatial.toporoot 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.toporoot;
028:
029:        import fr.ign.cogit.geoxygene.feature.FT_Feature;
030:        import fr.ign.cogit.geoxygene.spatial.topoprim.TP_DirectedEdge;
031:        import fr.ign.cogit.geoxygene.spatial.topoprim.TP_DirectedFace;
032:        import fr.ign.cogit.geoxygene.spatial.topoprim.TP_DirectedNode;
033:        import fr.ign.cogit.geoxygene.spatial.topoprim.TP_Edge;
034:        import fr.ign.cogit.geoxygene.spatial.topoprim.TP_Face;
035:        import fr.ign.cogit.geoxygene.spatial.topoprim.TP_Node;
036:
037:        /**
038:         * Classe mere abstraite pour les objets topologiques.
039:         * Un TP_Object est soit un TP_Primitive, soit un TP_Complex.
040:         * On appelle id l'identifiant topologique qu'on retrouve dans la table TP_Object du SGBD. 
041:         * <P> Tout ce qui est relatif aux TP_Complex n'est pas implemente.
042:         *
043:         * @author Thierry Badard & Arnaud Braun
044:         * @version 1.0
045:         * 
046:         */
047:
048:        abstract public class TP_Object implements  Cloneable {
049:
050:            ////////////////////////////////////////////////////////////////////////////////////////////////////////
051:            /// pour le mapping ///////////////////////////////////////////////////////////////////////////////////
052:            ////////////////////////////////////////////////////////////////////////////////////////////////////////
053:            /** Constructeur necessaire pour affecter le type de la sous-classe concrete. */
054:            public TP_Object() {
055:                setClasstype(getClass().getName());
056:                setOjbConcreteClass(getClass().getName());
057:            }
058:
059:            // castor
060:            protected String classtype;
061:
062:            public String getClasstype() {
063:                return classtype;
064:            }
065:
066:            public void setClasstype(String Classtype) {
067:                classtype = Classtype;
068:            }
069:
070:            // ojb
071:            protected String ojbConcreteClass;
072:
073:            public String getOjbConcreteClass() {
074:                return ojbConcreteClass;
075:            }
076:
077:            public void setOjbConcreteClass(String OjbConcreteClass) {
078:                ojbConcreteClass = OjbConcreteClass;
079:            }
080:
081:            /////////////////////////////////////////////////////////////////////////////////////
082:            /// identifiant /////////////////////////////////////////////////////////////////////
083:            /////////////////////////////////////////////////////////////////////////////////////    
084:            /** Identifiant topologique. */
085:            protected int id;
086:
087:            /** Renvoie l'identifiant topologique. */
088:            public int getId() {
089:                return this .id;
090:            }
091:
092:            /**  Affecte une valeur a l'identifiant topologique.*/
093:            // assure la coherence avec featureID  
094:            // OBSOLETE    
095:            public void setId(int Id) {
096:                /*	this.id=Id;
097:                	if (feature != null)
098:                		feature.setTopoID(id);*/
099:            }
100:
101:            /////////////////////////////////////////////////////////////////////////////////////
102:            /// lien 1-1 vers FT_Feature - ce lien n'est pas dans la norme //////////////////////
103:            /////////////////////////////////////////////////////////////////////////////////////    
104:            /** FT_Feature auquel est rattache this. */
105:            protected FT_Feature feature;
106:
107:            /** FT_Feature auquel est rattache this. */
108:            public FT_Feature getFeature() {
109:                return feature;
110:            }
111:
112:            /** Affecte un FT_Feature a this. */
113:            // A REVOIR OBSOLETE    
114:            public void setFeature(FT_Feature Feature) {
115:                /*        if (Feature != null) {
116:                 feature = Feature;
117:                 featureID = Feature.getId();
118:                 if (Feature.getTopo() != this)
119:                 Feature.setTopo(this);
120:                 } else {
121:                 feature = null;
122:                 featureID = 0;
123:                 }*/
124:            }
125:
126:            // pour ojb
127:            protected int featureID;
128:
129:            public int getFeatureID() {
130:                return featureID;
131:            }
132:
133:            public void setFeatureID(int ID) {
134:                featureID = ID;
135:            }
136:
137:            /////////////////////////////////////////////////////////////////////////////////////
138:            /// lien n-m vers FT_Feature - abandonne pour cause de maivaise perf ////////////////
139:            /////////////////////////////////////////////////////////////////////////////////////        
140:            /** FT_Feature auquel est rattache? cette topologie. */
141:            //protected List feature = new ArrayList();
142:            //protected Collection feature = new ArrayList();    
143:            /** Renvoie la liste des FT_Feature auquelle est rattach? cette topologie.*/
144:            /*    public Collection getFeature() {
145:                return this.feature;            
146:            }
147:            
148:            /** Affecte une liste des FT_Feature.*/
149:            /*    public void setFeature (Collection L) {
150:                this.feature = L;            
151:            }
152:            
153:            /** Affecte un  FT_Feature. A REVOIR (addFeature ??)*/
154:            /*    public void setFeature (FT_Feature Feature) {
155:                this.feature.add(Feature);             
156:            }
157:            
158:            /** Renvoie le FT_Feature de rang 0. */
159:            /*public FT_Feature getFeature() {
160:                return (FT_Feature)this.feature.get(0);            
161:            }*/
162:
163:            /** Renvoie le FT_Feature de rang i. */
164:            /*   public FT_Feature getFeature(int i) {
165:                if (i==0)
166:                return (FT_Feature)this.feature.iterator().next();
167:                else {
168:                    System.out.println("tp_object- getFeature - probleme");
169:                    return null;
170:                }
171:            }*/
172:
173:            /** Affecte un FT_Feature.  */
174:            /*    public void addFeature(FT_Feature Feature) {
175:                this.feature.add(Feature);        
176:            }
177:
178:            /** Renvoie le nombre de FT_Feature. */
179:            /*    public int sizeFeature() {
180:                return feature.size();
181:            }
182:            
183:
184:            
185:            /////////////////////////////////////////////////////////////////////////////////////
186:            /// dimension ///////////////////////////////////////////////////////////////////////
187:            /////////////////////////////////////////////////////////////////////////////////////    
188:            /** Dimension topologique de l'objet 
189:             * (0 pour node, 1 pour edge, 2 pour face, 3 pour solid).    */
190:            public int dimension() {
191:                if (this  instanceof  TP_Node || this  instanceof  TP_DirectedNode)
192:                    return 0;
193:                else if (this  instanceof  TP_Edge
194:                        || this  instanceof  TP_DirectedEdge)
195:                    return 1;
196:                else if (this  instanceof  TP_Face
197:                        || this  instanceof  TP_DirectedFace)
198:                    return 2;
199:                //  else if (this instanceof TP_Solid || this instanceof TP_DirectedSolid) return 3;
200:                else {
201:                    System.out
202:                            .println("this n'est pas une primitive topologique. La fonction dimension renvoie -1.");
203:                    return -1;
204:                }
205:            }
206:
207:            /////////////////////////////////////////////////////////////////////////////////////
208:            /// methodes de la norme supprimees pour simplification                           //
209:            /// ces methodes sont definies dans les sous-classes avec un bon typage en sortie //
210:            /////////////////////////////////////////////////////////////////////////////////////    
211:            /** Set de TP_DirectedTopo structures en TP_Boundary, qui representent la frontiere de self.
212:             * Si le TP_Object est associe a un GM_Object, sa frontirre doit rtre cohrrente en terme d'orientation avec celle du GM_Object.
213:             * Les TP_Boundary sont des TP_Expression et ont donc une forme polynomiale (exemple : +edge1-edge2+edge3, ...)  */
214:            //abstract public TP_Boundary boundary() ;
215:            /** Tous les TP_DirectedTopo qui ont self pour fronti?re.  */
216:            //abstract public List coBoundary() ;
217:
218:            /////////////////////////////////////////////////////////////////////////////////////
219:            /// non implemente, relatif aux TP_Complex //////////////////////////////////////////
220:            /////////////////////////////////////////////////////////////////////////////////////     
221:            /** Set de TP_Primitive constituant l'intrrieur de self (c'est-a-dire sans la frontiere) dans le complexe maximal de l'objet. 
222:             * Pour un TP_Primitive, le resultat sera self. 
223:             * Pour un complexe, le resultat sera les primitives de ce complexe qui ne sont pas sur la frontiere du complexe.
224:             * Le resultat est equivalent a l'interieur de la realisation geometrique de self. */
225:            //public List interior() {
226:            //    return null;
227:            //}
228:            /** Union de l'interieur et de la frontiere de self.
229:                closure()=interior().union(boundary()) */
230:            //public List closure() {
231:            //    return null;
232:            //}
233:            /** Set de TP_Primitive constituant exterieur de self dans le complexe maximal de l'objet :
234:             * toutes les TP_Primitives du complexe maximal qui ne sont pas a l'interieur, ou la frontiere du TP_Object. */
235:            //public List exterior() {
236:            //    return null;
237:            //}
238:            /** Le TP_Complex maximal qui contient self. */
239:            //public TP_Complex maximalComplex() {
240:            //    return null;
241:            //}
242:
243:            /////////////////////////////////////////////////////////////////////////////////////
244:            /// equals //////////////////////////////////////////////////////////////////////////
245:            /////////////////////////////////////////////////////////////////////////////////////
246:            /** Renvoie true si les 2 objets appartiennent a la meme classe et ont le meme identifiant 
247:             (champs id).
248:             ATTENTION : si aucun id n'a encore ete affecte aux objets, alors les deux id vaudront 0 et le test
249:             renverra true.*/
250:            public boolean equalsID(java.lang.Object obj) {
251:                if (obj == null || !this .getClass().equals(obj.getClass()))
252:                    return (false);
253:                TP_Object o = (TP_Object) obj;
254:                if (this .id != o.id)
255:                    return (false);
256:                return (true);
257:            }
258:
259:            /////////////////////////////////////////////////////////////////////////////////////
260:            /// clone ///////////////////////////////////////////////////////////////////////////
261:            /////////////////////////////////////////////////////////////////////////////////////    
262:            /** Clone l'objet. */
263:            public Object clone() {
264:                try {
265:                    return super .clone();
266:                } catch (Exception e) {
267:                    e.printStackTrace();
268:                    return null;
269:                }
270:            }
271:
272:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.