use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.
the class VCDatabaseScanner method scanGeometries.
/**
* Insert the method's description here.
* Creation date: (2/2/01 3:40:29 PM)
* @throws DataAccessException
* @throws XmlParseException
*/
public void scanGeometries(VCDatabaseVisitor databaseVisitor, PrintStream logFilePrintStream, User[] users, KeyValue singleGeometryKey, HashSet<KeyValue> includeHash, HashSet<KeyValue> excludeHash, boolean bAbortOnDataAccessException) throws DataAccessException, XmlParseException {
if (users == null) {
users = getAllUsers();
}
try {
// start visiting models and writing log
logFilePrintStream.println("Start scanning geometries......");
logFilePrintStream.println("\n");
for (int i = 0; i < users.length; i++) {
User user = users[i];
GeometryInfo[] geoInfos = dbServerImpl.getGeometryInfos(user, false);
for (int j = 0; j < geoInfos.length; j++) {
if (singleGeometryKey != null && !geoInfos[j].getVersion().getVersionKey().compareEqual(singleGeometryKey)) {
System.out.println("skipping geometry, not the single one that we wanted");
continue;
}
if (excludeHash != null && excludeHash.contains(geoInfos[j].getVersion().getVersionKey())) {
System.out.println("skipping geometry with key '" + geoInfos[j].getVersion().getVersionKey() + "'");
continue;
}
if (includeHash != null && !includeHash.contains(geoInfos[j].getVersion().getVersionKey())) {
System.out.println("not including geometry with key '" + geoInfos[j].getVersion().getVersionKey() + "'");
continue;
}
if (!databaseVisitor.filterGeometry(geoInfos[j])) {
continue;
}
try {
BigString geometryXML = dbServerImpl.getGeometryXML(user, geoInfos[j].getVersion().getVersionKey());
Geometry geometry = cbit.vcell.xml.XmlHelper.XMLToGeometry(new XMLSource(geometryXML.toString()));
geometry.refreshDependencies();
databaseVisitor.visitGeometry(geometry, logFilePrintStream);
} catch (Exception e2) {
lg.error(e2.getMessage(), e2);
if (bAbortOnDataAccessException) {
throw e2;
}
}
}
}
logFilePrintStream.close();
} catch (Exception e) {
System.err.println("error writing to log file.");
}
}
use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.
the class GeometryTable method getInfo.
/**
* This method was created in VisualAge.
* @return cbit.vcell.geometry.GeometryInfo
* @param rset java.sql.ResultSet
* @param log cbit.vcell.server.SessionLog
*/
public VersionInfo getInfo(ResultSet rset, Connection con) throws SQLException, DataAccessException {
java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
int dim = rset.getInt(GeometryTable.table.dimension.toString());
double oX = rset.getBigDecimal(GeometryTable.table.originX.toString()).doubleValue();
double oY = rset.getBigDecimal(GeometryTable.table.originY.toString()).doubleValue();
double oZ = rset.getBigDecimal(GeometryTable.table.originZ.toString()).doubleValue();
org.vcell.util.Origin origin = new org.vcell.util.Origin(oX, oY, oZ);
double extentX = rset.getBigDecimal(ExtentTable.table.extentX.toString()).doubleValue();
double extentY = rset.getBigDecimal(ExtentTable.table.extentY.toString()).doubleValue();
double extentZ = rset.getBigDecimal(ExtentTable.table.extentZ.toString()).doubleValue();
org.vcell.util.Extent extent = new org.vcell.util.Extent(extentX, extentY, extentZ);
KeyValue imgRef = null;
java.math.BigDecimal bigDecimal = rset.getBigDecimal(GeometryTable.table.imageRef.toString());
if (!rset.wasNull()) {
imgRef = new KeyValue(bigDecimal);
}
String softwareVersion = rset.getString(SoftwareVersionTable.table.softwareVersion.toString());
GeometryInfo geomInfo = new GeometryInfo(version, dim, extent, origin, imgRef, VCellSoftwareVersion.fromString(softwareVersion));
return geomInfo;
/*GeometryInfo geomInfo = new GeometryInfo();
geomInfo.dimension = rset.getInt(GeometryTable.dimension.toString());
geomInfo.originX = rset.getDouble(GeometryTable.originX.toString());
geomInfo.originY = rset.getDouble(GeometryTable.originY.toString());
geomInfo.originZ = rset.getDouble(GeometryTable.originZ.toString());
geomInfo.extentRef = new KeyValue(rset.getBigDecimal(GeometryTable.extentRef.toString(), 0));
geomInfo.imageRef = new KeyValue(rset.getBigDecimal(GeometryTable.imageRef.toString(), 0));
geomInfo.version = getVersion(rset,log);
return geomInfo;
*/
}
Aggregations