MCPcopy Create free account
hub / github.com/creatale/node-dv / cvGraphAddVtx

Function cvGraphAddVtx

deps/opencv/modules/core/src/datastructs.cpp:2606–2628  ·  view source on GitHub ↗

Add a vertex to a graph: */

Source from the content-addressed store, hash-verified

2604
2605/* Add a vertex to a graph: */
2606CV_IMPL int
2607cvGraphAddVtx( CvGraph* graph, const CvGraphVtx* _vertex, CvGraphVtx** _inserted_vertex )
2608{
2609 CvGraphVtx *vertex = 0;
2610 int index = -1;
2611
2612 if( !graph )
2613 CV_Error( CV_StsNullPtr, "" );
2614
2615 vertex = (CvGraphVtx*)cvSetNew((CvSet*)graph);
2616 if( vertex )
2617 {
2618 if( _vertex )
2619 memcpy( vertex + 1, _vertex + 1, graph->elem_size - sizeof(CvGraphVtx) );
2620 vertex->first = 0;
2621 index = vertex->flags;
2622 }
2623
2624 if( _inserted_vertex )
2625 *_inserted_vertex = vertex;
2626
2627 return index;
2628}
2629
2630
2631/* Remove a vertex from the graph together with its incident edges: */

Callers 2

cvCloneGraphFunction · 0.85
icvReadGraphFunction · 0.85

Calls 1

cvSetNewFunction · 0.85

Tested by

no test coverage detected