xml-utils.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef GCU_XML_UTILS_H
00027 #define GCU_XML_UTILS_H
00028
00029 #include <libxml/parser.h>
00030 #include "chemistry.h"
00031 #include <goffice/goffice.h>
00032
00033 namespace gcu {
00034
00050 xmlNodePtr FindNodeByNameAndId (xmlNodePtr node, const char* name, const char* id = NULL);
00051
00065 bool ReadPosition (xmlNodePtr node, const char* id, double* x, double* y, double* z = NULL);
00079 bool WritePosition (xmlDocPtr xml, xmlNodePtr node, const char* id, double x, double y, double z = 0.0);
00080
00094 bool ReadColor (xmlNodePtr node, const char* id, float* red, float* green, float* blue, float* alpha = NULL);
00109 bool WriteColor (xmlDocPtr xml, xmlNodePtr node, const char* id, double red, double green, double blue, double alpha = 1.0);
00110
00117 GOColor ReadColor (xmlNodePtr node);
00118
00124 void WriteColor (xmlNodePtr node, GOColor color);
00125
00135 bool ReadRadius (xmlNodePtr node, GcuAtomicRadius& radius);
00136
00146 bool WriteRadius (xmlDocPtr xml, xmlNodePtr node, const GcuAtomicRadius& radius);
00147
00157 char const *GetStaticScale (char *buf);
00158
00166 void WriteFloat (xmlNodePtr node, char const *name, double value);
00167
00178 bool ReadFloat (xmlNodePtr node, char const *name, double &value, double default_value = 0.);
00179
00180 }
00181
00182 #endif // GCU_XML_UTILS_H