Page MenuHomePhabricator

Refactoring of datastructures used by PlanarFigures
Closed, ResolvedPublic

Description

PlanarFigures basically consist of a set of controlpoints and one or more polylines that describe how to visualize these controlpoints.

Unfortunately, itk::VectorContainer are used to store these points. Even more unfortunate is that this datastructure does not support removing elements from the container.
Thus it is not possible to remove a single control point from a polygon.

In order to fix this, itk::VectorContainer shall be replaced.
From now on, the controlpoints shall be stored in a std::deque (basically a std::list with an 'at()' method ). Thus it is possible to easily iterate over all control points, get one with a certain index and insert and remove elements easily.

For the polylines, a struct will be introduced that contains the Point2D and the index of the control point that starts the line-segment this Point2D belongs to.
All structs that belong to a polyline will be stored in a std::list as we do not need the access to defined indecies.

itk::VectorContainer also offers a ModifiedTime that is used to determine if the polyline has to be rebuild. This can be replaced by a bool flag. However,this means that the editing of the controlpoints may be done in the PlanarFigureClass only. Thus a thin interface is needed to grant limited access to subclasses, mappers and interactors.

Related Objects

Event Timeline

[cad773]: Merge branch 'bug-7538-planarFigure-controlpoint-refactoring'

  • bug-7

Merged commits:

2011-04-05 18:20:21 Markus Engel [ed0a8a]
cleanup after refactoring


2011-04-05 17:41:32 Markus Engel [588387]
adapting planarFigureInteractor to new points containers


2011-04-05 17:23:19 Markus Engel [ec43d4]
fixing crash when moving center control point


2011-04-05 17:19:49 Markus Engel [296c6e]
adapting PlanarFourPointAngle to new point containers


2011-04-05 17:01:14 Markus Engel [fe20aa]
adapting PlanarRectangle to new point containers


2011-04-05 17:00:54 Markus Engel [5fc0be]
adding error-messages if womething went wrong with the indeces


2011-04-05 16:25:03 Markus Engel [77415b]
adapting PlanarArrow to new point containers


2011-04-05 16:24:30 Markus Engel [08b072]
adapting PlanarAngle to new point containers


2011-04-05 16:13:39 Markus Engel [fc4f35]
adapting tests to new point containers


2011-04-05 16:13:01 Markus Engel [462305]
adapting PlanarFigureWriter to new point containers


2011-04-05 16:10:42 Markus Engel [8a8725]
Adapting PlanarCirlce to new point containers


2011-04-05 16:10:06 Markus Engel [90947e]
adapting PlanarPolygon to new point containers


2011-04-05 16:09:08 Markus Engel [3b5f49]
clearing contaienrs before recreating polylines


2011-04-05 16:08:39 Markus Engel [0b813c]
finalized refactoring of planarFigures & the control point containers


2011-04-01 13:01:28 Markus Engel [06d51e]
adapted classes to new datatypes used in planarFigures


2011-04-01 13:00:34 Markus Engel [29b756]
adapted PlanarFigureMapper and Interactor to new datatypes


2011-04-01 12:57:24 Markus Engel [3e4233]
adapted subclasses of planarfigure to new datatypes


2011-04-01 12:56:52 Markus Engel [f16e5f]
extended refactoring of datatypes used in planarFigures


2011-03-31 14:33:54 Markus Engel [40b654]
started refactoring of controlpoints in PlanarFigure

[06ef5e]: Merge branch 'bug-7538-planarFigure-controlpoint-refactoring'

  • bug-7

Merged commits:

2011-04-06 08:44:20 Markus Engel [7d5756]
fixing compile errors on linux dartclients

Refactoring has been finished. Containers for control-points, polylines and helperpolylines have been replaced as described in comment 1.

PolyLines and HelperPolyLines are stored in a std::list and the control points are stored in a std::Deque.

All containers shall be accessed using the public methods provided by mitkPlanarFigure only.