All Classes Namespaces Functions Variables Typedefs Enumerations Pages
dynamiccoloredbody.h
1 /*
2  OpenMBV - Open Multi Body Viewer.
3  Copyright (C) 2009 Markus Friedrich
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 #ifndef _OPENMBV_DYNAMICCOLOREDBODY_H_
21 #define _OPENMBV_DYNAMICCOLOREDBODY_H_
22 
23 #include <openmbvcppinterface/body.h>
24 
25 namespace OpenMBV {
26 
28  class DynamicColoredBody : public Body {
29  friend class ObjectFactory;
30  protected:
31  double minimalColorValue, maximalColorValue;
32  double dynamicColor;
33  std::vector<double> diffuseColor;
34  double transparency;
35 
38  public:
43  void setMinimalColorValue(double min) {
44  minimalColorValue=min;
45  }
46 
47  double getMinimalColorValue() { return minimalColorValue; }
48 
52  void setMaximalColorValue(double max) {
53  maximalColorValue=max;
54  }
55 
56  double getMaximalColorValue() { return maximalColorValue; }
57 
62  void setDynamicColor(const double col) {
63  dynamicColor=col;
64  }
65 
66  double getDynamicColor() { return dynamicColor; }
67 
72  void setDiffuseColor(const std::vector<double> &hsv) {
73  if(hsv.size()!=3) throw std::runtime_error("the dimension does not match");
74  diffuseColor=hsv;
75  }
76 
77  void setDiffuseColor(double h, double s, double v) {
78  std::vector<double> hsv;
79  hsv.push_back(h);
80  hsv.push_back(s);
81  hsv.push_back(v);
82  diffuseColor=hsv;
83  }
84 
85  std::vector<double> getDiffuseColor() { return diffuseColor; }
86 
88  void setTransparency(double t) {
89  transparency=t;
90  }
91 
92  double getTransparency() { return transparency; }
93 
95  virtual void initializeUsingXML(xercesc::DOMElement *element);
96 
97  xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent);
98  };
99 
100 }
101 
102 #endif
void setDynamicColor(const double col)
Definition: dynamiccoloredbody.h:62
Definition: objectfactory.h:40
void setDiffuseColor(const std::vector< double > &hsv)
Definition: dynamiccoloredbody.h:72
void setTransparency(double t)
Definition: dynamiccoloredbody.h:88
void setMinimalColorValue(double min)
Definition: dynamiccoloredbody.h:43
Definition: dynamiccoloredbody.h:28
void setMaximalColorValue(double max)
Definition: dynamiccoloredbody.h:52
virtual void initializeUsingXML(xercesc::DOMElement *element)
Definition: dynamiccoloredbody.cc:57
Definition: body.h:31

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML