|
Re: GEF5 MVC Draw polygon [message #1785410 is a reply to message #1780274] |
Fri, 13 April 2018 14:01 |
|
Hi Kyle,
yes you do need a model representation for your polygon.
W.r.t. the visualisation, you can have a part that specifies JavaFX Group as its visual to be able to put any visuals in there. Apart from that, you could also use GeometryNode<IGeometry> or Path, i.e. you have some options for the visual.
You will need to implement a couple of handlers for the interaction, e.g. AddPolygonPointOnClickHandler. I would suggest that your model object allows any number of points, so that you can create the model object with the initial click and just trust the synchronisation for creating the corresponding content part.
W.r.t. restricting the polygons to be simple, you can check for intersections between the polygon sides. The GEF Geometry API is capable of doing so, e.g. firstSegment.getIntersections(secondSegment) returns an array of points of intersection.
h2h
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.03391 seconds