VR-Vantage API Documentation
DtVisualizerAttribute.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
7 #pragma once
8 
9 #include <vrvCore/vrvCore.h>
10 #include <vrvUtil/DtUnicode.h>
11 
12 #include <boost/tuple/tuple.hpp>
13 
14 #include <matrix/vlVector.h>
15 
16 #include <string>
17 #include <map>
18 #include <vector>
19 
20 namespace makVrv
21 {
25  {
26  public:
27 
29  virtual ~DtVisualizerAttribute();
30 
31  //Type info struct.
32  struct TypeInfo
33  {
34  TypeInfo(const std::string& name)
35  : className(name)
36  {
37  }
38 
39  std::string className;
40  };
41 
43  virtual DtVisualizerAttribute* clone() const = 0;
44 
46  virtual const TypeInfo& typeInfo() const = 0;
47 
49  virtual DtUnicode getString() const = 0;
50 
52  virtual void setString(const DtUnicode& value) = 0;
53  };
54 
58  {
59  public:
61  DtVisualizerAttributeBool(bool value = false);
62 
65 
67  virtual const TypeInfo& typeInfo() const;
68 
70  static const TypeInfo& theTypeInfo();
71 
74  virtual DtUnicode getString() const;
75 
79  virtual void setString(const DtUnicode& value);
80 
82  virtual bool value() const;
83 
85  virtual void setValue(bool value);
86 
90  virtual DtVisualizerAttribute* clone() const;
91 
92  protected:
93  bool myValue;
94  };
95 
100  {
101  public:
102  typedef std::vector<DtUnicode> StringVector;
103 
106 
109 
111  virtual const TypeInfo& typeInfo() const;
112 
114  static const TypeInfo& theTypeInfo();
115 
118  virtual DtUnicode getString() const;
119 
123  virtual void setString(const DtUnicode& value);
124 
126  virtual const StringVector& value() const
127  {
128  return myValue;
129  }
130 
131  inline bool findAndReplace(const DtUnicode& orig, const DtUnicode newValue)
132  {
133  bool found = false;
134  StringVector::iterator i = myValue.begin();
135  StringVector::iterator e = myValue.end();
136  for(; i != e; ++i)
137  {
138  if(*i == orig)
139  {
140  *i = newValue;
141  found = true;
142  }
143  }
144  return found;
145  }
146 
148  virtual void setValue(const StringVector& value);
149 
153  virtual DtVisualizerAttribute* clone() const;
154 
155  protected:
157  };
158 
159 
163  public DtVisualizerAttribute
164  {
165  public:
168 
170  virtual const TypeInfo& typeInfo() const;
171 
173  static const TypeInfo& theTypeInfo();
174 
177  virtual DtUnicode getString() const;
178 
182  virtual void setString(const DtUnicode& value);
183 
185  virtual DtUnicode value() const;
186 
188  virtual void setValue(const DtUnicode& value);
189 
193  virtual DtVisualizerAttribute* clone() const;
194 
195  protected:
197  };
198 
199 
204  {
205  public:
208 
210  virtual const TypeInfo& typeInfo() const;
211 
213  static const TypeInfo& theTypeInfo();
214  };
215 
216 
221  public DtVisualizerAttribute
222  {
223  public:
226 
228  virtual const TypeInfo& typeInfo() const;
229 
231  static const TypeInfo& theTypeInfo();
232 
235  virtual DtUnicode getString() const;
236 
240  virtual void setString(const DtUnicode& value);
241 
243  virtual DtUnicode value() const;
244 
246  virtual void setValue(const DtUnicode& value);
247 
251  virtual DtVisualizerAttribute* clone() const;
252 
253  protected:
255  };
256 
257 
261  public DtVisualizerAttribute
262  {
263  public:
265  DtVisualizerAttributeInteger(int value = 0);
266 
269 
271  virtual const TypeInfo& typeInfo() const;
272 
274  static const TypeInfo& theTypeInfo();
275 
278  virtual DtUnicode getString() const;
279 
283  virtual void setString(const DtUnicode& value);
284 
286  virtual int value() const;
287 
289  virtual void setValue(int value);
290 
294  virtual DtVisualizerAttribute* clone() const;
295 
296  protected:
297  int myValue;
298  };
299 
303  public DtVisualizerAttribute
304  {
305  public:
306  // FontGlyphs are represented as unsigned ints:
307  typedef unsigned int FontGlyph;
308 
311 
314 
316  virtual const TypeInfo& typeInfo() const;
317 
319  static const TypeInfo& theTypeInfo();
320 
323  virtual DtUnicode getString() const;
324 
328  virtual void setString(const DtUnicode& value);
329 
331  virtual FontGlyph value() const;
332 
334  virtual void setValue(FontGlyph value);
335 
339  virtual DtVisualizerAttribute* clone() const;
340 
341  protected:
343  };
344 
348  public DtVisualizerAttribute
349  {
350  public:
351  // Selected symbols are represented as a map between integer and string:
352  typedef std::map<int, DtUnicode> ImageSymbolMap;
353 
356 
358  virtual const TypeInfo& typeInfo() const;
359 
361  static const TypeInfo& theTypeInfo();
362 
365  virtual DtUnicode getString() const;
366 
370  virtual void setString(const DtUnicode& value);
371 
373  virtual const ImageSymbolMap& value() const;
374 
376  virtual void setValue(ImageSymbolMap value);
377 
381  virtual DtVisualizerAttribute* clone() const;
382 
383  protected:
385  };
386 
390  public DtVisualizerAttribute
391  {
392  public:
394  DtVisualizerAttributeFloat(float value = 0.0f);
395 
398 
400  virtual const TypeInfo& typeInfo() const;
401 
403  static const TypeInfo& theTypeInfo();
404 
407  virtual DtUnicode getString() const;
408 
412  virtual void setString(const DtUnicode& value);
413 
415  virtual float value() const;
416 
418  virtual void setValue(float value);
419 
423  virtual DtVisualizerAttribute* clone() const;
424 
425  protected:
426  float myValue;
427  };
428 
431  {
432  public:
435 
437  virtual const TypeInfo& typeInfo() const;
438 
440  static const TypeInfo& theTypeInfo();
441 
444  virtual DtUnicode getString() const;
445 
449  virtual void setString(const DtUnicode& value);
450 
452  virtual DtUnicode value() const;
453 
455  virtual void setValue(const DtUnicode& value);
456 
460  virtual DtVisualizerAttribute* clone() const;
461 
462  protected:
464  };
465 
469  {
470  public:
471  // Colors are represented as boost 4-tuples of RGBA values (in that order)
472  typedef boost::tuple<unsigned int, unsigned int, unsigned int,
473  unsigned int> RGBAColor;
474 
477 
480 
482  virtual const TypeInfo& typeInfo() const;
483 
485  static const TypeInfo& theTypeInfo();
486 
489  virtual DtUnicode getString() const;
490 
494  virtual void setString(const DtUnicode& value);
495 
497  virtual RGBAColor value() const;
498 
500  virtual void setValue(RGBAColor value);
501 
505  virtual DtVisualizerAttribute* clone() const;
506 
507  protected:
509  };
510 
514  public DtVisualizerAttribute
515  {
516  public:
518  DtVisualizerAttributePoint3D(const DtVector& value = DtVector());
519 
522 
524  virtual const TypeInfo& typeInfo() const;
525 
527  static const TypeInfo& theTypeInfo();
528 
531  virtual DtUnicode getString() const;
532 
536  virtual void setString(const DtUnicode& value);
537 
539  virtual const DtVector& value() const;
540 
542  virtual void setValue(const DtVector& value);
543 
547  virtual DtVisualizerAttribute* clone() const;
548 
549  protected:
550  DtVector myValue;
551  };
552 }


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)