Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9197/src/net/sourceforge/bprocessor/model
Modified Files:
Surface.java
Added Files:
Project.java
Log Message:
Project definition
Index: Surface.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** Surface.java 20 Sep 2005 18:22:49 -0000 1.24
--- Surface.java 21 Sep 2005 07:29:30 -0000 1.25
***************
*** 197,200 ****
--- 197,227 ----
return vertices;
}
+
+ /**
+ * Return the first vertex, which is the vertex from
+ * first edge that is NOT shared between first and
+ * second edge.
+ * @return The first vertex
+ */
+ public Vertex getFirtVertex() {
+ List edges = getEdges();
+ if (edges.size() == 0) {
+ return null;
+ } else if (edges.size() == 1) {
+ Edge e0 = (Edge) edges.get(0);
+ return e0.getFrom();
+ } else {
+ Edge e0 = (Edge) edges.get(0);
+ Edge e1 = (Edge) edges.get(1);
+ Vertex current = null;
+ if (!e1.contains(e0.getFrom())) {
+ return e0.getFrom();
+ }
+ if (!e1.contains(e0.getTo())) {
+ return e0.getTo();
+ }
+ }
+ return null;
+ }
/**
* Get the inner surfaces
--- NEW FILE: Project.java ---
//---------------------------------------------------------------------------------
// $Id: Project.java,v 1.1 2005/09/21 07:29:30 henryml Exp $
//
// Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net)
// Released under the Lesser GNU Public License v2.1
//---------------------------------------------------------------------------------
package net.sourceforge.bprocessor.model;
import java.util.HashSet;
import java.util.Set;
import org.apache.log4j.Logger;
/**
* The Project
*
* Interface to access objects in the system.
* Wraps the database functions.
*
*/
public class Project {
/** The logger */
private static Logger log = Logger.getLogger(Project.class);
/** The instance */
private static Project instance;
/**
* Create a vertex
* @param v The Vertex
*/
void create(Vertex v) { }
/**
* Update a vertex
* @param v The vertex
*/
public synchronized void update(Vertex v) {
}
/**
* Remove a vertex
* @param v The vertex
*/
public synchronized void remove(Vertex v) {
}
/**
* Find all vertexs
* @return The vertexs
*/
public Set findAll() {
Set result = new HashSet();
return result;
}
/**
* Find a vertex by id
* @param id The id
* @return The vertex
*/
public synchronized Vertex findById(Long id) {
Vertex result = null;
return result;
}
/**
* Find a vertex by name
* @param name The name
* @return The vertex
*/
public Vertex findByName(String name) {
Vertex result = null;
return result;
}
/**
* Find vertex based upon location and delta
* @param x The x coordinate
* @param y The y coordinate
* @param z The z coordinate
* @param delta The delta value
* @return The vertexs
*/
public Set findByLocation(double x, double y, double z, double delta) {
Set result = new HashSet();
return result;
}
}
|