00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _OPENMBV_DYNAMICCOLOREDBODY_H_
00021 #define _OPENMBV_DYNAMICCOLOREDBODY_H_
00022
00023 #include <openmbvcppinterface/body.h>
00024
00025 namespace OpenMBV {
00026
00028 class DynamicColoredBody : public Body {
00029 protected:
00030 double minimalColorValue, maximalColorValue;
00031 double dynamicColor;
00032 std::vector<double> diffuseColor;
00033 double transparency;
00034
00035 ~DynamicColoredBody();
00036 public:
00037 DynamicColoredBody();
00038
00043 void setMinimalColorValue(double min) {
00044 minimalColorValue=min;
00045 }
00046
00047 double getMinimalColorValue() { return minimalColorValue; }
00048
00052 void setMaximalColorValue(double max) {
00053 maximalColorValue=max;
00054 }
00055
00056 double getMaximalColorValue() { return maximalColorValue; }
00057
00062 void setDynamicColor(const double col) {
00063 dynamicColor=col;
00064 }
00065
00066 double getDynamicColor() { return dynamicColor; }
00067
00072 void setDiffuseColor(const std::vector<double> &hsv) {
00073 if(hsv.size()!=3) throw std::runtime_error("the dimension does not match");
00074 diffuseColor=hsv;
00075 }
00076
00077 void setDiffuseColor(double h, double s, double v) {
00078 std::vector<double> hsv;
00079 hsv.push_back(h);
00080 hsv.push_back(s);
00081 hsv.push_back(v);
00082 diffuseColor=hsv;
00083 }
00084
00085 std::vector<double> getDiffuseColor() { return diffuseColor; }
00086
00088 void setTransparency(double t) {
00089 transparency=t;
00090 }
00091
00092 double getTransparency() { return transparency; }
00093
00095 virtual void initializeUsingXML(xercesc::DOMElement *element);
00096
00097 xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent);
00098 };
00099
00100 }
00101
00102 #endif