00001 package commandline.ImageStuff.GeometricObjects;
00002
00003 import commandline.Encoder.EncoderEdge;
00004 import commandline.ImageStuff.Image;
00005 import commandline.ImageStuff.Loc;
00006
00007 public class ConstantEncoderEdge extends EncoderEdge {
00008
00009 public ConstantEncoderEdge(ParametrizedPiercingVertex a,
00010 ParametrizedPiercingVertex b, int maxr) {
00011 super(a, b, maxr);
00012 }
00013
00014 public ConstantEncoderEdge(ParametrizedPiercingVertex a, ParametrizedPiercingVertex b,Image image, int [][] lijn,int maxr) {
00015 super(a, b,image, lijn,maxr);
00016 }
00017
00018 float constant=0;
00019 boolean constant_berekend=false;
00020 protected float getFunctiewaardeOn(int index) {
00021 if(!constant_berekend){
00022 for (Loc loc : getLocs()) {
00023 constant+=Image.getInstance().getPuntOpEnty(loc).getZ();
00024 }
00025 constant/=getLocs().size();
00026 constant_berekend=true;
00027 }
00028 return constant;
00029 }
00030
00031 }