24 #include <RobotAPI/gui-plugins/ArViz/ui_ArVizWidget.h>
27 #include <RobotAPI/interface/ArViz/Component.h>
33 #include <ArmarXCore/interface/observers/ObserverInterface.h>
50 struct ArVizWidgetBatchCallback;
85 void loadSettings(QSettings* settings)
override;
86 void saveSettings(QSettings* settings)
override;
88 QPointer<QDialog> getConfigDialog(QWidget* parent)
override;
89 void configured()
override;
91 SoNode* getScene()
override;
96 return "Visualization.ArViz";
100 void onInitComponent()
override;
101 void onExitComponent()
override;
103 void onConnectComponent()
override;
104 void onDisconnectComponent()
override;
106 void onGetBatchAsync(viz::data::RecordingBatch
const& batch);
116 void disconnectGui();
122 void onDisconnectGui();
124 void layersChanged(std::vector<viz::CoinLayerID>
const& layers);
125 void layerTreeChanged(QTreeWidgetItem* item,
int column);
126 void updateSelectedLayer(QTreeWidgetItem* current, QTreeWidgetItem* previous);
128 void onCollapseAll(
bool);
129 void onExpandAll(
bool);
131 void onHideAll(
bool);
132 void onShowAll(
bool);
133 void onHideFiltered(
bool);
134 void onShowFiltered(
bool);
136 void onFilterTextChanged(QString
const& filter);
138 void showAllLayers(
bool visible);
139 void showFilteredLayers(
bool visible);
141 void onDeselectElement();
142 void onContextMenuClicked();
143 void onInteractiveElementSelected(QListWidgetItem* item);
146 void onTimingObserverUpdate();
151 void onStartRecording();
152 void onStopRecording();
154 void onRefreshRecordings();
155 void onRecordingSelectionChanged(QListWidgetItem* current, QListWidgetItem* previous);
157 void onReplaySpinChanged(
int newValue);
158 void onReplaySliderChanged(
int newValue);
160 void selectRecording(viz::data::Recording
const& recording);
162 void onReplayStart(
bool);
163 void onReplayStop(
bool);
164 long replayToRevision(
long revision);
165 long getRevisionForTimestamp(
long timestamp);
166 void onReplayTimedStart(
bool checked);
167 void onReplayTimerTick();
171 void enableWidgetAccordingToMode();
176 Ui::ArVizWidget widget;
178 QPointer<SimpleConfigDialog> configDialog;
185 long replayCurrentTimestamp = 0;
186 long lastReplayRealTime = 0;
188 std::string storageName;
189 armarx::viz::StorageInterfacePrx storage;
190 std::string debugObserverName;
196 viz::data::RecordingSeq allRecordings;
199 viz::data::Recording currentRecording;
200 long currentRevision = -1;
201 long currentTimestamp = -1;
202 bool currentRecordingSelected =
false;
205 struct TimestampedRecordingBatch
208 viz::data::RecordingBatch
data;
211 viz::data::RecordingBatch
const& getRecordingBatch(
long index);
212 void limitRecordingBatchCacheSize();
214 std::size_t recordingBatchCacheMaxSize = 5;
215 std::mutex recordingBatchCacheMutex;
216 std::atomic<long> recordingWaitingForBatchIndex = -1;
217 std::map<long, TimestampedRecordingBatch> recordingBatchCache;
222 armarx::viz::Callback_StorageInterface_getRecordingBatchPtr callback;
223 Ice::AsyncResultPtr callbackResult;
225 std::vector<double> timings;
230 return QIcon(
":icons/ArViz.png");