use of org.hwyl.sexytopo.model.sketch.CrossSectionDetail in project sexytopo by richsmith.
the class SketchJsonTranslater method toJson.
public static synchronized JSONObject toJson(Sketch sketch) throws JSONException {
JSONObject json = new JSONObject();
JSONArray pathDetailArray = new JSONArray();
for (PathDetail pathDetail : sketch.getPathDetails()) {
pathDetailArray.put(toJson(pathDetail));
}
json.put(PATHS_TAG, pathDetailArray);
JSONArray textDetailArray = new JSONArray();
for (TextDetail textDetail : sketch.getTextDetails()) {
textDetailArray.put(toJson(textDetail));
}
json.put(LABELS_TAG, textDetailArray);
JSONArray symbolDetailArray = new JSONArray();
for (SymbolDetail symbolDetail : sketch.getSymbolDetails()) {
symbolDetailArray.put(toJson(symbolDetail));
}
json.put(SYMBOLS_TAG, symbolDetailArray);
JSONArray crossSectionDetailArray = new JSONArray();
for (CrossSectionDetail crossSectionDetail : sketch.getCrossSectionDetails()) {
crossSectionDetailArray.put(toJson(crossSectionDetail));
}
json.put(CROSS_SECTIONS_TAG, crossSectionDetailArray);
return json;
}
Aggregations