llvolumexml.cpp

Go to the documentation of this file.
00001 
00032 #include "linden_common.h"
00033 
00034 #include "llvolumexml.h"
00035 
00036 //============================================================================
00037 
00038 // LLVolumeXml is just a wrapper class; all members are static
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, &params->getCurveType());
00047         ret->createChild("interval", FALSE)->setFloatValue(2, &params->getBegin());
00048         ret->createChild("hollow", FALSE)->setFloatValue(1, &params->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, &params->getCurveType());
00058         ret->createChild("interval", FALSE)->setFloatValue(2, &params->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, &params->getTwistBegin());
00062         ret->createChild("radius_offset", FALSE)->setFloatValue(1, &params->getRadiusOffset());
00063         ret->createChild("taper", FALSE)->setFloatValue(2, params->getTaper().mV);
00064         ret->createChild("revolutions", FALSE)->setFloatValue(1, &params->getRevolutions());
00065         ret->createChild("skew", FALSE)->setFloatValue(1, &params->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(&params->getPathParams())->setParent(ret);
00076         exportProfileParams(&params->getProfileParams())->setParent(ret);
00077 
00078         return ret;
00079 }
00080 

Generated on Thu Jul 1 06:09:42 2010 for Second Life Viewer by  doxygen 1.4.7