Source Code Cross Referenced for TP_Edge.java in  » GIS » GeOxygene-1.3 » fr » ign » cogit » geoxygene » spatial » topoprim » 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.topoprim 
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.topoprim;
028:
029:        import java.util.ArrayList;
030:        import java.util.List;
031:
032:        /**
033:         * Brin topologique (orientation positive).
034:         * <P> L'operation "CoBoundary" redefinie sur TP_Object renvoie ici une liste de TP_DirectedFace, indiquant quelles faces ont self pour frontiere.
035:         * Cette liste n'est pas ordonnee.
036:         * <P> L'operation "Boundary" redefinie sur TP_Object renvoie le point initial du brin (TP_DirectedNode negatif) et le point final (TP_DirectedNode positif) ;
037:         * Ces points sont structures en TP_EdgeBoundary. 
038:         *
039:         * EXPLIQUER la structure de graphe
040:         * 
041:         * @author Thierry Badard, Arnaud Braun & Audrey Simon
042:         * @version 1.0
043:         * 
044:         */
045:
046:        public class TP_Edge extends TP_DirectedEdge {
047:
048:            /** Les 2 primitives orientees de this. */
049:            // hesitation sur le fait : proxy[0] = this ou proxy[0] = new TP_DirectedEdge(id) + proxy[0].topo = this        
050:            protected TP_DirectedEdge[] proxy;
051:
052:            /////////////////////////////////////////////////////////////////////////////////////
053:            // constructeur /////////////////////////////////////////////////////////////////////
054:            /////////////////////////////////////////////////////////////////////////////////////                
055:            public TP_Edge() {
056:                orientation = +1;
057:                proxy = new TP_DirectedEdge[2];
058:                proxy[0] = this ;
059:                topo = this ;
060:                proxy[1] = new TP_DirectedEdge();
061:                proxy[1].topo = this ;
062:                proxy[1].orientation = -1;
063:            }
064:
065:            // redefinition pour affecter un bon id au proxy negatif   
066:            public void setId(int Id) {
067:                super .setId(Id);
068:                proxy[1].setId(-Id);
069:                if (Id < 0)
070:                    System.out
071:                            .println("TP_Edge::setId(id) : L'identifiant doit être positif");
072:            }
073:
074:            /////////////////////////////////////////////////////////////////////////////////////
075:            // asTP_DirectedTopo() //////////////////////////////////////////////////////////////
076:            /////////////////////////////////////////////////////////////////////////////////////    
077:            /** Renvoie le TP_DirectedEdge d'orientation "sign". "sign" doit valoir +1 ou -1, sinon renvoie null. */
078:            public TP_DirectedEdge asTP_DirectedTopo(int sign) {
079:                if (sign == +1)
080:                    return proxy[0];
081:                else if (sign == -1)
082:                    return proxy[1];
083:                else {
084:                    System.out
085:                            .println("TP_Edge::asTP_DirectedTopo(sign) : Passer +1 ou -1 en paramètre.");
086:                    return null;
087:                }
088:            }
089:
090:            /////////////////////////////////////////////////////////////////////////////////////
091:            // container ////////////////////////////////////////////////////////////////////////
092:            /////////////////////////////////////////////////////////////////////////////////////    
093:            /** Solide dans lequel est inclus this, pour les brins isoles. */
094:            public TP_Solid container;
095:
096:            public TP_Solid getContainer() {
097:                return container;
098:            };
099:
100:            public void setContainer(TP_Solid Container) {
101:                container = Container;
102:            }
103:
104:            /////////////////////////////////////////////////////////////////////////////////////
105:            // boundary /////////////////////////////////////////////////////////////////////////
106:            /////////////////////////////////////////////////////////////////////////////////////     
107:            /** Noeud initial. */
108:            public TP_Node startnode;
109:
110:            public TP_Node getStartnode() {
111:                return startnode;
112:            }
113:
114:            public void setStartnode(TP_Node StartNode) {
115:                if (StartNode != null) {
116:                    this .startnode = StartNode;
117:                    this .startnodeID = StartNode.getId();
118:                    if (!StartNode.getSortant().contains(this ))
119:                        StartNode.addSortant(this );
120:                } else {
121:                    startnode = null;
122:                    startnodeID = 0;
123:                }
124:            }
125:
126:            // pour le mapping avec OJB
127:            public int startnodeID;
128:
129:            public int getStartnodeID() {
130:                return startnodeID;
131:            }
132:
133:            public void setStartnodeID(int StartnodeID) {
134:                startnodeID = StartnodeID;
135:            }
136:
137:            /** Noeud final. */
138:            public TP_Node endnode;
139:
140:            public TP_Node getEndnode() {
141:                return endnode;
142:            }
143:
144:            public void setEndnode(TP_Node EndNode) {
145:                if (EndNode != null) {
146:                    this .endnode = EndNode;
147:                    this .endnodeID = EndNode.getId();
148:                    if (!EndNode.getEntrant().contains(this ))
149:                        EndNode.addEntrant(this );
150:                } else {
151:                    endnode = null;
152:                    endnodeID = 0;
153:                }
154:            }
155:
156:            // pour le mapping avec OJB
157:            public int endnodeID;
158:
159:            public int getEndnodeID() {
160:                return endnodeID;
161:            }
162:
163:            public void setEndnodeID(int EndnodeID) {
164:                endnodeID = EndnodeID;
165:            }
166:
167:            /** Renvoie les TP_DirectedNode frontiere du TP_Edge, structure en TP_EdgeBoundary. 
168:             * Un peut lourd a utiliser, mieux d'utiliser endNode() et startNode().*/
169:            public TP_EdgeBoundary boundary() {
170:                return new TP_EdgeBoundary(
171:                        this .startnode.asTP_DirectedTopo(-1), this .endnode
172:                                .asTP_DirectedTopo(+1));
173:            }
174:
175:            /////////////////////////////////////////////////////////////////////////////////////
176:            // coBoundary ///////////////////////////////////////////////////////////////////////
177:            /////////////////////////////////////////////////////////////////////////////////////    
178:            /** Les TP_DirectedFace associes au TP_Edge. La face gauche est orientee positivement,
179:               la face droite est orientee negativement. */
180:            public List coBoundary() {
181:                List result = new ArrayList();
182:                if (leftface != null)
183:                    result.add(this .leftface.asTP_DirectedTopo(+1));
184:                if (rightface != null)
185:                    result.add(this .rightface.asTP_DirectedTopo(-1));
186:                return result;
187:            }
188:
189:            /** Face gauche. */
190:            public TP_Face leftface;
191:
192:            public TP_Face getLeftface() {
193:                return leftface;
194:            }
195:
196:            public void setLeftface(TP_Face Leftface) {
197:                if (Leftface.getId() == -1)
198:                    leftface = null;
199:                else if (Leftface != null) {
200:                    this .leftface = Leftface;
201:                    this .leftfaceID = Leftface.getId();
202:                    if (!Leftface.getLeft().contains(this ))
203:                        Leftface.addLeft(this );
204:                } else {
205:                    leftface = null;
206:                    leftfaceID = 0;
207:                }
208:            }
209:
210:            // pour le mapping avec OJB    
211:            // on affecte  -1 pour avoir une valeur par defaut non nulle
212:            // il faut un objet topo avec un id = -1 (TP_Face) dans la table TP_Object;
213:            // cela accelere le chargement    
214:            public int leftfaceID = -1;
215:
216:            public int getLeftfaceID() {
217:                return leftfaceID;
218:            }
219:
220:            public void setLeftfaceID(int LeftfaceID) {
221:                leftfaceID = LeftfaceID;
222:            }
223:
224:            /** Face droite. */
225:            public TP_Face rightface;
226:
227:            public TP_Face getRightface() {
228:                return rightface;
229:            }
230:
231:            public void setRightface(TP_Face Rightface) {
232:                if (Rightface.getId() == -1)
233:                    rightface = null;
234:                else if (Rightface != null) {
235:                    this .rightface = Rightface;
236:                    this .rightfaceID = Rightface.getId();
237:                    if (!Rightface.getRight().contains(this ))
238:                        Rightface.addRight(this );
239:                } else {
240:                    rightface = null;
241:                    rightfaceID = 0;
242:                }
243:            }
244:
245:            // pour le mapping avec OJB  
246:            // on affecte  -1 pour avoir une valeur par defaut non nulle
247:            // il faut un objet topo avec un id = -1 (TP_Face) dans la table TP_Object;
248:            // cela accelere le chargement    
249:            public int rightfaceID = -1;
250:
251:            public int getRightfaceID() {
252:                return rightfaceID;
253:            }
254:
255:            public void setRightfaceID(int RightfaceID) {
256:                rightfaceID = RightfaceID;
257:            }
258:
259:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.