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

Color.cpp

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