Hi, everyone
I encounter a trouble in my MDL code about element descriptor. My problem is as following:
I have two groups of cells and in each cell, its component elems are all closed elem(ellipse or complex shape). Now I want to difference one group cells to another group cells. I first want construct one group of closed elems into an element descriptor. I do it like the following but it is not right because I want the result structure like the following case 1 not case 2.
case 1 complexHdr--->linestring--->linestring--->nul | complexHdr--->linestring--->linestring--->nul | complexHdr--->linestring--->linestring--->nul | nul
case 2 complexHdr--->linestring--->linestring
|
complexHdr--->linestring--->linestring
|
complexHdr--->linestring--->linestring--->nul
MSElementDescr *edP, *resultEdP, *tmpEdP;
ULong readPos, filePos[1000]; // cells file position int i, num;
mdlElmdscr_read (&edP, filePos[0], 0, FALSE, &readPos); tmpEdP = edP->h.firstElem; // point to ellipse or complex header mdlElmdscr_new (&resultEdP, NULL, &tmpEdP->el); if (tmpEdP->h.isHeader) tmpEdP = tmpEdP->h.firstElem; else tmpEdP = tmpEdP->h.next; while (tmpEdP){ mdlElmdscr_appendElement (resultEdP, &tmpEdP->el); tmpEdP = tmpEdP->h.next; } mdlElmdscr_freeAll (&edP); for (i=1; i<num; i++){ mdlElmdscr_read (&edP, cutoutPos[i], 0, FALSE, &readPos); tmpEdP = edP->h.firstElem; mdlElmdscr_appendElement (cutoutEdP, &tmpEdP->el); if (tmpEdP->h.isHeader) tmpEdP = tmpEdP->h.firstElem; else tmpEdP = tmpEdP->h.next; while (tmpEdP){ mdlElmdscr_appendElement (resultEdP, &tmpEdP->el); tmpEdP = tmpEdP->h.next; } mdlElmdscr_freeAll (&edP); }
Sorry for my English.
Any help are appreciated!
Foo.
I encounter a trouble in my MDL code about element descriptor. My problem is as following:
I have two groups of cells and in each cell, its component elems are all closed elem(ellipse or complex shape). Now I want to difference one group cells to another group cells. I first want construct one group of closed elems into an element descriptor. I do it like the following but it is not right because I want the result structure like the following case 1 not case 2.
case 1 complexHdr--->linestring--->linestring--->nul | complexHdr--->linestring--->linestring--->nul | complexHdr--->linestring--->linestring--->nul | nul
case 2 complexHdr--->linestring--->linestring
|
complexHdr--->linestring--->linestring
|
complexHdr--->linestring--->linestring--->nul
MSElementDescr *edP, *resultEdP, *tmpEdP;
ULong readPos, filePos[1000]; // cells file position int i, num;
mdlElmdscr_read (&edP, filePos[0], 0, FALSE, &readPos); tmpEdP = edP->h.firstElem; // point to ellipse or complex header mdlElmdscr_new (&resultEdP, NULL, &tmpEdP->el); if (tmpEdP->h.isHeader) tmpEdP = tmpEdP->h.firstElem; else tmpEdP = tmpEdP->h.next; while (tmpEdP){ mdlElmdscr_appendElement (resultEdP, &tmpEdP->el); tmpEdP = tmpEdP->h.next; } mdlElmdscr_freeAll (&edP); for (i=1; i<num; i++){ mdlElmdscr_read (&edP, cutoutPos[i], 0, FALSE, &readPos); tmpEdP = edP->h.firstElem; mdlElmdscr_appendElement (cutoutEdP, &tmpEdP->el); if (tmpEdP->h.isHeader) tmpEdP = tmpEdP->h.firstElem; else tmpEdP = tmpEdP->h.next; while (tmpEdP){ mdlElmdscr_appendElement (resultEdP, &tmpEdP->el); tmpEdP = tmpEdP->h.next; } mdlElmdscr_freeAll (&edP); }
Sorry for my English.
Any help are appreciated!
Foo.