MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / insertVertexAddress

Method insertVertexAddress

src/LNLib/Algorithm/Voronoi.cpp:1171–1194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1169}
1170
1171void LNLib::VoronoiDiagramGenerator::insertVertexAddress(long vertexNum, struct Site* address)
1172{
1173 if (vertices == 0)
1174 {
1175 vertices = (struct Site**)myalloc(4000 * sizeof(*vertices));
1176 sizeOfVertices = 4000;
1177 for (int i = sizeOfVertices - 4000; i < sizeOfVertices; i++)
1178 {
1179 vertices[i] = 0;
1180 }
1181 }
1182 //if the site address being entered is past the end of the array, then grow the array
1183 while (vertexNum > sizeOfVertices - 1)
1184 {
1185 vertices = (Site**)realloc(vertices, (sizeOfVertices + 4000) * sizeof(Site*));
1186 sizeOfVertices += 4000;
1187
1188 for (int i = sizeOfVertices - 4000; i < sizeOfVertices; i++)
1189 {
1190 vertices[i] = 0;
1191 }
1192 }
1193 vertices[vertexNum] = address;
1194}
1195
1196void LNLib::VoronoiDiagramGenerator::insertVertexLink(long vertexNum, long vertexLinkedTo)
1197{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected