public class ObjectContainer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<Drawable2D> |
objects
Contains all geometric objects created in the 2D drawing view.
|
private STLMesh |
stlMesh
Contains all imported STL meshes.
|
private boolean |
unsavedChanges |
Constructor and Description |
---|
ObjectContainer() |
Modifier and Type | Method and Description |
---|---|
void |
addConnection(Connection connection)
Adds a new connection to the project.
|
void |
addShape(Shape shape)
Adds a shape to the project.
|
java.util.List<Connection> |
allConnections()
Returns all connections created in the project.
|
java.util.List<Cutout> |
allCutouts()
Returns all cutous created in the project.
|
java.util.List<Drawable2D> |
allDrawables()
Returns all 2D drawables in the current project.
|
java.util.List<Edge> |
allEdges()
Returns the edges of all shapes in the project.
|
java.util.List<Shape> |
allShapes()
Returns all shapes created in the current project.
|
void |
clear()
Clears all shapes, STLs and connections of the current project.
|
STLMesh |
getSTLMesh()
Returns the STL mesh with all imported STLs.
|
boolean |
hasUnsavedChanges()
Returns whether the project has unsaved changes.
|
void |
load(java.io.File theFile)
Opens an existing project from a given file.
|
void |
removeConnection(Connection connection)
Removes a connection from the project.
|
void |
removeShape(Shape shape)
Removes a shape from the project.
|
void |
save(java.io.File file)
Writes the current project into the given file.
|
private java.util.List<Drawable2D> objects
private STLMesh stlMesh
private boolean unsavedChanges
public STLMesh getSTLMesh()
public java.util.List<Drawable2D> allDrawables()
public java.util.List<Shape> allShapes()
public void addShape(Shape shape)
shape
- A new shape.public void removeShape(Shape shape)
shape
- The shape to remove.public java.util.List<Edge> allEdges()
public java.util.List<Connection> allConnections()
public void addConnection(Connection connection)
connection
- A new connection.public void removeConnection(Connection connection)
connection
- The connection to remove.public java.util.List<Cutout> allCutouts()
public void save(java.io.File file)
file
- The file to write the project into.public void load(java.io.File theFile)
theFile
- The file to open.public void clear()
public boolean hasUnsavedChanges()