VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtVisualizerAttribute.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 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 
33  bool operator==(const DtVisualizerAttribute&) const;
34 
37  bool operator!=(const DtVisualizerAttribute&) const;
38 
39  //Type info struct.
40  struct TypeInfo
41  {
42  TypeInfo(const std::string& name)
43  : className(name)
44  {
45  }
46 
47  std::string className;
48  };
49 
51  virtual DtVisualizerAttribute* clone() const = 0;
52 
54  virtual const TypeInfo& typeInfo() const = 0;
55 
57  virtual DtUnicode getString() const = 0;
58 
60  virtual void setString(const DtUnicode& value) = 0;
61  };
62 
66  {
67  public:
69  DtVisualizerAttributeBool(bool value = false);
70 
73 
75  virtual const TypeInfo& typeInfo() const;
76 
78  static const TypeInfo& theTypeInfo();
79 
82  virtual DtUnicode getString() const;
83 
87  virtual void setString(const DtUnicode& value);
88 
90  virtual bool value() const;
91 
93  virtual void setValue(bool value);
94 
98  virtual DtVisualizerAttribute* clone() const;
99 
100  protected:
101  bool myValue;
102  };
103 
107  public DtVisualizerAttribute
108  {
109  public:
110  typedef std::vector<DtUnicode> StringVector;
111 
114 
117 
119  virtual const TypeInfo& typeInfo() const;
120 
122  static const TypeInfo& theTypeInfo();
123 
126  virtual DtUnicode getString() const;
127 
131  virtual void setString(const DtUnicode& value);
132 
134  virtual const StringVector& value() const
135  {
136  return myValue;
137  }
138 
139  inline bool findAndReplace(const DtUnicode& orig, const DtUnicode& newValue)
140  {
141  bool found = false;
142  StringVector::iterator i = myValue.begin();
143  StringVector::iterator e = myValue.end();
144  for(; i != e; ++i)
145  {
146  if(*i == orig)
147  {
148  *i = newValue;
149  found = true;
150  }
151  }
152  return found;
153  }
154 
156  virtual void setValue(const StringVector& value);
157 
161  virtual DtVisualizerAttribute* clone() const;
162 
163  protected:
165  };
166 
167 
171  public DtVisualizerAttribute
172  {
173  public:
176 
178  virtual const TypeInfo& typeInfo() const;
179 
181  static const TypeInfo& theTypeInfo();
182 
185  virtual DtUnicode getString() const;
186 
190  virtual void setString(const DtUnicode& value);
191 
193  virtual DtUnicode value() const;
194 
196  virtual void setValue(const DtUnicode& value);
197 
201  virtual DtVisualizerAttribute* clone() const;
202 
203  protected:
205  };
206 
207 
212  {
213  public:
216 
218  virtual const TypeInfo& typeInfo() const;
219 
221  static const TypeInfo& theTypeInfo();
222  };
223 
224 
229  public DtVisualizerAttribute
230  {
231  public:
234 
236  virtual const TypeInfo& typeInfo() const;
237 
239  static const TypeInfo& theTypeInfo();
240 
243  virtual DtUnicode getString() const;
244 
248  virtual void setString(const DtUnicode& value);
249 
251  virtual DtUnicode value() const;
252 
254  virtual void setValue(const DtUnicode& value);
255 
259  virtual DtVisualizerAttribute* clone() const;
260 
261  protected:
263  };
264 
265 
269  public DtVisualizerAttribute
270  {
271  public:
273  DtVisualizerAttributeInteger(int value = 0);
274 
277 
279  virtual const TypeInfo& typeInfo() const;
280 
282  static const TypeInfo& theTypeInfo();
283 
286  virtual DtUnicode getString() const;
287 
291  virtual void setString(const DtUnicode& value);
292 
294  virtual int value() const;
295 
297  virtual void setValue(int value);
298 
302  virtual DtVisualizerAttribute* clone() const;
303 
304  protected:
305  int myValue;
306  };
307 
311  public DtVisualizerAttribute
312  {
313  public:
314  // FontGlyphs are represented as unsigned ints:
315  typedef unsigned int FontGlyph;
316 
319 
322 
324  virtual const TypeInfo& typeInfo() const;
325 
327  static const TypeInfo& theTypeInfo();
328 
331  virtual DtUnicode getString() const;
332 
336  virtual void setString(const DtUnicode& value);
337 
339  virtual FontGlyph value() const;
340 
342  virtual void setValue(FontGlyph value);
343 
347  virtual DtVisualizerAttribute* clone() const;
348 
349  protected:
351  };
352 
356  public DtVisualizerAttribute
357  {
358  public:
359  // Selected symbols are represented as a map between integer and string:
360  typedef std::map<int, DtUnicode> ImageSymbolMap;
361 
364 
366  virtual const TypeInfo& typeInfo() const;
367 
369  static const TypeInfo& theTypeInfo();
370 
373  virtual DtUnicode getString() const;
374 
378  virtual void setString(const DtUnicode& value);
379 
381  virtual const ImageSymbolMap& value() const;
382 
384  virtual void setValue(const ImageSymbolMap& value);
385 
389  virtual DtVisualizerAttribute* clone() const;
390 
391  protected:
393  };
394 
398  public DtVisualizerAttribute
399  {
400  public:
402  DtVisualizerAttributeFloat(float value = 0.0f);
403 
406 
408  virtual const TypeInfo& typeInfo() const;
409 
411  static const TypeInfo& theTypeInfo();
412 
415  virtual DtUnicode getString() const;
416 
420  virtual void setString(const DtUnicode& value);
421 
423  virtual float value() const;
424 
426  virtual void setValue(float value);
427 
431  virtual DtVisualizerAttribute* clone() const;
432 
433  protected:
434  float myValue;
435  };
436 
439  {
440  public:
443 
445  virtual const TypeInfo& typeInfo() const;
446 
448  static const TypeInfo& theTypeInfo();
449 
452  virtual DtUnicode getString() const;
453 
457  virtual void setString(const DtUnicode& value);
458 
460  virtual DtUnicode value() const;
461 
463  virtual void setValue(const DtUnicode& value);
464 
468  virtual DtVisualizerAttribute* clone() const;
469 
470  protected:
472  };
473 
477  {
478  public:
479  // Colors are represented as boost 4-tuples of RGBA values (in that order)
480  typedef boost::tuple<unsigned int, unsigned int, unsigned int,
481  unsigned int> RGBAColor;
482 
484  //Changed the default alpha to opaque so the color picker defaults to opaque
485  // instead of transparent.
486  DtVisualizerAttributeColor(RGBAColor value = RGBAColor(0,0,0,255));
487 
490 
492  virtual const TypeInfo& typeInfo() const;
493 
495  static const TypeInfo& theTypeInfo();
496 
499  virtual DtUnicode getString() const;
500 
504  virtual void setString(const DtUnicode& value);
505 
507  virtual RGBAColor value() const;
508 
510  virtual void setValue(const RGBAColor& value);
511 
515  virtual DtVisualizerAttribute* clone() const;
516 
517  protected:
519  };
520 
524  public DtVisualizerAttribute
525  {
526  public:
529 
532 
534  virtual const TypeInfo& typeInfo() const;
535 
537  static const TypeInfo& theTypeInfo();
538 
541  virtual DtUnicode getString() const;
542 
546  virtual void setString(const DtUnicode& value);
547 
549  virtual const DtVector& value() const;
550 
552  virtual void setValue(const DtVector& value);
553 
557  virtual DtVisualizerAttribute* clone() const;
558 
559  protected:
561  };
562 
566  public DtVisualizerAttribute
567  {
568  public:
571 
574 
576  virtual const TypeInfo& typeInfo() const;
577 
579  static const TypeInfo& theTypeInfo();
580 
583  virtual DtUnicode getString() const;
584 
588  virtual void setString(const DtUnicode& value);
589 
591  virtual const DtVector& value() const;
592 
594  virtual void setValue(const DtVector& value);
595 
599  virtual DtVisualizerAttribute* clone() const;
600 
601  protected:
603  };
604 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)