24 #include <unordered_set>
27 #include <ArmarXCore/interface/observers/ObserverInterface.h>
34 #include <RobotAPI/gui-plugins/ArViz/ui_ArVizWidget.h>
35 #include <RobotAPI/interface/ArViz/Component.h>
51 struct ArVizWidgetBatchCallback;
83 void loadSettings(QSettings* settings)
override;
84 void saveSettings(QSettings* settings)
override;
86 QPointer<QDialog> getConfigDialog(QWidget* parent)
override;
87 void configured()
override;
89 SoNode* getScene()
override;
95 return "Visualization.ArViz";
99 void onInitComponent()
override;
100 void onExitComponent()
override;
102 void onConnectComponent()
override;
103 void onDisconnectComponent()
override;
105 void onGetBatchAsync(viz::data::RecordingBatch
const& batch);
111 void updateLayersFromProfile();
117 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();
175 Ui::ArVizWidget widget;
177 QPointer<SimpleConfigDialog> configDialog;
184 long replayCurrentTimestamp = 0;
185 long lastReplayRealTime = 0;
187 std::string storageName;
188 armarx::viz::StorageInterfacePrx storage;
189 std::string debugObserverName;
195 viz::data::RecordingSeq allRecordings;
198 viz::data::Recording currentRecording;
199 long currentRevision = -1;
200 long currentTimestamp = -1;
201 bool currentRecordingSelected =
false;
204 struct TimestampedRecordingBatch
207 viz::data::RecordingBatch
data;
210 viz::data::RecordingBatch
const& getRecordingBatch(
long index);
211 void limitRecordingBatchCacheSize();
213 std::size_t recordingBatchCacheMaxSize = 5;
214 std::mutex recordingBatchCacheMutex;
215 std::atomic<long> recordingWaitingForBatchIndex = -1;
216 std::map<long, TimestampedRecordingBatch> recordingBatchCache;
221 armarx::viz::Callback_StorageInterface_getRecordingBatchPtr callback;
222 Ice::AsyncResultPtr callbackResult;
224 std::vector<double> timings;
226 ArvizProfileManagerWidget* arvizeProfileLayerWidget;
232 return QIcon(
":icons/ArViz.png");