From 28efdb702e43122822884d01a02a450885b7085e Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Mon, 29 Feb 2016 08:47:16 +0000
Subject: [PATCH] Moving in right direction... still lots of errors

---
 src/restore.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/restore.c b/src/restore.c
index 74b0ef6..735d3ce 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -50,12 +50,12 @@
 						if ((!xmlStrcmp(cur2->name, (const xmlChar *)"Points"))){
 							fprintf(stderr,"Found point data\n");
 							if(vesicle!=NULL)
-								parseXMLVertexPosition(vesicle, doc, cur);
+								parseXMLVertexPosition(vesicle, doc, cur2);
 						}
 						if ((!xmlStrcmp(cur2->name, (const xmlChar *)"Cells"))){
 						fprintf(stderr,"Found cell(Bonds) data\n");
 							if(vesicle!=NULL)
-								parseXMLBonds(vesicle, doc, cur);
+								parseXMLBonds(vesicle, doc, cur2);
 						}
 						cur2=cur2->next;
 					}	
@@ -74,6 +74,7 @@
 /* TODO: cells, polymeres, filaments, core, tape */
 
 	fprintf(stderr,"Restoration completed\n");
+	write_vertex_xml_file(vesicle,999);
 	vesicle_free(vesicle);
 	exit(0);
 	return TS_SUCCESS;
@@ -285,6 +286,8 @@
 		}
 		child=child->next;
 	}
+	fprintf(stderr,"Vertices position j=%d\n",idx);	
+
 	return TS_SUCCESS;
 }
 ts_bool parseXMLBonds(ts_vesicle *vesicle,xmlDocPtr doc, xmlNodePtr cur){
@@ -294,7 +297,7 @@
 	int i, idx;
 	char *token[2];
 	while (child != NULL) {
-		if ((!xmlStrcmp(child->name, (const xmlChar *)"DataArray"))){
+		if ((!xmlStrcmp(child->name, (const xmlChar *)"DataArray")) && !xmlStrcmp(xmlGetProp(child, (xmlChar *)"Name"), (const xmlChar *)"connectivity") ){
 			bonds = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);
 			b=(char *)bonds;
 			token[0]=strtok(b," ");
@@ -309,6 +312,7 @@
 		}
 		child=child->next;
 	}
+	fprintf(stderr,"Bond data j=%d\n",idx);	
 	return TS_SUCCESS;
 }
 

--
Gitblit v1.9.3