29 #include <unordered_map>
38 #include <Inventor/nodes/SoSeparator.h>
39 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h>
48 #include "../QtWidgets/IndexedQCheckBox.h"
49 #include "../QtWidgets/MotionPlanningServerTaskList.h"
53 #pragma GCC diagnostic push
54 #pragma GCC diagnostic ignored "-Wpedantic"
55 #include <RobotComponents/gui-plugins/MotionPlanning/ui_SimoxCSpaceVisualizerWidget.h>
56 #pragma GCC diagnostic pop
111 float dcdStep = std::numeric_limits<float>::infinity();
120 return accPathLength.back();
146 void loadSettings(QSettings* settings)
override;
151 void saveSettings(QSettings* settings)
override;
157 QString getWidgetName()
const override;
162 void onInitComponent()
override;
168 QPointer<QDialog> getConfigDialog(QWidget* parent)
override;
175 motionPlanningServerProxyName = dialog->getProxyName(
"MotionPlanningServer");
181 void onConnectComponent()
override;
185 motionPlanningServerTaskList->enableAutoUpdate(
false);
195 soSeparatorCleanUpAndRemoveFromRoot(visuAgent);
196 soSeparatorCleanUp(visuRoot);
203 SoNode* getScene()
override;
209 void setMutex3D(RecursiveMutexPtr
const& mutex3D)
override;
221 return paths.at(widget.spinBoxPathNumber->value() - 1);
231 void setCurrentPath();
235 void setCurrentPathPosition();
239 void setCurrentConfig();
240 void updateCollisionState();
243 void drawEdges(
bool drawTrace);
246 drawEdges(widget.checkBoxDrawTrace->isChecked());
256 soSeparatorRootChildVis(visuObjStat.at(
index), state == Qt::Checked);
265 soSeparatorRootChildVis(visuAgent, state == Qt::Checked);
273 void setVisibilityPath(
int index, Qt::CheckState state);
281 void traceStepChanged();
282 void toggleRobotNodePath(
int index, Qt::CheckState);
283 void updateEdgeVisibility();
284 void highlightCollisionNodes(
bool checked);
288 void loadTaskFromServer();
290 void loadTaskFromSend();
296 void soSeparatorCleanUpAndRemoveFromRoot(SoSeparator*& toRemove);
301 void soSeparatorCleanUp(SoSeparator*& toClear);
306 void soSeparatorRemoveFromRoot(SoSeparator* toRemove);
311 void soSeparatorAddToRoot(SoSeparator* toAdd);
316 void soSeparatorToggleRootChild(SoSeparator* toToggle);
318 void soSeparatorRootChildVis(SoSeparator* child,
bool visible =
true);
327 void setPaths(std::vector<Path> newPaths);
333 void setAndApplyConfig(
const VectorXf& cfg);
339 void resetSimoxCSpace();
345 widget.sliderPathPosition->setScale(0, 0);
353 void setEnabledSimoxCSpace(
bool active =
true);
355 void setEnabledPaths(
bool active =
true);
357 void timerEvent(QTimerEvent*)
override;
358 void setCurrentPathPosition(
double p);
365 Ui::SimoxCSpaceVisualizerWidget widget;
369 QPointer<SimpleConfigDialog> dialog;
371 QPointer<MotionPlanningServerTaskList> motionPlanningServerTaskList;
374 std::string motionPlanningServerProxyName;
375 MotionPlanningServerInterfacePrx motionPlanningServerProxy;
385 SoSeparator* visuRoot;
398 std::vector<SoSeparator*> visuObjStat;
399 SoSeparator* visuAgent =
nullptr;
402 std::vector<PathData> paths;
406 std::vector<std::pair<VirtualRobot::RobotNodePtr, bool>> robotNodes;
407 QTimer updateCollisionStateTimer;
408 const long timerPeriod