47 #ifndef _MIRA_VISUALIZATIONVIEW_H_ 48 #define _MIRA_VISUALIZATIONVIEW_H_ 50 #include <QBasicTimer> 54 #include <serialization/adapters/std/list> 55 #include <serialization/adapters/Qt/QAction> 63 class QDragEnterEvent;
76 class VisualizationTool;
77 class VisualizationControlPage;
97 template <
typename Reflector>
101 r.member(
"Visualizations", mVisualizations,
"The assigned visualizations");
106 "Update interval in ms",
109 r.property(
"WindowTitle",
110 getter(&VisualizationView::getWindowTitle,
this),
111 setter(&VisualizationView::setWindowTitle,
this),
113 getClass().getMetaInfo(
"Name"));
115 r.member(
"HideTools",
116 getter<bool>(boost::bind(actionGetter, mHideToolBar)),
117 setter<bool>(boost::bind(actionSetter, mHideToolBar, _1)),
118 "Hide tool bar with tools",
false);
120 r.property(
"Tools", mTools,
"The used tools");
159 const std::list<Visualization*>& getVisualizations()
const;
168 const std::vector<VisualizationTool*>& getTools()
const;
188 virtual const Class& supportedVisualizationClass()
const = 0;
212 virtual QWidget* createPartControl();
214 virtual QWidget* createVisualizationPart() = 0;
216 virtual void resetView();
217 virtual void saveContentToFile();
227 virtual void update(
Duration dt) = 0;
231 void setUpdateInterval(
int interval);
232 int getUpdateInterval();
243 mOfferAuxiliaryVisualizations = on;
248 void startUpdateTimer();
250 virtual void timerEvent(QTimerEvent*);
251 bool eventFilter(QObject *obj, QEvent *event);
253 void keyPressEvent(QKeyEvent* event);
254 void keyReleaseEvent(QKeyEvent* event);
256 void focusOutEvent(QFocusEvent* event);
262 void dragEnterEventImpl(QDragEnterEvent *event);
263 void dropEventImpl(QDropEvent* event, QWidget* widget);
266 void destroyVisualizations();
270 void setToolbarArea(Qt::ToolBarArea area);
271 void addToolButton(
VisualizationTool* tool,
const QString& name,
const QString& category,
const QString& description);
282 void setWindowTitle( std::string
const& title );
283 std::string getWindowTitle()
const;
288 void onHideToolbar(
bool);
291 VisualizationControlPage* mControl;
292 std::list<Visualization*> mVisualizations;
294 std::vector<VisualizationTool*> mTools;
298 std::map<QString, VisualizationTool*> mIdToTool;
301 std::map<QString, VisualizationTool*> mCurrentTool;
304 std::map<QString, QToolButton*> mCategoryToToolButton;
307 VisualizationTool* mActiveTool;
310 VisualizationTool* mDisplacedTool;
313 QButtonGroup* mButtonGroup;
316 QBasicTimer mUpdateTimer;
318 Time mLastUpdateTime;
322 QAction* mHideToolBar;
323 QWidget* mVisualizationPart;
324 Qt::ToolBarArea mCurrentToolboxArea;
326 const QString DEFAULT_CATEGORY;
328 bool mOfferAuxiliaryVisualizations;
350 template <
typename Reflector>
354 r.property(
"Fixed Frame", mFixedFrame,
"The reference frame used to denote the world frame. Should not be moving (e.g. map frame, etc.)",
"");
355 r.property(
"Camera Frame", mCameraFrame,
357 "The frame where all other frames are transformed to for displaying the data",
TransformProperty());
375 std::string mLastAskedFixedFrame;
376 std::string mLastAskedCameraFrame;
377 QTimer* mFrameCheckTimer;
void setOfferAuxiliaryVisualizations(bool on)
Definition: VisualizationView.h:242
static Class & null()
Returns the only single existing instance of a NullClass.
Provide marker class for marking an invalid "null" class.
Definition: XMLSerializer.h:121
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Abstract base class for all derived visualizations, namely Visualization3D and Visualization2D.
Definition: Visualization.h:90
An editor is typically used to edit or browse data or objects.
Definition: EditorPart.h:69
VisualizationTool * getActiveTool()
Returns the current active tool, or NULL of no tool is active.
Definition: VisualizationView.h:237
#define MIRA_REFLECT_BASE(reflector, BaseClass)
Macro that can be used to reflect the base class easily.
Definition: ReflectorInterface.h:912
Time and Duration wrapper class.
Class object which supports some kind of class reflection.
Definition: Class.h:97
Gui export macro declaration.
Setter< T > setter(void(*f)(const T &))
Creates a Setter for global or static class methods taking the argument by const reference.
Definition: GetterSetter.h:443
std::map< std::string, std::string > const & getMetaInfo() const
Return map with meta information.
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
Use this MACRO instead of MIRA_OBJECT to declare the class as abstract.
Definition: FactoryMacros.h:235
Abstract base class for 2D, 3D, text and plot visualization views (namely Visualization2DView and Vis...
Definition: VisualizationView.h:84
void reflect(Reflector &r)
Definition: VisualizationView.h:98
MIRA_GUI_VISUALIZATION_EXPORT std::list< ClassPtr > getVisualizationsFor(const std::string &channelID, const Class &visualizationType)
Use this class to represent time durations.
Definition: Time.h:104
The object class acts as a generic base class for classes which should be used with the classFactory...
Definition: Object.h:144
virtual const Class & defaultVisualizationClass() const
If a default visualization class is provided, this class is used to instantiate a default visualizati...
Definition: VisualizationView.h:197
Getter< T > getter(T(*f)())
Creates a Getter for global or static class methods returning the result by value.
Definition: GetterSetter.h:136
void setUpdateInterval(int interval)
void reflect(Reflector &r, LogRecord &record)
Non-intrusive reflector for LogRecord.
Definition: LoggingCore.h:137
MIRA_GUI_VISUALIZATION_EXPORT std::string getChannelIDFromMimeData(const QMimeData *mimeData)
VisualizationControl page.
Definition: VisualizationControlPage.h:82
Class const & getClass() const
call the virtual internalGetClass().
Definition: Object.h:159
#define MIRA_GUI_VIEWS_EXPORT
Definition: GuiViewsExports.h:61
virtual const Class & supportedVisualizationToolClass() const
Derived visualization views may return the base class of their supported tools.
Definition: VisualizationView.h:206
Declaration of the EditorPart class.
Deserializer for serializing objects from XML format.
Definition: XMLSerializer.h:313