Free Electron
DrawVectorField.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __misc_DrawVectorField_h__
8 #define __misc_DrawVectorField_h__
9 
10 #include "signal/signal.h"
11 #include "draw/draw.h"
12 #include "window/window.h"
13 #include "shape/shape.h"
14 #include "spatial/spatial.h"
15 #include "viewer/DrawView.h"
16 #include "misc/misc.h"
17 
18 namespace fe
19 {
20 
21 /** draw a vector field
22 
23  @copydoc DrawVectorField_info
24  */
25 class FE_DL_EXPORT DrawVectorField :
26  public Initialize<DrawVectorField>,
27  virtual public HandlerI,
28  virtual public Dispatch
29 {
30  public:
31  DrawVectorField(void);
32 virtual ~DrawVectorField(void);
33 
34  void initialize(void);
35 
36  // AS HandlerI
37 virtual void handleBind(sp<SignalerI> spSignalerI,
38  sp<Layout> l_sig);
39 virtual void handle(Record &r_sig);
40 
41  // AS DispatchI
42 virtual bool call(const String &a_name, std::vector<Instance> a_argv);
43 
44  typedef enum
45  {
46  e_none = 0,
47  e_line = 1<<0,
48  e_sphere = 1<<1,
49  e_rod = 1<<2,
50  e_cone = 1<<3
51  } t_mode;
52 
53  void setMode(unsigned int a_mode);
54 
55  private:
56  void setColors(sp<RecordGroup> a_winGroup);
57  void draw(sp<DrawI> spDraw, sp<VectorFieldI> spField);
58 
59  PathAccessor<sp<Component> > m_aVectorField;
60  DrawView m_drawview;
61  AsColor m_asColor;
62  unsigned int m_mode;
63  Color m_color;
64 };
65 
66 } /* namespace */
67 
68 #endif /* __misc_DrawVectorField_h__ */
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Special vector for color (RGBA)
Definition: Color.h:21
draw a vector field
Definition: DrawVectorField.h:25
Automatically reference-counted string container.
Definition: String.h:128
Reference to an instance of a Layout.
Definition: RecordSB.h:35