Пример #1
0
void GraphicalRobotElement::updateHFOVRect() {
	QPolygonF poly;

	if (this->currentWIM.has_myposition() ) {
		for (int i = 0; i < currentObsm.view_limit_points_size(); i++) {
			const PointObject p = currentObsm.view_limit_points (i);
			QLineF l = this->parentScene->lineFromFCA (
			               this->currentWIM.myposition().x() * 1000,
			               this->currentWIM.myposition().y() * 1000,
			               this->currentWIM.myposition().phi() + p.bearing(),
			               p.distance() * 1000);
			poly << l.p2();
			HFOVLines->setPolygon (poly);
		}
	} else {
		HFOVLines->setPolygon (QPolygon() );
	}
}