I think the best place to start with, for the structure would be in Path: https://github.com/FreeCAD/FreeCAD/tree ... d/Path/App
There you basically have the "Command" object which is a basic GCODE command. then the "Path" object that is nothing more than a list of commands. Then the "PropertyPath" which creates a Path property, then the "FeaturePath" which is the actual FreeCAD object, that has a "Path" property, which can hold a Path object, which is itself a list of Commands.
All this is derived from base FreeCAD classes, so it inherits a lot of interesting abilities, such as how it must be saved to the file, structure for easy python bindings, etc.
Then the GUI to make all this is something else, but it roughly follows the same structure as above.
I think we could start with something similar:
- A base Annotation class
- A Dimension class, a Text class and a Symbol class (and possibly others in the future), all derived from the above
- An "Annotations" property, that would hold a list of Annotation-derived objects
- An Annotation Feature that has an Annotations property
- A GUI object for the AnnotationFeature, that would have an edit mode just like a sketch. You manipulate the individual Annotations through it, the same way as the sketcher works.
This is a very "visual" object, it doesn't make much sense without a GUI. So I don't think there is much sense to separate the individual properties of dimensions, texts and symbols into App and Gui counterparts... Specially that they won't be directly manipulatable outside the Annotation Feature's edit mode.
Bascially each Annotation object should:
- have a name
- have a series of attributes such as start point, end point, color, text fonts... All that is needed for each of them
- be able to render a coin version of itself
- provide a list of control points
- be able to save and restore to file
- have all its attributes manipulatable through python
The AnnotationFeature should:
- have a placement
- be able to save and restore to file by calling save/restore of each of its annotations
The ViewProvider should:
- contain a transformation node with the placement data
- be able to render a coin version of itself by gathering the coin nodes of each of its annotations
- have an edit mode
The edit mode should:
- Show a list of annotations where one can click through, delete, rename or add new
- When one clicks an annotation, all its properties should be available to edit
- When one clicks an annotation, its control points should appear in the 3D view and be draggable by the user
How does that sound?