Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ColorRGBA.cpp

Go to the documentation of this file.
00001 #include "ColorRGBA.h"
00002 
00003 #include <iostream>
00004 
00005 using namespace X3DTK;
00006 using namespace std;
00007 
00008 ColorRGBA::ColorRGBA()
00009 : X3DColorNode()
00010 {
00011   defineTagName("ColorRGBA", "Rendering");
00012 }
00013 
00014 ColorRGBA::ColorRGBA(const MFColorRGBA &color)
00015 : X3DColorNode(), color_(color)
00016 {
00017   defineTagName("ColorRGBA", "Rendering");
00018 }
00019 
00020 SFNode ColorRGBA::clone() const
00021 {
00022   return new ColorRGBA(*this);
00023 }
00024 
00025 ColorRGBA::~ColorRGBA()
00026 {
00027 }
00028 
00029 ColorRGBA::ColorRGBA(const ColorRGBA &C)
00030 : X3DColorNode(), color_(C.color_)
00031 {
00032   defineTagName("ColorRGBA", "Rendering");
00033 }
00034 
00035 void ColorRGBA::setColor(const MFColorRGBA &color)
00036 {
00037   color_ = color;
00038 }
00039 
00040 void ColorRGBA::loadAttributes(const X3DFileElement *element)
00041 {
00042   int index;
00043   index = element->getIndexAttribute("color");
00044   if (index != -1)
00045     color_ = MFColorRGBA(element->getAttribute(index));
00046 }
00047 
00048 SFString ColorRGBA::writeAttributes() const
00049 {
00050   SFString attr;
00051   if (!color_.empty())
00052     attr += " color=\"" + toSFString(color_) + "\"";
00053     
00054   return attr;
00055 }

Generated on Wed May 14 10:03:07 2003 for X3DToolKit by doxygen1.3