Skip to content
Snippets Groups Projects
Commit 062cad37 authored by Ivan Dages's avatar Ivan Dages
Browse files

nomad 3d exporter : doc

parent 8850d263
No related branches found
No related tags found
No related merge requests found
......@@ -22,17 +22,22 @@ import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter;
/**
* Class for exporting Nomad 3D models.
* @author dages
*
*/
public class Nomad3DExporter {
/**
*
* Default constructor.
*/
public Nomad3DExporter() {
}
/**
* Exports the XML file of the model.
* @param model Model to export
* @param xmlPath Path of the XML file target
*/
public void write(Model model, String xmlPath) {
try {
File outputFile = new File(xmlPath);
......@@ -61,6 +66,10 @@ public class Nomad3DExporter {
}
}
/**
* Exports the XML file of the model. The location of this file is provided by the user.
* @param model Model to export
*/
public void write(Model model) {
FileChooser chooser = new FileChooser();
chooser.setTitle("Save model");
......@@ -72,6 +81,12 @@ public class Nomad3DExporter {
}
}
/**
* Writes the XML element of a component. The element is not added to the document.
* @param comp Component to write
* @param doc XML document
* @return XML element of the component
*/
private Element writeComponent(Component comp, Document doc) {
String tagName = "Component";
if (comp.isRoot()) {
......@@ -101,6 +116,12 @@ public class Nomad3DExporter {
return eComponent;
}
/**
* Writes the XML element of a configuration. The element is not added to the document.
* @param config Configuration to write
* @param doc XML document
* @return XML element for the configuration
*/
private Element writeConfigParams(ConfigParams config, Document doc) {
Element eConfig = doc.createElement("ConfigParams");
......@@ -137,6 +158,12 @@ public class Nomad3DExporter {
return eConfig;
}
/**
* Writes the XML element of a material. The element is not added to the document.
* @param material Material to write
* @param doc XML document
* @return XML element of the material
*/
private Element writeMaterial(PhongMaterial material, Document doc) {
Element eMaterial = doc.createElement("Material");
......@@ -161,6 +188,12 @@ public class Nomad3DExporter {
return eMaterial;
}
/**
* Writes the XML element of an axis. The element is not added to the document.
* @param axis Axis to write
* @param doc XML document
* @return XML element of the axis
*/
private Element writeAxis(Axis axis, Document doc) {
Element eAxis = doc.createElement("Axis");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment