00001
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027 #include <errno.h>
00028 #include <math.h>
00029
00030 #include "powerflow.h"
00031 #include "node.h"
00032 #include "link.h"
00033
00034 extern "C" {
00035 #include "output.h"
00036 }
00037
00038 void print_matrix(complex mat[3][3])
00039 {
00040 for (int i = 0; i < 3; i++) {
00041 gl_testmsg(" %10.6f%+0.6f%c %10.6f%+0.6f%c %10.6f%+0.6f%c",
00042 mat[i][0].Re(), mat[i][0].Im(), mat[i][0].Notation(),
00043 mat[i][1].Re(), mat[i][1].Im(), mat[i][1].Notation(),
00044 mat[i][2].Re(), mat[i][2].Im(), mat[i][2].Notation());
00045 }
00046 gl_testmsg("\n");
00047 }
00048
00049 EXPORT int kmldump(FILE *fp, OBJECT *obj)
00050 {
00051
00052 if (obj==NULL)
00053 {
00054
00055 fprintf(fp, "<Style id=\"overhead_line\">\n"
00056 " <LineStyle>\n"
00057 " <color>7f00ffff</color>\n"
00058 " <width>4</width>\n"
00059 " </LineStyle>\n"
00060 " <PolyStyle>\n"
00061 " <color>7f00ff00</color>\n"
00062 " </PolyStyle>\n"
00063 "</Style>\n");
00064 fprintf(fp, "<Style id=\"underground_line\">\n"
00065 " <LineStyle>\n"
00066 " <color>3f00ffff</color>\n"
00067 " <width>4</width>\n"
00068 " </LineStyle>\n"
00069 " <PolyStyle>\n"
00070 " <color>3f00ff00</color>\n"
00071 " </PolyStyle>\n"
00072 "</Style>\n");
00073 return 0;
00074 }
00075 else if (gl_object_isa(obj,"node"))
00076 return OBJECTDATA(obj,node)->kmldump(fp);
00077 else if (gl_object_isa(obj,"link"))
00078 return OBJECTDATA(obj,link)->kmldump(fp);
00079 else
00080 return 0;
00081 }
00082