OpenDAFF C++ API  v1.7
Directional Audio File Format
DAFFVizLabel.h
Go to the documentation of this file.
1 /*
2  * -------------------------------------------------------------------------------------
3  *
4  * OpenDAFF - A free, open source software package for directional audio data
5  * Copyright 2016 Institute of Technical Acoustics, RWTH Aachen University
6  * OpenDAFF is distributed under the Apache License Version 2.0
7  *
8  * ------------------------------------------------------------------------------------
9  *
10  */
11 #ifndef IW_DAFF_LABEL
12 #define IW_DAFF_LABEL
13 
14 #include <daffviz/DAFFVizSGNode.h>
15 
16 #include <string>
17 
18 // Forward declarations
19 class vtkActor;
20 class vtkCamera;
21 class vtkFollower;
22 class vtkPolyDataMapper;
23 class vtkVectorText;
24 
25 namespace DAFFViz
26 {
27 
29 
34  {
35  public:
36  Label();
37  Label( SGNode* pNode );
38  Label( SGNode* pNode, std::string sText );
39  ~Label();
40 
41 
42  // --= general methods =--
43 
45  void GetColor( double& r, double& g, double& b ) const;
46 
48  void SetColor( double r, double g, double b );
49 
51  double GetAlpha() const;
52 
54  void SetAlpha( double a );
55 
57  bool IsVisible() const;
58 
60  void SetVisible( bool bVisible );
61 
62 
63  // --= object related methods =--
64 
66  void SetText( const std::string& sText );
67 
69  std::string GetText() const;
70 
71  private:
72  vtkSmartPointer< vtkVectorText > m_pLabelText;
73  vtkSmartPointer< vtkPolyDataMapper > m_pMapper;
74  vtkSmartPointer< vtkFollower > m_pFollower;
75  vtkSmartPointer< vtkActor > m_pActor;
76 
77  std::string m_sText;
78 
79  // The initializer generates dynamic objects like source, mapper, actor ...
80  void init();
81 
82  // --= object related methods =--
83 
84  virtual void OnSetFollowerCamera( vtkSmartPointer< vtkCamera > pCamera );
85 
86  friend class Frame;
87  };
88 
89 } // End of namespace "DAFFViz"
90 
91 #endif // IW_DAFF_LABEL
#define DAFF_API
Definition: DAFFDefs.h:29
Simple arrow object node.
Definition: DAFFVizLabel.h:33
Base class for scene graph nodes.
Definition: DAFFVizSGNode.h:67
OpenDAFF is a project from the Institute of Technical Acoustics, RWTH Aachen University, Germany.