/** * Initializes evaluator * * @param type surface type * @param ulo lowest u * @param uhi highest u * @param ustride number of objects between control points in u direction * @param uorder surface order in u direction * @param vlo lowest v * @param vhi highest v * @param vstride number of control points' coords * @param vorder surface order in v direction * @param pts control points */ public void map2f( int type, float ulo, float uhi, int ustride, int uorder, float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) { // TODO Auto-generated method stub if (output_triangles) { // System.out.println("TODO openglsurfaceevaluator.map2f output_triangles"); } else { gl.glMap2f( type, ulo, uhi, ustride, uorder, vlo, vhi, vstride, vorder, pts.getArray(), pts.getPointer()); } }
/** * Prepares quilt for conversion * * @param quilt quilt to work with */ public void setupquilt(Quilt quilt) { // DONE CArrayOfQuiltspecs qspec = new CArrayOfQuiltspecs(quilt.qspec); quilt.eqspec = new CArrayOfQuiltspecs(qspec.getArray(), dim); for (Knotspec knotspec = kspec; knotspec != null; ) { qspec.get().stride = knotspec.poststride; qspec.get().width = knotspec.bend.getPointer() - knotspec.bbegin.getPointer(); qspec.get().order = knotspec.order; qspec.get().offset = knotspec.postoffset; qspec.get().index = 0; qspec.get().bdry[0] = (knotspec.kleft.getPointer() == knotspec.kfirst.getPointer()) ? 1 : 0; qspec.get().bdry[1] = (knotspec.kright.getPointer() == knotspec.klast.getPointer()) ? 1 : 0; qspec.get().breakpoints = new float[qspec.get().width + 1]; CArrayOfFloats k = new CArrayOfFloats(qspec.get().breakpoints, 0); for (CArrayOfBreakpts bk = new CArrayOfBreakpts(knotspec.bbegin); bk.getPointer() <= knotspec.bend.getPointer(); bk.pp()) { k.set(bk.get().value); k.pp(); } knotspec = knotspec.next; if (knotspec != null) qspec.pp(); } quilt.cpts = new CArrayOfFloats(outcpts); quilt.next = null; }
/** Transforms knotspecs - conversion */ public void transform() { // DONE Knotspec knotspec; outcpts.setPointer(0); for (knotspec = kspec; knotspec != null; knotspec = knotspec.next) knotspec.istransformed = false; for (knotspec = kspec; knotspec != null; knotspec = knotspec.next) { for (Knotspec kspec2 = kspec; kspec2 != null; kspec2 = kspec2.next) kspec2.kspectotrans = knotspec; kspec.transform(outcpts); knotspec.istransformed = true; } }