roviz  0.7
Code Documentation of roviz
sparse.h
1 #ifndef SPARSE_H
2 #define SPARSE_H
3 
4 #include <memory>
5 #include <vector>
6 #include <list>
7 #include "streams/stream_object.h"
8 #include "streams/sparse_p.h"
9 #include "streams/image.h"
10 #include "streams/sparse_types.h"
11 #include "core/template_decl.h"
12 
13 class OutputPrivate;
14 class StreamWidget;
15 
16 #if ROVIZ_BACKEND == ROVIZ_BACKEND_Dev
17 #include <QColor>
18 
19 #define POINT_RECT_SIZE 4
20 #define SPARSE_LINE_WIDTH 1
21 
22 // If we do this within Sparse<T>, it will get instantiated multiple times
23 extern const QColor SparseColor[10];
24 #endif
25 
26 template<class T> class SparsePrivate;
27 
28 template<class T>
29 class ROVIZ_EXPORT Sparse : public StreamObject
30 {
31 public:
32  Sparse(Image base_image = Image(), std::initializer_list<SourceID> sources = {});
33  Sparse(const StreamObject &base);
34  void add(const T &obj);
35  void add(const std::list<T> &objs);
36  void add(const std::vector<T> &objs);
37  std::size_t size(void);
38  const T &at(unsigned int index);
39  const T &operator[](unsigned int index);
40  Image baseImage(void);
41  typename std::vector<T>::const_iterator begin(void) const;
42  typename std::vector<T>::const_iterator end(void) const;
43 
44 protected:
45  SparsePrivate<T> *_this;
46 
47 // Handle the displaying of the image
48 #if ROVIZ_BACKEND == ROVIZ_BACKEND_Dev
49 public:
57  static StreamWidget *initWidget(OutputPrivate *out);
58 #endif
59 };
60 
61 DO_FOR_ALL_SPARSE(DECLARE_STREAM_OBJECT)
62 DO_FOR_ALL_SPARSE_TEMPLATES(DECLARE_STREAM_OBJECT)
63 
64 #endif // SPARSE_H
Base class of all objects that can be transported with a stream.
Definition: stream_object.h:39
Base class for all widgets representing a StreamObject.
Definition: stream_widget.h:14
Definition: template_decl.h:10
Definition: sparse.h:26
Private part of the Ouput class.
Definition: output_p.h:16
A portable image class with smart memory management.
Definition: image.h:35