a6fb01cc3321d47133b008c46fb4d595d4973f09
[anneal.git] / src / edu / berkeley / qfat / geom / AffineConstraint.java
1 package edu.berkeley.qfat.geom;
2 import javax.media.opengl.*;
3
4 /** a constraint arising from the conjunction of linear equalities */
5 public interface AffineConstraint {
6
7     public Point getProjection(Point p);
8     public AffineConstraint intersect(AffineConstraint c, float epsilon);
9
10     public static class All implements AffineConstraint {
11         public Point getProjection(Point p) { return p; }
12         public AffineConstraint intersect(AffineConstraint c, float epsilon) { return c; }
13     }
14
15     public static class Nothing implements AffineConstraint {
16         public Point getProjection(Point p) { return null; }
17         public AffineConstraint intersect(AffineConstraint c, float epsilon) { return this; }
18     }
19
20 }