public class SaveScadFiles extends Object
Helper class to save several models to a directory.
A typical usage looks like this:
new SaveScadFiles(new File("c:/temp"))
.addModel("test.scad", new TestModel())
.saveScadFiles();
| Constructor and Description |
|---|
SaveScadFiles(File root)
Creates the object with the given root directory.
|
| Modifier and Type | Method and Description |
|---|---|
SaveScadFiles |
addModel(String fileName,
Abstract3dModel model,
IScadGenerationContext scadContext)
Deprecated.
|
SaveScadFiles |
addModel(String fileName,
IModel model)
Adds a SCAD file with the given file name and the given model using the default generation context.
|
SaveScadFiles |
addModel(String fileName,
IModel model,
IColorGenerationContext context)
Adds a SCAD file with the given file name and the given model.
|
SaveScadFiles |
addModel(String fileName,
IModel model,
ITagColors tagColors)
Adds a SCAD file with the given file name and the given model.
|
SaveScadFiles |
addModelProvider(IModelProvider provider)
Adds a model provider with the default generation context.
|
SaveScadFiles |
addModelProvider(IModelProvider provider,
IColorGenerationContext context)
Adds a model provider with the given color context.
|
SaveScadFiles |
addModelProvider(IModelProvider provider,
ITagColors tagColors)
Adds a model provider with the given tag colors.
|
SaveScadFiles |
addModels(String fileName,
Collection<IModel> models)
Adds a SCAD file with the given file name and the given model list.
|
SaveScadFiles |
addModels(String fileName,
Collection<IModel> models,
IColorGenerationContext context)
Adds a SCAD file with the given file name and the given model list.
|
SaveScadFiles |
addScadFile(IScadFile scadFile)
Adds a SCAD file.
|
SaveScadFiles |
addScadFiles(Collection<IScadFile> scadFile)
Adds a collection of SCAD files.
|
void |
saveScadFiles()
Save the added SCAD files into the corresponding files.
|
public SaveScadFiles(File root) throws IllegalValueException
root - the root directory where the files will be savedIllegalValueException - if the root is null or exists as a filepublic SaveScadFiles addScadFile(IScadFile scadFile)
scadFile - the SCAD file to be savedpublic SaveScadFiles addScadFiles(Collection<IScadFile> scadFile)
scadFile - the SCAD files to be savedpublic SaveScadFiles addModels(String fileName, Collection<IModel> models)
fileName - the name of the file where the model will be savedmodels - the models to be savedpublic SaveScadFiles addModels(String fileName, Collection<IModel> models, IColorGenerationContext context)
fileName - the name of the file where the model will be savedmodels - the models to be savedcontext - the context used for the scad file generationpublic SaveScadFiles addModel(String fileName, IModel model)
Consts is added before the model.fileName - the name of the file where the model will be savedmodel - the model to be savedpublic SaveScadFiles addModel(String fileName, IModel model, ITagColors tagColors)
Consts is added before the model.fileName - the name of the file where the model will be savedmodel - the model to be savedtagColors - the colors used for the scad file generationpublic SaveScadFiles addModel(String fileName, IModel model, IColorGenerationContext context)
Consts is added before the model.fileName - the name of the file where the model will be savedmodel - the model to be savedcontext - the color context used for the scad file generation@Deprecated public SaveScadFiles addModel(String fileName, Abstract3dModel model, IScadGenerationContext scadContext)
Adds a SCAD file with the given file name and the given model.
A default Consts is added before the model.
A method for backward compatibility only - use
addModel(fileName, model.subModel(context)) instead.
fileName - the name of the file where the model will be savedmodel - the model to be savedscadContext - the context used for the scad file generationpublic SaveScadFiles addModelProvider(IModelProvider provider)
Consts is added before the model.provider - the provider to be addedpublic SaveScadFiles addModelProvider(IModelProvider provider, ITagColors tagColors)
Consts is added before the model.provider - the provider to be addedtagColors - the tag-color pairs to be used for the SCAD file generationpublic SaveScadFiles addModelProvider(IModelProvider provider, IColorGenerationContext context)
Consts is added before the model.provider - the provider to be addedcontext - the context used for the SCAD file generationpublic void saveScadFiles()
throws IOException
IOException - if any IO error happens during the file writeCopyright © 2014–2020, Printing in 3D. All rights reserved.