42 HULL_POINTS_FROM_CSO_LIST
65 struct LabelBoundingBox
102 void computeDeviceConvexHullOfAllVisibleCSOs(
const std::vector<CSODrawCSOInfos>&
drawCSOInfos,
103 boost::geometry::model::polygon<Point2D>&
convexHull);
104 void computeCSODevicePositions(
const std::vector<CSODrawCSOInfos>&
drawCSOInfos,
106 bool seedPointIsOnSlice(CSO* cso,
int index,
const CSODrawView2DInfos& view2DInfos)
const;
109 boost::geometry::model::polygon<Point2D>&
convexHull)
const;
113 static float computeMaxDistanceOfConvexHullFromCentroid(
const boost::geometry::model::polygon<Point2D>&
convexHull,
117 static void computeLabelSlotPositions(
const boost::geometry::model::polygon<Point2D>&
convexHull,
121 std::vector<std::pair<int, int>> computeNearestCSOForLabelPositionSlot(
const std::vector<Point2D>&
labelSlotPositions,
122 const std::vector<unsigned int>& csoIds);
124 const std::vector<unsigned int>& csoIds,
128 void setLabelPositionsForCSOs(
const std::vector<std::pair<int, int>>&
csoToSlotMapping,
129 const std::vector<unsigned int>& csoIds,
const std::map<int, SbVec2f>&
labelBoxes,
131 static SbVec2f getLabelBoxForCSO(
const std::map<int, SbVec2f>&
labelBoxes,
int csoId);
134 void avoidLabelOverlap(
const std::map<int, SbVec2f>&
labelBoxes);
136 void setupLabelBoundingBoxes(
const std::map<int, SbVec2f>&
labelBoxes,
138 static bool boundingBoxHasOverlap(
int csoId,
const LabelBoundingBox&
labelBoundingBox,
142 std::map<unsigned int, Point2D> _labelPositions;
143 std::map<unsigned int, std::vector<Point2D>> _csoDevicePositions;
146 Point2D _centroidOfConvexHull;
void layoutVisibleCSOs(const std::vector< CSODrawCSOInfos > &drawCSOInfos, const std::map< int, SbVec2f > &labelBoxes, const CSODrawView2DInfos &view2DInfos, SoCSOLabelRenderer *labelRenderer) override
void getAttachedLabelPosition(const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, int labelWidth, int labelHeight, float &deviceX, float &deviceY) override
Fills up the device position for an attached label.