... | ... | @@ -441,16 +441,58 @@ public: |
|
|
// Output file extension
|
|
|
virtual std::string extension() const = 0;
|
|
|
|
|
|
/// TODO!!!!
|
|
|
/// \brief Implement this function to return the machine code writer's implementation of the IMachineCodeInterface interface
|
|
|
virtual std::unique_ptr<IMachineCodeInterface> createMachineCode(
|
|
|
std::unique_ptr<const ILayerSet> layers,
|
|
|
const EnumerableSettingsInterface* settings,
|
|
|
const std::set<int>& used_brushes) = 0;
|
|
|
// Creates and returns an Machinde Code Interface
|
|
|
IMachineCodeInterface interface virtual std::unique_ptr<IMachineCodeInterface> createMachineCode(
|
|
|
std::unique_ptr<const ILayerSet> layers, // Layers resulting from the slicing process
|
|
|
const EnumerableSettingsInterface* settings, // Interface to printing settings
|
|
|
const std::set<int>& used_brushes // Brushes used before slicing
|
|
|
) = 0;
|
|
|
};
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```c++
|
|
|
namespace IceSLInterface
|
|
|
{
|
|
|
class IMachineCodeInterface
|
|
|
{
|
|
|
public:
|
|
|
|
|
|
IMachineCodeInterface(
|
|
|
std::unique_ptr<const ILayerSet> layers, // Layers resulting from the slicing process
|
|
|
const EnumerableSettingsInterface* settings, // Interface to printing settings
|
|
|
const std::set<int>& used_brushes // Brushes used before slicing
|
|
|
) : m_LayerSet(std::move(layers)), m_EnumerableSettings(settings)
|
|
|
|
|
|
virtual ~IMachineCodeInterface() = default;
|
|
|
|
|
|
// Called before Machine Code production starts.
|
|
|
virtual bool startWriting(
|
|
|
const std::string& filename // Output filename/directory
|
|
|
) = 0;
|
|
|
|
|
|
// Perform Machine code production in incremental steps. Return 'false' when done and 'true' otherwise.
|
|
|
virtual bool stepWriting() = 0;
|
|
|
|
|
|
// Call when aborting the Machine Code production process (e.g., perform error handling).
|
|
|
virtual void abortWriting() = 0;
|
|
|
|
|
|
// Called to query the Machine Code production progress. Return value should be in the [0-1] interval.
|
|
|
virtual float writingProgress() const = 0;
|
|
|
|
|
|
protected:
|
|
|
// Layers resulting from the slicing process
|
|
|
std::unique_ptr<const ILayerSet> m_LayerSet;
|
|
|
|
|
|
// Use this interface to access or add printing settings as well as query
|
|
|
// the number of brushes or extruders (where applicable)
|
|
|
const EnumerableSettingsInterface* m_EnumerableSettings;
|
|
|
};
|
|
|
}
|
|
|
```
|
|
|
|
|
|
Intuitively, IceSL preemptively calls 'startWriting' before proceeding with 'stepWriting' until it signals it's done by returning 'false' all the while querying the progress by calling 'writingProgress'.
|
|
|
|
|
|
### Interface Structures <a name="structures"></a>
|
|
|
|
|
|
IPath, ILayer, ILayerSet |
|
|
\ No newline at end of file |
|
|
IceSL elies on data structures to pass information to plugins about deposition trajectories and sliced layers. There are three classes; `IPath`, `ILayer` and `ILayerSe`. |
|
|
\ No newline at end of file |