Revision Log
Revision: 1.2 - (view) (download) (as text)
| 1 : | ktanaka | 1.2 | import java.util.*; |
| 2 : | ktanaka | 1.1 | |
| 3 : | public class Skeleton { | ||
| 4 : | Point[] points; | ||
| 5 : | Element[] elements; | ||
| 6 : | Annotation[] annotations; | ||
| 7 : | Skeleton(Point[] points,Element[] elements,Annotation[] annotations){ | ||
| 8 : | this.points=points; | ||
| 9 : | this.elements=elements; | ||
| 10 : | this.annotations=annotations; | ||
| 11 : | } | ||
| 12 : | public Point[] getPoints(){ return points;} | ||
| 13 : | public Element[] getElements(){ return elements;} | ||
| 14 : | public Annotation[] getAnnotations(){ return annotations;} | ||
| 15 : | ktanaka | 1.2 | // まずは腕だめしに単純なやつをやってみる |
| 16 : | public Outline[] makeOutline(Renderer renderer){ | ||
| 17 : | Vector v=new Vector(); | ||
| 18 : | for(int i=0;i<elements.length;i++){ | ||
| 19 : | Outline[] outlines=renderer.elementRenderer(points,elements[i]); | ||
| 20 : | if(outlines!=null){ | ||
| 21 : | v.add(outlines[0]); | ||
| 22 : | v.add(outlines[1]); | ||
| 23 : | } | ||
| 24 : | } | ||
| 25 : | Outline[] ret=new Outline[v.size()]; | ||
| 26 : | v.toArray(ret); | ||
| 27 : | return ret; | ||
| 28 : | } | ||
| 29 : | ktanaka | 1.1 | public String toString(){ |
| 30 : | String ret="Skeleton("; | ||
| 31 : | int i,len=points.length; | ||
| 32 : | for(i=0;i<len;i++) | ||
| 33 : | ret+=points[i].toString()+","; | ||
| 34 : | len=elements.length; | ||
| 35 : | for(i=0;i<len;i++) | ||
| 36 : | ret+=elements[i].toString()+","; | ||
| 37 : | return ret+")"; | ||
| 38 : | } | ||
| 39 : | } |
|
ktanaka Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |