NITFPRIV(void) polyDestroy(NITF_DATA* data) { /* TODO!! */ cgm_PolyLineElement* poly = (cgm_PolyLineElement*)data; nitf_ListIterator it, end; nitf_List* list = (nitf_List*)poly->vertices; if (poly->attributes) cgm_LineAttributes_destruct( &(poly->attributes) ); it = nitf_List_begin(list); end = nitf_List_end(list); while (nitf_ListIterator_notEqualTo(&it, &end)) { cgm_Vertex* v = (cgm_Vertex*)nitf_ListIterator_get(&it); cgm_Vertex_destruct(&v); nitf_ListIterator_increment(&it); } nitf_List_destruct(&list); NITF_FREE(data); }
NITFPRIV(void) ellipticalArcDestroy(NITF_DATA* data) { if ( ((cgm_EllipticalArcElement*)data)->attributes) { cgm_LineAttributes_destruct( & ((cgm_EllipticalArcElement*)data)->attributes); } NITF_FREE( data ); }
NITFPRIV(void) circularArcDestroy(NITF_DATA* data) { if ( ((cgm_CircularArcElement*)data)->attributes) { cgm_LineAttributes_destruct( & ((cgm_CircularArcElement*)data)->attributes); } NITF_FREE( data ); }
cgm_LineAttributes_construct(nitf_Error* error) { cgm_LineAttributes* atts = (cgm_LineAttributes*)NITF_MALLOC(sizeof(cgm_LineAttributes)); if (!atts) { nitf_Error_init(error, NITF_STRERROR(NITF_ERRNO), NITF_CTXT, NITF_ERR_MEMORY); return NULL; } atts->lineWidth = -1; atts->lineType = CGM_TYPE_NOT_SET; atts->lineColor = cgm_Color_construct(-1, -1, -1, error); if (!atts->lineColor) { cgm_LineAttributes_destruct(&atts); return NULL; } return atts; }