inspectCommand(components[i].charAt(0)); inspectValues(bezierPath, mStartPoint.x + "," + -mStartPoint.y); paths.add(bezierPath); bezierPath = new CompoundCurve3D(); inspectValues(bezierPath, components[i]);
/** * Parses an SVG resource path string. The string needs to sit in a text file in "res/raw". * * @param context * @param resourceId * @return */ public List<CompoundCurve3D> parseResourceString(Context context, int resourceId) { InputStream rawResource = context.getResources().openRawResource(resourceId); String l; BufferedReader r = new BufferedReader(new InputStreamReader(rawResource)); StringBuilder s = new StringBuilder(); try { while ((l = r.readLine()) != null) { s.append(l + "\n"); } rawResource.close(); r.close(); } catch (IOException e) {} return parseString(s.toString()); }
/** * Parses an SVG Path string * * @param pathString * @return */ public List<CompoundCurve3D> parseString(String pathString) { mPreviousPoint = new Vector3(); mStartPoint = new Vector3(); mPreviousControlPoint = new Vector3(); return pathStringToLine(pathString); }
c = new Vector3(Double.parseDouble(vals[2]), -Double.parseDouble(vals[3]), 0); p = mCurrentCommandIsRelative ? c.addAndSet(mPreviousPoint, c) : c; cp1 = reflect(mPreviousControlPoint, mPreviousPoint); cp2 = new Vector3(Double.parseDouble(vals[0]), -Double.parseDouble(vals[1]), 0); if (mCurrentCommandIsRelative)
c = new Vector3(Double.parseDouble(vals[2]), -Double.parseDouble(vals[3]), 0); p = mCurrentCommandIsRelative ? c.addAndSet(mPreviousPoint, c) : c; cp1 = reflect(mPreviousControlPoint, mPreviousPoint); cp2 = new Vector3(Double.parseDouble(vals[0]), -Double.parseDouble(vals[1]), 0); if (mCurrentCommandIsRelative)
inspectCommand(components[i].charAt(0)); inspectValues(bezierPath, mStartPoint.x + "," + -mStartPoint.y); paths.add(bezierPath); bezierPath = new CompoundCurve3D(); inspectValues(bezierPath, components[i]);
/** * Parses an SVG Path string * * @param pathString * @return */ public List<CompoundCurve3D> parseString(String pathString) { mPreviousPoint = new Vector3(); mStartPoint = new Vector3(); mPreviousControlPoint = new Vector3(); return pathStringToLine(pathString); }
/** * Parses an SVG resource path string. The string needs to sit in a text file in "res/raw". * * @param context * @param resourceId * @return */ public List<CompoundCurve3D> parseResourceString(Context context, int resourceId) { InputStream rawResource = context.getResources().openRawResource(resourceId); String l; BufferedReader r = new BufferedReader(new InputStreamReader(rawResource)); StringBuilder s = new StringBuilder(); try { while ((l = r.readLine()) != null) { s.append(l + "\n"); } rawResource.close(); r.close(); } catch (IOException e) {} return parseString(s.toString()); }