FACT++  1.0
void BasicGlCamera::buildVerticesList ( )
protected

Definition at line 1043 of file BasicGlCamera.cc.

References hexcoords, hexRadius, hexTolerance, i, NPIX, numVertices, pixelsCoords, verticesIndices, and verticesList.

Referenced by assignPixelMap(), and BasicGlCamera().

1044  {
1045  numVertices = 0;
1046  GLfloat cVertex[2];
1047  for (int i=0;i<NPIX;i++)
1048  {
1049  for (int j=0;j<6;j++)
1050  {
1051  for (int k=0;k<2;k++)
1052  cVertex[k] = hexcoords[j][k]*hexRadius + pixelsCoords[i][k];
1053 
1054  bool found = false;
1055  for (int k=0;k<numVertices;k++)
1056  {
1057  if ((cVertex[0] - verticesList[k][0])*
1058  (cVertex[0] - verticesList[k][0]) +
1059  (cVertex[1] - verticesList[k][1])*
1060  (cVertex[1] - verticesList[k][1]) < hexTolerance*hexTolerance)
1061  {
1062  found = true;
1063  break;
1064  }
1065  }
1066  if (!found)
1067  {
1068  for (int k=0;k<2;k++)
1069  verticesList[numVertices][k] = cVertex[k];
1070  numVertices++;
1071  }
1072  }
1073  }
1074 //cout << "numVertices: " << numVertices << endl;
1075  for (int i=0;i<NPIX;i++)
1076  {
1077  for (int j=0;j<6;j++)
1078  {
1079  for (int k=0;k<2;k++)
1080  cVertex[k] = hexcoords[j][k]*hexRadius + pixelsCoords[i][k];
1081 
1082  for (int k=0;k<numVertices;k++)
1083  {
1084  if ((cVertex[0] - verticesList[k][0])*
1085  (cVertex[0] - verticesList[k][0]) +
1086  (cVertex[1] - verticesList[k][1])*
1087  (cVertex[1] - verticesList[k][1]) < hexTolerance*hexTolerance)
1088  {
1089  verticesIndices[i][j] = k;
1090  break;
1091  }
1092  }
1093  }
1094  }
1095  }
int i
Definition: db_dim_client.c:21
static GLfloat verticesList[NPIX *6][2]
static int verticesIndices[NPIX][6]
#define NPIX
Definition: BasicGlCamera.h:5
static GLfloat pixelsCoords[MAX_NUM_PIXELS][3]
GLfloat hexcoords[6][2]

+ Here is the caller graph for this function: