00001
00032 #include "linden_common.h"
00033
00034 #include "llvolumexml.h"
00035
00036
00037
00038
00039
00040
00041
00042 LLXMLNode *LLVolumeXml::exportProfileParams(const LLProfileParams* params)
00043 {
00044 LLXMLNode *ret = new LLXMLNode("profile", FALSE);
00045
00046 ret->createChild("curve_type", TRUE)->setByteValue(1, ¶ms->getCurveType());
00047 ret->createChild("interval", FALSE)->setFloatValue(2, ¶ms->getBegin());
00048 ret->createChild("hollow", FALSE)->setFloatValue(1, ¶ms->getHollow());
00049
00050 return ret;
00051 }
00052
00053
00054 LLXMLNode *LLVolumeXml::exportPathParams(const LLPathParams* params)
00055 {
00056 LLXMLNode *ret = new LLXMLNode("path", FALSE);
00057 ret->createChild("curve_type", TRUE)->setByteValue(1, ¶ms->getCurveType());
00058 ret->createChild("interval", FALSE)->setFloatValue(2, ¶ms->getBegin());
00059 ret->createChild("scale", FALSE)->setFloatValue(2, params->getScale().mV);
00060 ret->createChild("shear", FALSE)->setFloatValue(2, params->getShear().mV);
00061 ret->createChild("twist_interval", FALSE)->setFloatValue(2, ¶ms->getTwistBegin());
00062 ret->createChild("radius_offset", FALSE)->setFloatValue(1, ¶ms->getRadiusOffset());
00063 ret->createChild("taper", FALSE)->setFloatValue(2, params->getTaper().mV);
00064 ret->createChild("revolutions", FALSE)->setFloatValue(1, ¶ms->getRevolutions());
00065 ret->createChild("skew", FALSE)->setFloatValue(1, ¶ms->getSkew());
00066
00067 return ret;
00068 }
00069
00070
00071 LLXMLNode *LLVolumeXml::exportVolumeParams(const LLVolumeParams* params)
00072 {
00073 LLXMLNode *ret = new LLXMLNode("shape", FALSE);
00074
00075 exportPathParams(¶ms->getPathParams())->setParent(ret);
00076 exportProfileParams(¶ms->getProfileParams())->setParent(ret);
00077
00078 return ret;
00079 }
00080