Open flurmbo opened 6 years ago
@flurmbo there is an object labelledData which contains all the detail of shape, points, and images. What you need is particular id to get the detail. When you need metadata of a shape or to store it you can directly interact with labelledData. I hope, it can answer your question.
Though you've done the good job to do the changes but I believe some of the changes may introduce the bugs. I'll really appreciate it recheck your changes and test the application.
Hi @amitguptagwl, thanks for your prompt reply! I think you mean labellingData? If so, I did use that. In the function getMetadata(), I call getShape() which interacts with the labellingData array.
What I don't understand is why the objects returned from labellingData contain the metadata while the objects in selectedElements do not. So perhaps a more intuitive solution than my pull request would be to go in and change how selectedElements is set.
As I said previously, labellingData contains all the detail. When a user copies the shapes from one image, this action should basically capture the shape detail from the workarea and paste the same on other image. Hence it doesn't have metadata. Now as we want to copy the metadata as well, there are 2 solutions I can see;
Purpose / Goal
Implements #115. Copies category, label, feature point labels, clones attribute and tag arrays and then stores them as properties of a metadata object passed into attachShapeToImg.
This might not be the cleanest implementation. I think it would be better if the shapes in the selectedElements array already had a copy of the metadata, but I wasn't sure how to do that. I am also not completely sure what the difference between shape and getShape(shape.node.id) is.
This implementation seems to work though so thought I would make a pull request anyways to see what others think.
Type
Please mention the type of PR
Note : Please ensure that you've read contribution guidelines before raising this PR.