176 |
int posConnCount = c.getConnections(1).size(); |
int posConnCount = c.getConnections(1).size(); |
177 |
int negRotIndex = c.getRotationIndex(-1); |
int negRotIndex = c.getRotationIndex(-1); |
178 |
int posRotIndex = c.getRotationIndex(1); |
int posRotIndex = c.getRotationIndex(1); |
179 |
double[] negRotAngles = getRotationAngles(c, c.focus, Math.PI/2, -1, |
double[] negRotAngles = getRotationAngles(c, c.focus, Math.PI, -1, |
180 |
recursionDepth); |
recursionDepth); |
181 |
double[] posRotAngles = getRotationAngles(c, c.focus, Math.PI/2, 1, |
double[] posRotAngles = getRotationAngles(c, c.focus, Math.PI, 1, |
182 |
recursionDepth); |
recursionDepth); |
183 |
|
|
184 |
/** Negwards connections */ |
/** Negwards connections */ |
263 |
|
|
264 |
double[] angles = new double[conns]; |
double[] angles = new double[conns]; |
265 |
|
|
266 |
|
|
267 |
if (recursion == 0) { |
if (recursion == 0) { |
268 |
double rota = angle / conns; |
double rota = angle / conns; |
269 |
if (dbg) p("getRotationAngle, no recursion, rota: "+rota); |
if (dbg) p("getRotationAngle, no recursion, rota: "+rota); |
289 |
RDFNode current = (dir<0) ? stmt.getSubject() : stmt.getObject(); |
RDFNode current = (dir<0) ? stmt.getSubject() : stmt.getObject(); |
290 |
if(current != null && current instanceof Resource) { |
if(current != null && current instanceof Resource) { |
291 |
subconns[connCount] = getConnectionCount(c, (Resource)current, |
subconns[connCount] = getConnectionCount(c, (Resource)current, |
292 |
dir, recursion - 1); |
0, recursion - 1); |
293 |
totalsubconns += subconns[connCount]; |
totalsubconns += subconns[connCount]; |
294 |
if (subconns[connCount] == 0) subconns[connCount] = 1; |
if (subconns[connCount] == 0) { |
295 |
} else subconns[connCount] = 1; |
subconns[connCount] = 1; |
296 |
|
totalsubconns ++; |
297 |
|
} |
298 |
|
} else { |
299 |
|
subconns[connCount] = 1; |
300 |
|
totalsubconns++; |
301 |
|
} |
302 |
connCount++; |
connCount++; |
303 |
} |
} |
304 |
|
if (dbg) p("getRotationAngles, totalsubconns: "+totalsubconns); |
305 |
|
|
306 |
if ((angle / totalsubconns) >= maxrota) |
if ((angle / totalsubconns) >= maxrota) |
307 |
angle = totalsubconns * maxrota; |
angle = totalsubconns * maxrota; |
308 |
for (int i = 0; i < conns; i++) |
for (int i = 0; i < conns; i++) |
309 |
angles[i] = angle * ((double)subconns[i] / (double)totalsubconns); |
angles[i] = angle / conns; |
310 |
|
/** Variable angles just didnt work */ |
311 |
|
//angles[i] = angle * ((double)subconns[i] / (double)totalsubconns); |
312 |
|
|
313 |
if (dbg) p("getRotationAngle, angles: "+dArrayToString(angles)); |
if (dbg) p("getRotationAngle, angles: "+dArrayToString(angles)); |
314 |
|
|
315 |
return angles; |
return angles; |