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

Coordinate.cpp

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

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