ome.services.roi
Class GeomTool

java.lang.Object
  extended by ome.services.roi.GeomTool

public class GeomTool
extends Object

Strategy for handling the conversion between shapes and database-specific geometries. Implements ApplicationListener in order to keep the strategy-specific geometry columns in sync when a ShapeChangeMessage is published.

Since:
Beta4.1

Field Summary
protected  PixelData data
           
protected  Executor ex
           
protected  SessionFactory factory
           
protected  AtomicBoolean hasShapes
           
protected  org.apache.commons.logging.Log log
           
protected  ome.util.SqlAction sql
           
protected  String uuid
           
 
Constructor Summary
GeomTool(PixelData data, ome.util.SqlAction sql, SessionFactory factory)
           
GeomTool(PixelData data, ome.util.SqlAction sql, SessionFactory factory, Executor ex, String uuid)
           
 
Method Summary
 String dbPath(omero.model.Shape shape)
           
 Object discriminator(String string)
          Maps from multiple possible user-provided names of shapes (e.g.
 omero.model.Ellipse ellipse(double cx, double cy, double rx, double ry)
           
 omero.model.Ellipse ellipse(double cx, double cy, double rx, double ry, int t, int z)
           
 omero.api.ShapePoints getPoints(long shapeId, org.hibernate.Session session)
           
 omero.api.RoiStats getStats(List<Long> shapeIds)
           
 omero.model.Line ln(double x1, double y1, double x2, double y2)
           
 omero.model.Point pt(double x, double y)
           
 List<omero.model.Shape> random(int count)
           
 omero.model.Rect rect(double x, double y, double w, double h)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log

hasShapes

protected final AtomicBoolean hasShapes

sql

protected final ome.util.SqlAction sql

factory

protected final SessionFactory factory

data

protected final PixelData data

ex

protected final Executor ex

uuid

protected final String uuid
Constructor Detail

GeomTool

public GeomTool(PixelData data,
                ome.util.SqlAction sql,
                SessionFactory factory)

GeomTool

public GeomTool(PixelData data,
                ome.util.SqlAction sql,
                SessionFactory factory,
                Executor ex,
                String uuid)
Method Detail

random

public List<omero.model.Shape> random(int count)

ln

public omero.model.Line ln(double x1,
                           double y1,
                           double x2,
                           double y2)

rect

public omero.model.Rect rect(double x,
                             double y,
                             double w,
                             double h)

pt

public omero.model.Point pt(double x,
                            double y)

ellipse

public omero.model.Ellipse ellipse(double cx,
                                   double cy,
                                   double rx,
                                   double ry)

ellipse

public omero.model.Ellipse ellipse(double cx,
                                   double cy,
                                   double rx,
                                   double ry,
                                   int t,
                                   int z)

dbPath

public String dbPath(omero.model.Shape shape)

getPoints

public omero.api.ShapePoints getPoints(long shapeId,
                                       org.hibernate.Session session)

getStats

public omero.api.RoiStats getStats(List<Long> shapeIds)

discriminator

public Object discriminator(String string)
Maps from multiple possible user-provided names of shapes (e.g. "::omero::model::Text", "Text", "TextI", "omero.model.TextI", "ome.model.roi.Text", ...) to the definitive database discriminator.

Parameters:
string -
Returns:


OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

Copyright © 2009 The University of Dundee. All Rights Reserved.