BowlerKernel
|
Classes | |
class | MetaPostPath2 |
Public Member Functions | |
void | setHolePolarity (boolean p) |
SVGLoad (URI uri) throws IOException | |
SVGLoad (File f) throws IOException | |
SVGLoad (String data) throws IOException | |
ArrayList< CSG > | extrude (double thickness) throws IOException |
HashMap< String, List< Polygon > > | toPolygons (double resolution) |
HashMap< String, List< Polygon > > | toPolygons () |
List< String > | getLayers () |
CSG | extrudeLayerToCSG (double t, String layer) |
ArrayList< CSG > | extrudeLayer (double t, String layer) |
HashMap< String, ArrayList< CSG > > | extrudeLayers (double t) |
HashMap< String, ArrayList< CSG > > | extrudeLayers (double t, double resolution, String targetLayer) |
ArrayList< CSG > | extrude (double t, double resolution) throws IOException |
void | setSVGDocument (Document document) |
Document | getSVGDocument () |
ISVGLoadProgress | getProgress () |
void | setProgress (ISVGLoadProgress progress) |
Static Public Member Functions | |
static ArrayList< CSG > | extrude (File f, double thickness) throws IOException |
static HashMap< String, List< Polygon > > | toPolygons (File f) throws IOException |
static ArrayList< CSG > | extrude (File f, double thickness, double resolution) throws IOException |
static ArrayList< CSG > | extrude (URI uri, double thickness) throws IOException |
static ArrayList< CSG > | extrude (URI uri, double thickness, double resolution) throws IOException |
static boolean | isCCW (Polygon polygon) |
static ISVGLoadProgress | getProgressDefault () |
Private Member Functions | |
double | toPx (String value) |
void | setScale (double value) |
Double | getScale () |
double | toMM (String value) |
void | loadAllGroups (double resolution, Transform startingFrame) |
void | loadGroup (SVGOMGElement element, double resolution, Transform startingFrame, String encapsulatingLayer) |
Transform | getNewframe (Transform startingFrame, Node transforms) |
void | loadPath (Node pathNode, double resolution, Transform startingFrame, String encapsulatingLayer) |
void | loadComposite (String code, double resolution, Transform startingFrame, String encapsulatingLayer, Color c) |
void | loadSingle (String code, double resolution, Transform startingFrame, String encapsulatingLayer, Color c) |
void | initSVGDOM (Document document) |
Document | createSVGDocument (URI uri) throws IOException |
HashMap< String, List< Polygon > > | getPolygonByLayers () |
void | setPolygonByLayers (HashMap< String, List< Polygon >> polygonByLayers) |
Private Attributes | |
Document | svgDocument |
HashMap< String, List< Polygon > > | polygonByLayers = null |
HashMap< String, ArrayList< CSG > > | csgByLayers = new HashMap<String, ArrayList<CSG>>() |
HashMap< Polygon, Color > | colors =new HashMap<>() |
ISVGLoadProgress | progress = null |
double | thickness |
boolean | negativeThickness = false |
double | height = 0 |
double | width = 0 |
Double | scale =null |
HashMap< String, Double > | units =new HashMap<>() |
Static Private Attributes | |
static final String | PATH_ELEMENT_NAME = "path" |
static final String | GROUP_ELEMENT_NAME = "g" |
static ISVGLoadProgress | progressDefault |
Responsible for converting all SVG path elements into MetaPost curves.
Definition at line 49 of file SVGLoad.java.
eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad | ( | URI | uri | ) | throws IOException |
Creates an SVG Document given a URI.
uri | Path to the file. |
Exception | Something went wrong parsing the SVG file. |
Definition at line 204 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.createSVGDocument(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.setSVGDocument().
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.extrude(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toPolygons().
eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad | ( | File | f | ) | throws IOException |
Creates an SVG Document given a URI.
f | Path to the file. |
Exception | Something went wrong parsing the SVG file. |
Definition at line 216 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.createSVGDocument(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.setSVGDocument().
eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad | ( | String | data | ) | throws IOException |
Creates an SVG Document String of SVG data.
data | Contents of an svg file |
Exception | Something went wrong parsing the SVG file. |
Definition at line 228 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.createSVGDocument(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.setSVGDocument().
|
private |
Use the SAXSVGDocumentFactory to parse the given URI into a DOM.
uri | The path to the SVG file to read. |
Exception | The file could not be read. |
Definition at line 770 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad().
ArrayList<CSG> eu.mihosoft.vrl.v3d.svg.SVGLoad.extrude | ( | double | t, |
double | resolution | ||
) | throws IOException |
Definition at line 706 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers().
ArrayList<CSG> eu.mihosoft.vrl.v3d.svg.SVGLoad.extrude | ( | double | thickness | ) | throws IOException |
Definition at line 239 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.thickness.
|
static |
Definition at line 245 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.thickness.
|
static |
Definition at line 280 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.thickness.
|
static |
Definition at line 284 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.thickness.
|
static |
Definition at line 290 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.thickness.
ArrayList<CSG> eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayer | ( | double | t, |
String | layer | ||
) |
Definition at line 663 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers().
HashMap<String,ArrayList<CSG> > eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers | ( | double | t | ) |
Definition at line 666 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.extrude(), eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayer(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayerToCSG().
HashMap<String,ArrayList<CSG> > eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers | ( | double | t, |
double | resolution, | ||
String | targetLayer | ||
) |
Definition at line 669 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.colors, eu.mihosoft.vrl.v3d.svg.SVGLoad.csgByLayers, eu.mihosoft.vrl.v3d.IExtrusion.extrude(), eu.mihosoft.vrl.v3d.Extrude.getExtrusionEngine(), eu.mihosoft.vrl.v3d.svg.SVGLoad.getPolygonByLayers(), eu.mihosoft.vrl.v3d.svg.SVGLoad.negativeThickness, eu.mihosoft.vrl.v3d.CSG.setColor(), eu.mihosoft.vrl.v3d.svg.SVGLoad.thickness, eu.mihosoft.vrl.v3d.svg.SVGLoad.toPolygons(), and eu.mihosoft.vrl.v3d.CSG.toZMax().
CSG eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayerToCSG | ( | double | t, |
String | layer | ||
) |
Definition at line 657 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers(), eu.mihosoft.vrl.v3d.CSG.setName(), and eu.mihosoft.vrl.v3d.CSG.unionAll().
Referenced by com.neuronrobotics.bowlerstudio.scripting.SvgLoader.run().
List<String> eu.mihosoft.vrl.v3d.svg.SVGLoad.getLayers | ( | ) |
Definition at line 648 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.getPolygonByLayers(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toPolygons().
Referenced by com.neuronrobotics.bowlerstudio.scripting.SvgLoader.run().
|
private |
Definition at line 371 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.Transform.apply(), eu.mihosoft.vrl.v3d.Transform.inverse(), eu.mihosoft.vrl.v3d.Transform.scale(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toPx().
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadGroup(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.loadPath().
|
private |
Definition at line 788 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.polygonByLayers.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers(), eu.mihosoft.vrl.v3d.svg.SVGLoad.getLayers(), eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toPolygons().
ISVGLoadProgress eu.mihosoft.vrl.v3d.svg.SVGLoad.getProgress | ( | ) |
Definition at line 776 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.progress.
|
static |
Definition at line 784 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.progressDefault.
|
private |
Definition at line 105 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.scale.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle(), eu.mihosoft.vrl.v3d.svg.SVGLoad.setScale(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toMM().
Document eu.mihosoft.vrl.v3d.svg.SVGLoad.getSVGDocument | ( | ) |
Returns the SVG document parsed upon instantiating this class.
Definition at line 739 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.svgDocument.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadAllGroups().
|
private |
Enhance the SVG DOM for the given document to provide CSS- and SVG-specific DOM interfaces.
document | The document to enhance. http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom |
Definition at line 751 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.setSVGDocument().
|
static |
Definition at line 610 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.Edge.fromPolygon().
|
private |
Definition at line 294 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.getSVGDocument(), eu.mihosoft.vrl.v3d.svg.SVGLoad.height, eu.mihosoft.vrl.v3d.svg.SVGLoad.loadGroup(), eu.mihosoft.vrl.v3d.svg.SVGLoad.loadPath(), eu.mihosoft.vrl.v3d.svg.SVGLoad.setScale(), eu.mihosoft.vrl.v3d.svg.SVGLoad.toMM(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.width.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.toPolygons().
|
private |
Definition at line 580 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle().
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadPath().
|
private |
Definition at line 335 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.getNewframe(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.loadPath().
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadAllGroups().
|
private |
Definition at line 417 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.getNewframe(), eu.mihosoft.vrl.v3d.svg.SVGLoad.loadComposite(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toPx().
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadAllGroups(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.loadGroup().
|
private |
Definition at line 621 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.colors, com.piro.bezier.BezierPath.evaluate(), eu.mihosoft.vrl.v3d.Polygon.fromPoints(), eu.mihosoft.vrl.v3d.Polygon.getPoints(), eu.mihosoft.vrl.v3d.svg.SVGLoad.getPolygonByLayers(), eu.mihosoft.vrl.v3d.svg.SVGLoad.getScale(), eu.mihosoft.vrl.v3d.svg.SVGLoad.height, com.piro.bezier.BezierPath.parsePathString(), eu.mihosoft.vrl.v3d.svg.SVGLoad.scale, eu.mihosoft.vrl.v3d.svg.SVGLoad.setPolygonByLayers(), and eu.mihosoft.vrl.v3d.Extrude.toCCW().
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadComposite().
void eu.mihosoft.vrl.v3d.svg.SVGLoad.setHolePolarity | ( | boolean | p | ) |
Definition at line 122 of file SVGLoad.java.
|
private |
Definition at line 791 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.polygonByLayers.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle().
void eu.mihosoft.vrl.v3d.svg.SVGLoad.setProgress | ( | ISVGLoadProgress | progress | ) |
Definition at line 780 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.progress.
|
private |
Definition at line 93 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.getScale(), eu.mihosoft.vrl.v3d.svg.SVGLoad.scale, and eu.mihosoft.vrl.v3d.svg.SVGLoad.units.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadAllGroups().
void eu.mihosoft.vrl.v3d.svg.SVGLoad.setSVGDocument | ( | Document | document | ) |
This will set the document to parse. This method also initializes the SVG DOM enhancements, which are necessary to perform SVG and CSS manipulations. The initialization is also required to extract information from the SVG path elements.
document | The document that contains SVG content. |
Definition at line 729 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.initSVGDOM().
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad().
|
private |
Definition at line 109 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.getScale(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toPx().
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadAllGroups().
HashMap<String,List<Polygon> > eu.mihosoft.vrl.v3d.svg.SVGLoad.toPolygons | ( | ) |
Definition at line 276 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.getLayers().
HashMap<String,List<Polygon> > eu.mihosoft.vrl.v3d.svg.SVGLoad.toPolygons | ( | double | resolution | ) |
Definition at line 264 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.getPolygonByLayers(), eu.mihosoft.vrl.v3d.svg.SVGLoad.loadAllGroups(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.polygonByLayers.
|
static |
This function will create a list of polygons that can be exported back to an SVG
f | the file containing the SVG data |
IOException |
Definition at line 259 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.SVGLoad().
Referenced by com.neuronrobotics.bowlerstudio.scripting.SvgLoader.run().
|
private |
Definition at line 78 of file SVGLoad.java.
References eu.mihosoft.vrl.v3d.svg.SVGLoad.units.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.getNewframe(), eu.mihosoft.vrl.v3d.svg.SVGLoad.loadPath(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toMM().
|
private |
Definition at line 56 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle().
|
private |
Definition at line 55 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers().
|
staticprivate |
Definition at line 51 of file SVGLoad.java.
|
private |
Definition at line 64 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadAllGroups(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle().
|
private |
Definition at line 63 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers().
|
staticprivate |
Definition at line 50 of file SVGLoad.java.
|
private |
Definition at line 54 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.getPolygonByLayers(), eu.mihosoft.vrl.v3d.svg.SVGLoad.setPolygonByLayers(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toPolygons().
|
private |
Definition at line 61 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.getProgress(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.setProgress().
|
staticprivate |
Definition at line 113 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.getProgressDefault().
|
private |
Definition at line 66 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.getScale(), eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.setScale().
|
private |
Definition at line 52 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.getSVGDocument().
|
private |
Definition at line 62 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.extrude(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.extrudeLayers().
|
private |
Definition at line 67 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.setScale(), and eu.mihosoft.vrl.v3d.svg.SVGLoad.toPx().
|
private |
Definition at line 65 of file SVGLoad.java.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadAllGroups().