kapstok / NHL-DePa2 (public) (License: Unspecified) (since 2018-11-09) (hash sha1)
Design Patterns school project; a GUI using multiple Design Patterns.

/README.md (b38bb0df174610a7196bdee07d03765dda9cf9b4) (1371 bytes) (mode 100644) (type blob)

# NHL-DPainter

This repo is a school project for Design Patterns.

use 'dub' to compile and run the code.

# Useful draw functions for `Context` type

- `fill()`: fill path, then forget path.

- `fillPreserve()`: fill path, retain path.

- `fillExtends()`, `strokeExtends()` & `pathExtends()`: return corners
(whatever that may be).

- `stroke()`: draw line on path, then forget path.

- `strokePreserve()`: should be obvious.

- `moveTo()`: Move/Pan path.

- `scale()`: Scale path.

- `newPath()`: Clear path from context.

- `showText()`: Write text with Cairo.

# Entities

`Shapes` are stored in a `Command`. Each `Command` is saved in `History`.

`Groups` are stored in `Global.groups`.

The rendering of `Entities` is done through `History`. First are
all `Commands` rendered with a `foreach`-loop. Then all `Groups`
in `Global.groups` are rendered with a `foreach`-loop.

If a `Shape` is added to a `Group`, The `Shape` is unable to save itself
anymore. From that point, `Group` has the task to save itself, including
all it's members. The ability to save is determined by the `saveable`
variable.

# Roadmap

- Delete group? Hoe?

- Grafische indicatie van een groep. De groepen worden wel goed weergegeven,
maar subgroepen niet.

- Groups worden nog niet goed geladen: ze verliezen hun kleurtje.

- Decorator moet nog 'group' en 'active' correct implementeren.


Mode Type Size Ref File
100644 blob 247 e3a425337e7facc62ee7ed7a3c2a74025b98969c .gitignore
100644 blob 1371 b38bb0df174610a7196bdee07d03765dda9cf9b4 README.md
100644 blob 223 d998cf4e28f9bf19ccee8066e0840ab0ee01484d dub.json
100644 blob 60 979754a49248a51ccdc87ce475bb25294d51f4d8 dub.selections.json
100644 blob 105 6b9604040e718d320720638e0542d6c5e770e41c example.sav
040000 tree - b549ef536c77386a13cbbe856f39d5d75f9627ae source
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/kapstok/NHL-DePa2

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/kapstok/NHL-DePa2

Clone this repository using git:
git clone git://git.rocketgit.com/user/kapstok/NHL-DePa2

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main