Skip to content

Releases: ABRG-Models/morphologica

The pre-Qt release

17 Aug 10:58
e5dc9f7
Compare
Choose a tag to compare

This release rolls up all the new features introduced since the unique_ptr release. I'm making this release to mark the fact that the boilerplate for creating and using VisualModels is changing once again in the next release.

The unique_ptr release

10 Feb 11:15
c63e3f4
Compare
Choose a tag to compare

This release has a significant improvement to the way in which morph::VisualModel memory is managed within a morph::Visual scene. Previously, you used the new keyword to allocate memory for each VisualModel, then you had to trust that the morphologica Visual object would deallocate that memory as it went out of scope. This scheme is retained, but made explicit now by the use of std::unique_ptr.

If you have a morph::Visual scene like this:

morph::Visual v (1600, 1000, "Example scene");

Where you would previously have added a morph::VisualModel by writing (using GraphVisual as an example of a VisualModel):

morph::GraphVisual<double>* gptr = new morph::GraphVisual<double> (v.shaderprog, v.tshaderprog, morph::vec<float>({0,0,0}));

You now write the slightly neater:

auto g_uptr = std::make_unique<morph::GraphVisual<double>> (v.shaders, morph::vec<float>({0,0,0}));

this returns an object of type std::unique_ptr<GraphVisual<double>>. You then add this to the morph::Visual like before:

auto gptr = v.addVisualModel (g_uptr);

where gptr is of type morph::GraphVisual<double>*. The key thing is that by adding the unique_ptr into the Visual scene, v, 'v takes ownership of the memory of the GraphVisual object, but you can go on interacting with the GraphVisual object by using the non-owning pointer, gptr. Note also that the boilerplate v.shaderprog and v.tshaderprog ID values have been collected into the single object v.shaders.

In this release, there has also been some refactoring, significantly of morph::Vector -> morph::vec and morph::vVector -> morph::vvec. These mathematical vector classes also have some nice new functionality, such as 1D convolutions, smoothing and differentiation.

The first release

30 Jul 09:05
f9e0d80
Compare
Choose a tag to compare

morphologica has been stable for a while, so it's time for a release for download!