use of maspack.util.IndentingPrintWriter in project artisynth_core by artisynth.
the class FemMeshComp method writeMesh.
/**
* Writes the mesh for this FemMeshComp out to a named file,
* using the format described for
* {@link #writeMesh(PrintWriter)}.
*
* @param fileName Name of file to write the mesh to
* @return <code>true</code> if the mesh is a polygonal mesh and was written,
* and <code>false</code> otherwise.
*/
public boolean writeMesh(String fileName) {
IndentingPrintWriter pw = null;
boolean status = false;
try {
pw = ArtisynthIO.newIndentingPrintWriter(fileName);
status = writeMesh(pw);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (pw != null) {
pw.close();
}
}
return status;
}
use of maspack.util.IndentingPrintWriter in project artisynth_core by artisynth.
the class MFreeMeshComp method writeMesh.
/**
* Writes the mesh for this FemMeshComp out to a named file,
* using the format described for
* {@link #writeMesh(PrintWriter)}.
*
* @param fileName Name of file to write the mesh to
* @return <code>true</code> if the mesh is a polygonal mesh and was written,
* and <code>false</code> otherwise.
*/
public boolean writeMesh(String fileName) {
IndentingPrintWriter pw = null;
boolean status = false;
try {
pw = ArtisynthIO.newIndentingPrintWriter(fileName);
status = writeMesh(pw);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (pw != null) {
pw.close();
}
}
return status;
}
use of maspack.util.IndentingPrintWriter in project artisynth_core by artisynth.
the class NURBSCurve2dTest method writeCurve.
public void writeCurve(String fileName, NURBSCurve2d curve) {
try {
PrintWriter pw = new IndentingPrintWriter(new PrintWriter(new BufferedWriter(new FileWriter(fileName))));
curve.write(pw);
pw.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations