What is the order of the panel ids inside a frame slice?

Started by Revolt

Revolt

I assumed that the first panel id in that array represents the topmost panel in the respective slice, but it looks like it's not. Is it related to rotation? I didn't understand that part very well, but nevertheless, the "layoutData->globalOrientation" is "0" so it shouldn't influence it, right?

Aliakbar Eski

They are not sorted in any specific order. You can assume it to be random.
They can be sorted in whichever way you require within the frame slice itself

Aliakbar Eski

That should be fairly simple.

Once you get the layout, you could do the following steps:

  1. Rotate the layout by the rotation specified in LayoutData::globalOrientation
  2. Get the frameSlices
  3. sort the panels in the 3rd frame slice with the sorting key as the y position of the centroid of the triangles. You could use std::sort and provide a comparator function that takes in the two ids of the panels being compared, looks up the value of the Y position of the centroid of the two triangles and sorts according to that.

Hope this helps

Regards

Revolt

Is there another way to get the centroid except iterating over the "panels" array of the "layoutData", getting the "shape" of each panel and then the "centroid" of each shape?