Some linking fixes

Esse commit está contido em:
Antonio Patriarca
2011-10-19 15:47:39 +02:00
commit 9193082603
88 arquivos alterados com 1537 adições e 309 exclusões
@@ -30,7 +30,7 @@ import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFileChooser;
import javax.swing.JTextField;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
import org.gephi.ui.components.JColorButton;
import org.gephi.visualization.api.VisualizationController;
import org.gephi.visualization.api.rendering.background.Background;
@@ -23,7 +23,7 @@ package org.gephi.desktop.visualization.components;
import javax.swing.InputVerifier;
import javax.swing.JComponent;
import javax.swing.JTextField;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
/**
* @author Vojtech Bardiovsky
+4 -4
Ver Arquivo
@@ -1,8 +1,8 @@
build.xml.data.CRC32=55e8adb8
build.xml.data.CRC32=feec8ec1
build.xml.script.CRC32=0ab5f04b
build.xml.stylesheet.CRC32=a56c6a5b@1.45.1
build.xml.stylesheet.CRC32=a56c6a5b@1.46.2
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=55e8adb8
nbproject/build-impl.xml.data.CRC32=feec8ec1
nbproject/build-impl.xml.script.CRC32=3953e9ed
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2
+1 -2
Ver Arquivo
@@ -7,8 +7,7 @@
<suite-component/>
<module-dependencies/>
<public-packages>
<package>org.gephi.math.linalg</package>
<package>org.gephi.math.qrand</package>
<package>org.gephi.math</package>
</public-packages>
</data>
</configuration>
@@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.linalg;
package org.gephi.math;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
@@ -166,7 +166,7 @@ public class Mat4 {
*
* @param e the entries' array
*/
public Mat4(float[] e) {
protected Mat4(float[] e) {
this.entries = e;
}
@@ -178,10 +178,9 @@ public class Mat4 {
*
* @param i the row index
* @param j the column index
* @throws IndexOutOfBoundsException if <code>j*4 + i &gt;= 16</code>
* @return the (i,j) entry
*/
public final float get(int i, int j) throws IndexOutOfBoundsException {
public float get(int i, int j) {
return this.entries[j*4 + i];
}
@@ -190,10 +189,9 @@ public class Mat4 {
* Indexes are zero-based. It does not check array bounds.
*
* @param j the index of the column
* @throws IndexOutOfBoundsException if <code>j*4 + 3 &gt;= 16</code>
* @return the j<sup>th</sup> column of the matrix
*/
public final Vec4 getColumn(int j) throws IndexOutOfBoundsException {
public Vec4 getColumn(int j) {
final int s = j*4;
return new Vec4(this.entries[s], this.entries[s+1], this.entries[s+2], this.entries[s+3]);
}
@@ -203,10 +201,9 @@ public class Mat4 {
* Indexes are zero-based. It does not check array bounds.
*
* @param j the index of the column
* @throws IndexOutOfBoundsException if <code>j*4 + 3 &gt;= 16</code>
* @return the j<sup>th</sup> column of the matrix
*/
public final Vec4M getColumnM(int j) throws IndexOutOfBoundsException {
public Vec4M getColumnM(int j) {
final int s = j*4;
return new Vec4M(this.entries[s], this.entries[s+1], this.entries[s+2], this.entries[s+3]);
}
@@ -216,10 +213,9 @@ public class Mat4 {
* Indexes are zero-based. It does not check array bounds.
*
* @param i the index of the row
* @throws IndexOutOfBoundsException if <code>i &gt;= 4</code>
* @return the i<sup>th</sup> row of the matrix
*/
public final Vec4 getRow(int i) {
public Vec4 getRow(int i) {
return new Vec4(this.entries[i], this.entries[4 + i], this.entries[8 + i], this.entries[12 + i]);
}
@@ -228,10 +224,9 @@ public class Mat4 {
* Indexes are zero-based. It does not check array bounds.
*
* @param i the index of the row
* @throws IndexOutOfBoundsException if <code>i &gt;= 4</code>
* @return the i<sup>th</sup> row of the matrix
*/
public final Vec4M getRowM(int i) {
public Vec4M getRowM(int i) {
return new Vec4M(this.entries[i], this.entries[4 + i], this.entries[8 + i], this.entries[12 + i]);
}
@@ -246,7 +241,7 @@ public class Mat4 {
* their entries are equal, <code>false</code> otherwise
*/
@Override
public final boolean equals(Object obj) {
public boolean equals(Object obj) {
if (obj == this) return true;
if (!(obj instanceof Mat4)) return false;
@@ -266,7 +261,7 @@ public class Mat4 {
* @return the hash code
*/
@Override
public final int hashCode() {
public int hashCode() {
int result = Float.floatToRawIntBits(this.entries[0]);;
for (int i = 1; i < 16; ++i) {
result ^= Float.floatToRawIntBits(this.entries[i]);
@@ -280,7 +275,7 @@ public class Mat4 {
* @return the string
*/
@Override
public final String toString() {
public String toString() {
return "(" + this.entries[0] + ", " + this.entries[4] + ", " + this.entries[8] + ", " + this.entries[12] + "; \n" +
this.entries[1] + ", " + this.entries[5] + ", " + this.entries[9] + ", " + this.entries[13] + "; \n" +
this.entries[2] + ", " + this.entries[6] + ", " + this.entries[10] + ", " + this.entries[14] + "; \n" +
@@ -294,7 +289,7 @@ public class Mat4 {
*
* @return <code>det(this)</code>
*/
public final float det() {
public float det() {
final float d30 = this.entries[4]*this.entries[9]*this.entries[14] + this.entries[6]*this.entries[8]*this.entries[13] +
this.entries[5]*this.entries[10]*this.entries[12] - this.entries[4]*this.entries[10]*this.entries[13] -
this.entries[5]*this.entries[8]*this.entries[14] - this.entries[6]*this.entries[9]*this.entries[12];
@@ -316,7 +311,7 @@ public class Mat4 {
*
* @return <code>det(this)</code>
*/
public final float detAffine() {
public float detAffine() {
return this.entries[0]*this.entries[5]*this.entries[10] + this.entries[2]*this.entries[4]*this.entries[9] +
this.entries[1]*this.entries[6]*this.entries[8] - this.entries[0]*this.entries[6]*this.entries[9] -
this.entries[1]*this.entries[4]*this.entries[10] - this.entries[2]*this.entries[5]*this.entries[8];
@@ -330,7 +325,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this + m</code>
*/
public final Mat4 plus(Mat4 m) {
public Mat4 plus(Mat4 m) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = this.entries[i] + m.entries[i];
@@ -345,7 +340,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this + sk*m</code>
*/
public final Mat4 plus(float s, Mat4 m) {
public Mat4 plus(float s, Mat4 m) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = this.entries[i] + s * m.entries[i];
@@ -359,7 +354,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this - m</code>
*/
public final Mat4 minus(Mat4 m) {
public Mat4 minus(Mat4 m) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = this.entries[i] - m.entries[i];
@@ -374,7 +369,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this - sk*m</code>
*/
public final Mat4 minus(float s, Mat4 m) {
public Mat4 minus(float s, Mat4 m) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = this.entries[i] - s * m.entries[i];
@@ -388,7 +383,7 @@ public class Mat4 {
* @param s the scalar
* @return <code>this * sk</code>
*/
public final Mat4 times(float s) {
public Mat4 times(float s) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = s * this.entries[i];
@@ -402,7 +397,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this * m</code>
*/
public final Mat4 times(Mat4 m) {
public Mat4 times(Mat4 m) {
final float[] e = new float[16];
for (int j = 0; j < 16; j += 4) {
for (int k = 0; k < 4; ++k) {
@@ -426,7 +421,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this + m</code>
*/
public final Mat4M plusM(Mat4 m) {
public Mat4M plusM(Mat4 m) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = this.entries[i] + m.entries[i];
@@ -441,7 +436,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this + sk*m</code>
*/
public final Mat4M plusM(float s, Mat4 m) {
public Mat4M plusM(float s, Mat4 m) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = this.entries[i] + s * m.entries[i];
@@ -455,7 +450,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this - m</code>
*/
public final Mat4M minusM(Mat4 m) {
public Mat4M minusM(Mat4 m) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = this.entries[i] - m.entries[i];
@@ -470,7 +465,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this - sk*m</code>
*/
public final Mat4M minusM(float s, Mat4 m) {
public Mat4M minusM(float s, Mat4 m) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = this.entries[i] - s * m.entries[i];
@@ -484,7 +479,7 @@ public class Mat4 {
* @param s the scalar
* @return <code>this * sk</code>
*/
public final Mat4M timesM(float s) {
public Mat4M timesM(float s) {
final float[] e = new float[16];
for (int i = 0; i < 16; ++i) {
e[i] = s * this.entries[i];
@@ -498,7 +493,7 @@ public class Mat4 {
* @param m the other matrix
* @return <code>this * m</code>
*/
public final Mat4M timesM(Mat4 m) {
public Mat4M timesM(Mat4 m) {
final float[] e = new float[16];
for (int j = 0; j < 16; j += 4) {
for (int k = 0; k < 4; ++k) {
@@ -521,7 +516,7 @@ public class Mat4 {
*
* @return <code>-this</code>
*/
public final Mat4 negated() {
public Mat4 negated() {
return this.times(-1.0f);
}
@@ -530,7 +525,7 @@ public class Mat4 {
*
* @return <code>this^t</code>
*/
public final Mat4 transposed() {
public Mat4 transposed() {
final float[] e = new float[16];
for (int j = 0; j < 4; ++j) {
for (int i = 0; i < 4; ++i) {
@@ -545,7 +540,7 @@ public class Mat4 {
*
* @return <code>this^(-1)</code>
*/
public final Mat4 inverse() {
public Mat4 inverse() {
throw new UnsupportedOperationException("General matrix inverse not implemented yet.");
}
@@ -555,7 +550,7 @@ public class Mat4 {
*
* @return <code>this^(-1)</code>
*/
public final Mat4 inverseAffine() {
public Mat4 inverseAffine() {
final float a00 = this.entries[5]*this.entries[10] - this.entries[6]*this.entries[9];
final float a10 = this.entries[4]*this.entries[10] - this.entries[6]*this.entries[8];
final float a20 = this.entries[4]*this.entries[9] - this.entries[5]*this.entries[8];
@@ -587,7 +582,7 @@ public class Mat4 {
*
* @return <code>this^(-1)</code>
*/
public final Mat4 inverseOrthogonal() {
public Mat4 inverseOrthogonal() {
return this.transposed();
}
@@ -596,7 +591,7 @@ public class Mat4 {
*
* @return <code>this^(-1)</code>
*/
public final Mat4 inverseIsometry() {
public Mat4 inverseIsometry() {
final float vx = - (this.entries[0] * this.entries[12] + this.entries[1] * this.entries[13] + this.entries[2] * this.entries[14]);
final float vy = - (this.entries[4] * this.entries[12] + this.entries[5] * this.entries[13] + this.entries[6] * this.entries[14]);
final float vz = - (this.entries[8] * this.entries[12] + this.entries[9] * this.entries[13] + this.entries[10] * this.entries[14]);
@@ -617,7 +612,7 @@ public class Mat4 {
*
* @return <code>-this</code>
*/
public final Mat4M negatedM() {
public Mat4M negatedM() {
return this.timesM(-1.0f);
}
@@ -626,7 +621,7 @@ public class Mat4 {
*
* @return <code>this^t</code>
*/
public final Mat4M transposedM() {
public Mat4M transposedM() {
final float[] e = new float[16];
for (int j = 0; j < 4; ++j) {
for (int i = 0; i < 4; ++i) {
@@ -641,7 +636,7 @@ public class Mat4 {
*
* @return <code>this^(-1)</code>
*/
public final Mat4M inverseM() {
public Mat4M inverseM() {
throw new UnsupportedOperationException("General matrix inverse not implemented yet.");
}
@@ -651,7 +646,7 @@ public class Mat4 {
*
* @return <code>this^(-1)</code>
*/
public final Mat4M inverseAffineM() {
public Mat4M inverseAffineM() {
final float a00 = this.entries[5]*this.entries[10] - this.entries[6]*this.entries[9];
final float a10 = this.entries[4]*this.entries[10] - this.entries[6]*this.entries[8];
final float a20 = this.entries[4]*this.entries[9] - this.entries[5]*this.entries[8];
@@ -683,7 +678,7 @@ public class Mat4 {
*
* @return <code>this^(-1)</code>
*/
public final Mat4M inverseOrthogonalM() {
public Mat4M inverseOrthogonalM() {
return this.transposedM();
}
@@ -692,7 +687,7 @@ public class Mat4 {
*
* @return <code>this^(-1)</code>
*/
public final Mat4M inverseIsometryM() {
public Mat4M inverseIsometryM() {
final float vx = - (this.entries[0] * this.entries[12] + this.entries[1] * this.entries[13] + this.entries[2] * this.entries[14]);
final float vy = - (this.entries[4] * this.entries[12] + this.entries[5] * this.entries[13] + this.entries[6] * this.entries[14]);
final float vz = - (this.entries[8] * this.entries[12] + this.entries[9] * this.entries[13] + this.entries[10] * this.entries[14]);
@@ -714,7 +709,7 @@ public class Mat4 {
* @param v the vector
* @return <code>this * v</code>
*/
public final Vec4 times(Vec4 v) {
public Vec4 times(Vec4 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -744,7 +739,7 @@ public class Mat4 {
* @param v the vector
* @return <code>this * v</code>
*/
public final Vec4M timesM(Vec4 v) {
public Vec4M timesM(Vec4 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -775,7 +770,7 @@ public class Mat4 {
* @param v the vector to transform
* @return <code>this * (v, 0)</code>
*/
public final Vec4 transformVec(Vec3 v) {
public Vec4 transformVec(Vec3 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -801,7 +796,7 @@ public class Mat4 {
* @param v the vector to transform
* @return <code>this * (v, 0)</code>
*/
public final Vec4M transformVecM(Vec3 v) {
public Vec4M transformVecM(Vec3 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -827,7 +822,7 @@ public class Mat4 {
* @param v the point to transform
* @return <code>this * (v, 1)</code>
*/
public final Vec4 transformPoint(Vec3 v) {
public Vec4 transformPoint(Vec3 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -858,7 +853,7 @@ public class Mat4 {
* @param v the point to transform
* @return <code>this * (v, 1)</code>
*/
public final Vec4M transformPointM(Vec3 v) {
public Vec4M transformPointM(Vec3 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -889,7 +884,7 @@ public class Mat4 {
* @param v the normal to transform
* @return <code>this^(-t) * (v, 0)</code>
*/
public final Vec4 transformNormal(Vec3 v) {
public Vec4 transformNormal(Vec3 v) {
final Mat4M m = this.inverseM().transpose();
return m.transformVec(v);
}
@@ -901,7 +896,7 @@ public class Mat4 {
* @param v the normal to transform
* @return <code>this^(-t) * (v, 0)</code>
*/
public final Vec4M transformNormalM(Vec3 v) {
public Vec4M transformNormalM(Vec3 v) {
final Mat4M m = this.inverseM().transpose();
return m.transformVecM(v);
}
@@ -913,7 +908,7 @@ public class Mat4 {
* @param v the vector to transform
* @return <code>this * (v, 0)</code>
*/
public final Vec3 transformAffineVec(Vec3 v) {
public Vec3 transformAffineVec(Vec3 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -936,7 +931,7 @@ public class Mat4 {
* @param v the vector to transform
* @return <code>this * (v, 0)</code>
*/
public final Vec3M transformAffineVecM(Vec3 v) {
public Vec3M transformAffineVecM(Vec3 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -959,7 +954,7 @@ public class Mat4 {
* @param v the point to transform
* @return <code>this * (v, 1)</code>
*/
public final Vec3 transformAffinePoint(Vec3 v) {
public Vec3 transformAffinePoint(Vec3 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -986,7 +981,7 @@ public class Mat4 {
* @param v the point to transform
* @return <code>this * (v, 1)</code>
*/
public final Vec3M transformAffinePointM(Vec3 v) {
public Vec3M transformAffinePointM(Vec3 v) {
float x = this.entries[0] * v.x;
float y = this.entries[1] * v.x;
float z = this.entries[2] * v.x;
@@ -1013,7 +1008,7 @@ public class Mat4 {
* @param v the normal to transform
* @return <code>this^(-t) * (v, 0)</code>
*/
public final Vec3 transformAffineNormal(Vec3 v) {
public Vec3 transformAffineNormal(Vec3 v) {
final Mat4M m = this.inverseAffineM().transpose();
return m.transformAffineVec(v);
}
@@ -1025,7 +1020,7 @@ public class Mat4 {
* @param v the normal to transform
* @return <code>this^(-t) * (v, 0)</code>
*/
public final Vec3M transformAffineNormalM(Vec3 v) {
public Vec3M transformAffineNormalM(Vec3 v) {
final Mat4M m = this.inverseAffineM().transpose();
return m.transformAffineVecM(v);
}
@@ -1037,7 +1032,7 @@ public class Mat4 {
*
* @return the new array
*/
public final float[] toArray() {
public float[] toArray() {
float[] result = new float[16];
System.arraycopy(this.entries, 0, result, 0, 16);
return result;
@@ -1048,7 +1043,7 @@ public class Mat4 {
*
* @return the immutable copy of this vector
*/
public final Mat4 copy() {
public Mat4 copy() {
return new Mat4(this);
}
@@ -1057,7 +1052,7 @@ public class Mat4 {
*
* @return the mutable copy of this vector
*/
public final Mat4M copyM() {
public Mat4M copyM() {
return new Mat4M(this);
}
@@ -1072,7 +1067,7 @@ public class Mat4 {
* remaining in the buffer
* @throws ReadOnlyBufferException if the buffer is read-only
*/
public final void writeTo(ByteBuffer b) throws BufferOverflowException,
public void writeTo(ByteBuffer b) throws BufferOverflowException,
ReadOnlyBufferException {
for (int i = 0; i < 16; ++i) {
b.putFloat(this.entries[i]);
@@ -1089,7 +1084,7 @@ public class Mat4 {
* remaining in the buffer
* @throws ReadOnlyBufferException if the buffer is read-only
*/
public final int writeTo(ByteBuffer b, int i)
public int writeTo(ByteBuffer b, int i)
throws BufferOverflowException, ReadOnlyBufferException {
for (int j = 0; j < 16; ++j) {
b.putFloat(i, this.entries[j]);
@@ -18,13 +18,14 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.linalg;
package org.gephi.math;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
/**
*
* Mutable 4x4 matrix.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class Mat4M extends Mat4 {
@@ -142,10 +143,9 @@ public class Mat4M extends Mat4 {
* @param i the row index
* @param j the column index
* @param v the value
* @throws IndexOutOfBoundsException if <code>j*4 + i &gt;= 16</code>
* @return <code>this</code>
*/
public Mat4M set(int i, int j, float v) throws IndexOutOfBoundsException {
public Mat4M set(int i, int j, float v) {
this.entries[j*4 + i] = v;
return this;
}
@@ -156,10 +156,9 @@ public class Mat4M extends Mat4 {
*
* @param j the index of the column
* @param v the new column
* @throws IndexOutOfBoundsException if <code>j*4 + 3 &gt;= 16</code>
* @return <code>this</code>
*/
public Mat4M setColumn(int j, Vec4 v) throws IndexOutOfBoundsException {
public Mat4M setColumn(int j, Vec4 v) {
final int s = j*4;
this.entries[s] = v.x;
this.entries[s+1] = v.y;
@@ -177,10 +176,9 @@ public class Mat4M extends Mat4 {
* @param v1 the new (1,j)-entry
* @param v2 the new (2,j)-entry
* @param v3 the new (3,j)-entry
* @throws IndexOutOfBoundsException if <code>j*4 + 3 &gt;= 16</code>
* @return <code>this</code>
*/
public Mat4M setColumn(int j, float v0, float v1, float v2, float v3) throws IndexOutOfBoundsException {
public Mat4M setColumn(int j, float v0, float v1, float v2, float v3) {
final int s = j*4;
this.entries[s] = v0;
this.entries[s+1] = v1;
@@ -195,10 +193,9 @@ public class Mat4M extends Mat4 {
*
* @param i the index of the row
* @param v the new row
* @throws IndexOutOfBoundsException if <code>i &gt;= 4</code>
* @return <code>this</code>
*/
public Mat4M setRow(int i, Vec4 v) throws IndexOutOfBoundsException {
public Mat4M setRow(int i, Vec4 v) {
this.entries[i] = v.x;
this.entries[4+i] = v.y;
this.entries[8+i] = v.z;
@@ -215,10 +212,9 @@ public class Mat4M extends Mat4 {
* @param v1 the new (i,1)-entry
* @param v2 the new (i,2)-entry
* @param v3 the new (i,3)-entry
* @throws IndexOutOfBoundsException if <code>i &gt;= 4</code>
* @return <code>this</code>
*/
public Mat4M setRow(int i, float v0, float v1, float v2, float v3) throws IndexOutOfBoundsException {
public Mat4M setRow(int i, float v0, float v1, float v2, float v3){
this.entries[i] = v0;
this.entries[4+i] = v1;
this.entries[8+i] = v2;
@@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.qrand;
package org.gephi.math;
/**
* Generates a sequence of numbers in [0, 1) with the low-discrepancy property
@@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.linalg;
package org.gephi.math;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
@@ -93,7 +93,7 @@ public class Vec2 {
*
* @return the first component of the vector
*/
public final float x() {
public float x() {
return this.x;
}
@@ -102,7 +102,7 @@ public class Vec2 {
*
* @return the second component of the vector
*/
public final float y() {
public float y() {
return this.y;
}
@@ -117,7 +117,7 @@ public class Vec2 {
* their components are equal, <code>false</code> otherwise
*/
@Override
public final boolean equals(Object obj) {
public boolean equals(Object obj) {
if (obj == this) return true;
if (!(obj instanceof Vec2)) return false;
@@ -133,7 +133,7 @@ public class Vec2 {
* @return the hash code
*/
@Override
public final int hashCode() {
public int hashCode() {
final int ix = Float.floatToRawIntBits(this.x);
final int iy = Float.floatToRawIntBits(this.y);
@@ -146,7 +146,7 @@ public class Vec2 {
* @return the string
*/
@Override
public final String toString() {
public String toString() {
return "(" + this.x + ", " + this.y + ")";
}
@@ -158,7 +158,7 @@ public class Vec2 {
* @param v the other vector
* @return the dot product of this vector and <code>v</code>
*/
public final float dot(Vec2 v) {
public float dot(Vec2 v) {
return this.x * v.x + this.y * v.y;
}
@@ -168,7 +168,7 @@ public class Vec2 {
* @param v the other vector
* @return the perpendicular dot product of this vector and <code>v</code>
*/
public final float perpDot(Vec2 v) {
public float perpDot(Vec2 v) {
return this.x * v.y - this.y * v.x;
}
@@ -177,7 +177,7 @@ public class Vec2 {
*
* @return the square of the Euclidean norm
*/
public final float lengthSquared() {
public float lengthSquared() {
return this.dot(this);
}
@@ -186,7 +186,7 @@ public class Vec2 {
*
* @return the Euclidean norm
*/
public final float length() {
public float length() {
return (float) Math.sqrt(this.lengthSquared());
}
@@ -195,7 +195,7 @@ public class Vec2 {
*
* @return the angle from the x-axis to this vector
*/
public final float angle() {
public float angle() {
return (float) Math.atan2(this.y, this.x);
}
@@ -205,7 +205,7 @@ public class Vec2 {
* @param v the other vector
* @return the angle from this vector to <code>v</code>
*/
public final float angle(Vec2 v) {
public float angle(Vec2 v) {
return (float) Math.atan2(this.perpDot(v), this.dot(v));
}
@@ -217,7 +217,7 @@ public class Vec2 {
* @param v the other vector
* @return <code>this + v</code>
*/
public final Vec2 plus(Vec2 v) {
public Vec2 plus(Vec2 v) {
return new Vec2(this.x + v.x, this.y + v.y);
}
@@ -228,7 +228,7 @@ public class Vec2 {
* @param v the other vector
* @return <code>this + s*v</code>
*/
public final Vec2 plus(float s, Vec2 v) {
public Vec2 plus(float s, Vec2 v) {
return new Vec2(this.x + s * v.x, this.y + s * v.y);
}
@@ -238,7 +238,7 @@ public class Vec2 {
* @param v the other vector
* @return <code>this - v</code>
*/
public final Vec2 minus(Vec2 v) {
public Vec2 minus(Vec2 v) {
return new Vec2(this.x - v.x, this.y - v.y);
}
@@ -250,7 +250,7 @@ public class Vec2 {
* @param v the other vector
* @return <code>this - s*v</code>
*/
public final Vec2 minus(float s, Vec2 v) {
public Vec2 minus(float s, Vec2 v) {
return new Vec2(this.x - s * v.x, this.y - s * v.y);
}
@@ -260,7 +260,7 @@ public class Vec2 {
* @param s the scalar
* @return <code>this * s</code>
*/
public final Vec2 times(float s) {
public Vec2 times(float s) {
return new Vec2(s * this.x, s * this.y);
}
@@ -272,7 +272,7 @@ public class Vec2 {
* @param v the other vector
* @return <code>this + v</code>
*/
public final Vec2M plusM(Vec2 v) {
public Vec2M plusM(Vec2 v) {
return new Vec2M(this.x + v.x, this.y + v.y);
}
@@ -283,7 +283,7 @@ public class Vec2 {
* @param v the other vector
* @return <code>this + s*v</code>
*/
public final Vec2M plusM(float s, Vec2 v) {
public Vec2M plusM(float s, Vec2 v) {
return new Vec2M(this.x + s * v.x, this.y + s * v.y);
}
@@ -293,7 +293,7 @@ public class Vec2 {
* @param v the other vector
* @return <code>this - v</code>
*/
public final Vec2M minusM(Vec2 v) {
public Vec2M minusM(Vec2 v) {
return new Vec2M(this.x - v.x, this.y - v.y);
}
@@ -305,7 +305,7 @@ public class Vec2 {
* @param v the other vector
* @return <code>this - s*v</code>
*/
public final Vec2M minusM(float s, Vec2 v) {
public Vec2M minusM(float s, Vec2 v) {
return new Vec2M(this.x - s * v.x, this.y - s * v.y);
}
@@ -315,7 +315,7 @@ public class Vec2 {
* @param s the scalar
* @return <code>this * s</code>
*/
public final Vec2M timesM(float s) {
public Vec2M timesM(float s) {
return new Vec2M(s * this.x, s * this.y);
}
@@ -326,7 +326,7 @@ public class Vec2 {
*
* @return <code>-this</code>
*/
public final Vec2 negated() {
public Vec2 negated() {
return this.times(-1.0f);
}
@@ -335,7 +335,7 @@ public class Vec2 {
*
* @return <code>this / this.length()</code>
*/
public final Vec2 normalized() {
public Vec2 normalized() {
final float oneOnLength = 1.0f / this.length();
return this.times(oneOnLength);
}
@@ -346,7 +346,7 @@ public class Vec2 {
*
* @return the perpendicular vector
*/
public final Vec2 perp() {
public Vec2 perp() {
return new Vec2(- this.y, this.x);
}
@@ -357,7 +357,7 @@ public class Vec2 {
*
* @return <code>-this</code>
*/
public final Vec2M negatedM() {
public Vec2M negatedM() {
return this.timesM(-1.0f);
}
@@ -366,7 +366,7 @@ public class Vec2 {
*
* @return <code>this / this.length()</code>
*/
public final Vec2M normalizedM() {
public Vec2M normalizedM() {
final float oneOnLength = 1.0f / this.length();
return this.timesM(oneOnLength);
}
@@ -377,7 +377,7 @@ public class Vec2 {
*
* @return the perpendicular vector
*/
public final Vec2M perpM() {
public Vec2M perpM() {
return new Vec2M(- this.y, this.x);
}
@@ -389,7 +389,7 @@ public class Vec2 {
* @param angle the angle of rotation expressed in radians
* @return the rotated vector
*/
public final Vec2 rotated(float angle) {
public Vec2 rotated(float angle) {
final float c = (float)Math.cos(angle);
final float s = (float)Math.sin(angle);
return new Vec2(this.x * c - this.y * s, this.x * s + this.y * c);
@@ -402,7 +402,7 @@ public class Vec2 {
* @param sy scalar factor along the y-axis
* @return the scaled vector
*/
public final Vec2 scaled(float sx, float sy) {
public Vec2 scaled(float sx, float sy) {
return new Vec2(sx * this.x, sy * this.y);
}
@@ -412,7 +412,7 @@ public class Vec2 {
* @param s scalar factors stored in a vector
* @return the scaled vector
*/
public final Vec2 scaled(Vec2 s) {
public Vec2 scaled(Vec2 s) {
return this.scaled(s.x, s.y);
}
@@ -424,7 +424,7 @@ public class Vec2 {
* @param angle the angle of rotation expressed in radians
* @return the rotated vector
*/
public final Vec2M rotatedM(float angle) {
public Vec2M rotatedM(float angle) {
final float c = (float)Math.cos(angle);
final float s = (float)Math.sin(angle);
return new Vec2M(this.x * c - this.y * s, this.x * s + this.y * c);
@@ -437,7 +437,7 @@ public class Vec2 {
* @param sy scalar factor along the y-axis
* @return the scaled vector
*/
public final Vec2M scaledM(float sx, float sy) {
public Vec2M scaledM(float sx, float sy) {
return new Vec2M(sx * this.x, sy * this.y);
}
@@ -447,7 +447,7 @@ public class Vec2 {
* @param s scalar factors stored in a vector
* @return the scaled vector
*/
public final Vec2M scaledM(Vec2 s) {
public Vec2M scaledM(Vec2 s) {
return this.scaledM(s.x, s.y);
}
@@ -458,7 +458,7 @@ public class Vec2 {
*
* @return the new array
*/
public final float[] toArray() {
public float[] toArray() {
return new float[]{this.x, this.y};
}
@@ -467,7 +467,7 @@ public class Vec2 {
*
* @return the immutable copy of this vector
*/
public final Vec2 copy() {
public Vec2 copy() {
return new Vec2(this);
}
@@ -476,7 +476,7 @@ public class Vec2 {
*
* @return the mutable copy of this vector
*/
public final Vec2M copyM() {
public Vec2M copyM() {
return new Vec2M(this);
}
@@ -491,7 +491,7 @@ public class Vec2 {
* remaining in the buffer
* @throws ReadOnlyBufferException if the buffer is read-only
*/
public final void writeTo(ByteBuffer b) throws BufferOverflowException,
public void writeTo(ByteBuffer b) throws BufferOverflowException,
ReadOnlyBufferException {
b.putFloat(this.x);
b.putFloat(this.y);
@@ -507,7 +507,7 @@ public class Vec2 {
* remaining in the buffer
* @throws ReadOnlyBufferException if the buffer is read-only
*/
public final int writeTo(ByteBuffer b, int i)
public int writeTo(ByteBuffer b, int i)
throws BufferOverflowException, ReadOnlyBufferException {
b.putFloat(i, this.x);
b.putFloat(i+4, this.y);
@@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.linalg;
package org.gephi.math;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
@@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.linalg;
package org.gephi.math;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
@@ -103,7 +103,7 @@ public class Vec3 {
*
* @return the first component of the vector
*/
public final float x() {
public float x() {
return this.x;
}
@@ -112,7 +112,7 @@ public class Vec3 {
*
* @return the second component of the vector
*/
public final float y() {
public float y() {
return this.y;
}
@@ -121,7 +121,7 @@ public class Vec3 {
*
* @return the third component of the vector
*/
public final float z() {
public float z() {
return this.z;
}
@@ -136,7 +136,7 @@ public class Vec3 {
* their components are equal, <code>false</code> otherwise
*/
@Override
public final boolean equals(Object obj) {
public boolean equals(Object obj) {
if (obj == this) return true;
if (!(obj instanceof Vec3)) return false;
@@ -152,7 +152,7 @@ public class Vec3 {
* @return the hash code
*/
@Override
public final int hashCode() {
public int hashCode() {
final int ix = Float.floatToRawIntBits(this.x);
final int iy = Float.floatToRawIntBits(this.y);
final int iz = Float.floatToRawIntBits(this.z);
@@ -166,7 +166,7 @@ public class Vec3 {
* @return the string
*/
@Override
public final String toString() {
public String toString() {
return "(" + this.x + ", " + this.y + ", " + this.z + ")";
}
@@ -178,7 +178,7 @@ public class Vec3 {
* @param v the other vector
* @return the dot product of this vector and <code>v</code>
*/
public final float dot(Vec3 v) {
public float dot(Vec3 v) {
return this.x * v.x + this.y * v.y + this.z * v.z;
}
@@ -191,7 +191,7 @@ public class Vec3 {
* @param w the third vector
* @return dot(cross(this, v), w)
*/
public final float triple(Vec3 v, Vec3 w) {
public float triple(Vec3 v, Vec3 w) {
float a = this.y * v.z - this.z * v.y;
float b = this.z * v.x - this.x * v.z;
float c = this.x * v.y - this.y * v.x;
@@ -203,7 +203,7 @@ public class Vec3 {
*
* @return the square of the Euclidean norm
*/
public final float lengthSquared() {
public float lengthSquared() {
return this.dot(this);
}
@@ -212,7 +212,7 @@ public class Vec3 {
*
* @return the Euclidean norm
*/
public final float length() {
public float length() {
return (float) Math.sqrt(this.lengthSquared());
}
@@ -221,7 +221,7 @@ public class Vec3 {
*
* @return the inclination angle from the zenith
*/
public final float inclination() {
public float inclination() {
return (float) Math.acos(this.z / this.length());
}
@@ -231,7 +231,7 @@ public class Vec3 {
*
* @return the elevation angle from the reference plane
*/
public final float elevation() {
public float elevation() {
return (float) Math.asin(this.z / this.length());
}
@@ -240,7 +240,7 @@ public class Vec3 {
*
* @return the azimuth angle
*/
public final float azimuth() {
public float azimuth() {
return (float) Math.atan2(this.y, this.x);
}
@@ -250,7 +250,7 @@ public class Vec3 {
* @param v the other vector
* @return the angle from this vector to <code>v</code>
*/
public final float angle(Vec3 v) {
public float angle(Vec3 v) {
return (float) Math.atan2(this.cross(v).length(), this.dot(v));
}
@@ -262,7 +262,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>this + v</code>
*/
public final Vec3 plus(Vec3 v) {
public Vec3 plus(Vec3 v) {
return new Vec3(this.x + v.x, this.y + v.y, this.z + v.z);
}
@@ -273,7 +273,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>this + s*v</code>
*/
public final Vec3 plus(float s, Vec3 v) {
public Vec3 plus(float s, Vec3 v) {
return new Vec3(this.x + s * v.x, this.y + s * v.y, this.z + s * v.z);
}
@@ -283,7 +283,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>this - v</code>
*/
public final Vec3 minus(Vec3 v) {
public Vec3 minus(Vec3 v) {
return new Vec3(this.x - v.x, this.y - v.y, this.z - v.z);
}
@@ -295,7 +295,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>this - s*v</code>
*/
public final Vec3 minus(float s, Vec3 v) {
public Vec3 minus(float s, Vec3 v) {
return new Vec3(this.x - s * v.x, this.y - s * v.y, this.z - s * v.z);
}
@@ -305,7 +305,7 @@ public class Vec3 {
* @param s the scalar
* @return <code>this * s</code>
*/
public final Vec3 times(float s) {
public Vec3 times(float s) {
return new Vec3(s * this.x, s * this.y, s * this.z);
}
@@ -315,7 +315,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>cross(this, v)</code>
*/
public final Vec3 cross(Vec3 v) {
public Vec3 cross(Vec3 v) {
final float a = this.y * v.z - this.z * v.y;
final float b = this.z * v.x - this.x * v.z;
final float c = this.x * v.y - this.y * v.x;
@@ -330,7 +330,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>this + v</code>
*/
public final Vec3M plusM(Vec3 v) {
public Vec3M plusM(Vec3 v) {
return new Vec3M(this.x + v.x, this.y + v.y, this.z + v.z);
}
@@ -341,7 +341,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>this + s*v</code>
*/
public final Vec3M plusM(float s, Vec3 v) {
public Vec3M plusM(float s, Vec3 v) {
return new Vec3M(this.x + s * v.x, this.y + s * v.y, this.z + s * v.z);
}
@@ -351,7 +351,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>this - v</code>
*/
public final Vec3M minusM(Vec3 v) {
public Vec3M minusM(Vec3 v) {
return new Vec3M(this.x - v.x, this.y - v.y, this.z - v.z);
}
@@ -363,7 +363,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>this - s*v</code>
*/
public final Vec3M minusM(float s, Vec3 v) {
public Vec3M minusM(float s, Vec3 v) {
return new Vec3M(this.x - s * v.x, this.y - s * v.y, this.z - s * v.z);
}
@@ -373,7 +373,7 @@ public class Vec3 {
* @param s the scalar
* @return <code>this * s</code>
*/
public final Vec3M timesM(float s) {
public Vec3M timesM(float s) {
return new Vec3M(s * this.x, s * this.y, s * this.z);
}
@@ -383,7 +383,7 @@ public class Vec3 {
* @param v the other vector
* @return <code>cross(this, v)</code>
*/
public final Vec3M crossM(Vec3 v) {
public Vec3M crossM(Vec3 v) {
final float a = this.y * v.z - this.z * v.y;
final float b = this.z * v.x - this.x * v.z;
final float c = this.x * v.y - this.y * v.x;
@@ -397,7 +397,7 @@ public class Vec3 {
*
* @return <code>-this</code>
*/
public final Vec3 negated() {
public Vec3 negated() {
return this.times(-1.0f);
}
@@ -406,7 +406,7 @@ public class Vec3 {
*
* @return <code>this / this.length()</code>
*/
public final Vec3 normalized() {
public Vec3 normalized() {
final float oneOnLength = 1.0f / this.length();
return this.times(oneOnLength);
}
@@ -418,7 +418,7 @@ public class Vec3 {
*
* @return <code>-this</code>
*/
public final Vec3M negatedM() {
public Vec3M negatedM() {
return this.timesM(-1.0f);
}
@@ -427,7 +427,7 @@ public class Vec3 {
*
* @return <code>this / this.length()</code>
*/
public final Vec3M normalizedM() {
public Vec3M normalizedM() {
final float oneOnLength = 1.0f / this.length();
return this.timesM(oneOnLength);
}
@@ -442,7 +442,7 @@ public class Vec3 {
* @param sz scalar factor along the z-axis
* @return the scaled vector
*/
public final Vec3 scaled(float sx, float sy, float sz) {
public Vec3 scaled(float sx, float sy, float sz) {
return new Vec3(sx * this.x, sy * this.y, sz * this.z);
}
@@ -452,7 +452,7 @@ public class Vec3 {
* @param s scalar factors stored in a vector
* @return the scaled vector
*/
public final Vec3 scaled(Vec3 s) {
public Vec3 scaled(Vec3 s) {
return this.scaled(s.x, s.y, s.z);
}
@@ -466,7 +466,7 @@ public class Vec3 {
* @param sz scalar factor along the z-axis
* @return the scaled vector
*/
public final Vec3M scaledM(float sx, float sy, float sz) {
public Vec3M scaledM(float sx, float sy, float sz) {
return new Vec3M(sx * this.x, sy * this.y, sz * this.z);
}
@@ -476,7 +476,7 @@ public class Vec3 {
* @param s scalar factors stored in a vector
* @return the scaled vector
*/
public final Vec3M scaledM(Vec3 s) {
public Vec3M scaledM(Vec3 s) {
return this.scaledM(s.x, s.y, s.z);
}
@@ -487,7 +487,7 @@ public class Vec3 {
*
* @return the new array
*/
public final float[] toArray() {
public float[] toArray() {
return new float[]{this.x, this.y, this.z};
}
@@ -496,7 +496,7 @@ public class Vec3 {
*
* @return the immutable copy of this vector
*/
public final Vec3 copy() {
public Vec3 copy() {
return new Vec3(this.x, this.y, this.z);
}
@@ -505,7 +505,7 @@ public class Vec3 {
*
* @return the mutable copy of this vector
*/
public final Vec3M copyM() {
public Vec3M copyM() {
return new Vec3M(this.x, this.y, this.z);
}
@@ -520,7 +520,7 @@ public class Vec3 {
* remaining in the buffer
* @throws ReadOnlyBufferException if the buffer is read-only
*/
public final void writeTo(ByteBuffer b) throws BufferOverflowException,
public void writeTo(ByteBuffer b) throws BufferOverflowException,
ReadOnlyBufferException {
b.putFloat(this.x);
b.putFloat(this.y);
@@ -537,7 +537,7 @@ public class Vec3 {
* remaining in the buffer
* @throws ReadOnlyBufferException if the buffer is read-only
*/
public final int writeTo(ByteBuffer b, int i)
public int writeTo(ByteBuffer b, int i)
throws BufferOverflowException, ReadOnlyBufferException {
b.putFloat(i, this.x);
b.putFloat(i+4, this.y);
@@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.linalg;
package org.gephi.math;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
@@ -269,7 +269,7 @@ public class Vec3M extends Vec3 {
* @param v the other vector
* @return <code>this = cross(this, v)</code>
*/
public final Vec3M crossEq(Vec3 v) {
public Vec3M crossEq(Vec3 v) {
final float a = this.y * v.z - this.z * v.y;
final float b = this.z * v.x - this.x * v.z;
final float c = this.x * v.y - this.y * v.x;
@@ -390,7 +390,7 @@ public class Vec3M extends Vec3 {
* @param w the second vector
* @return <code>this = cross(v, w)</code>
*/
public final Vec3M toCross(Vec3 v, Vec3 w) {
public Vec3M toCross(Vec3 v, Vec3 w) {
final float a = v.y * w.z - v.z * w.y;
final float b = v.z * w.x - v.x * w.z;
final float c = v.x * w.y - v.y * w.x;
@@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.linalg;
package org.gephi.math;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
@@ -112,7 +112,7 @@ public class Vec4 {
*
* @return the first component of the vector
*/
public final float x() {
public float x() {
return this.x;
}
@@ -121,7 +121,7 @@ public class Vec4 {
*
* @return the second component of the vector
*/
public final float y() {
public float y() {
return this.y;
}
@@ -130,7 +130,7 @@ public class Vec4 {
*
* @return the third component of the vector
*/
public final float z() {
public float z() {
return this.z;
}
@@ -139,7 +139,7 @@ public class Vec4 {
*
* @return the fourth component of the vector
*/
public final float w() {
public float w() {
return this.w;
}
@@ -154,7 +154,7 @@ public class Vec4 {
* their components are equal, <code>false</code> otherwise
*/
@Override
public final boolean equals(Object obj) {
public boolean equals(Object obj) {
if (obj == this) return true;
if (!(obj instanceof Vec4)) return false;
@@ -170,7 +170,7 @@ public class Vec4 {
* @return the hash code
*/
@Override
public final int hashCode() {
public int hashCode() {
final int ix = Float.floatToRawIntBits(this.x);
final int iy = Float.floatToRawIntBits(this.y);
final int iz = Float.floatToRawIntBits(this.z);
@@ -185,7 +185,7 @@ public class Vec4 {
* @return the string
*/
@Override
public final String toString() {
public String toString() {
return "(" + this.x + ", " + this.y + ", " + this.z + ", " + this.w + ")";
}
@@ -197,7 +197,7 @@ public class Vec4 {
* @param v the other vector
* @return the dot product of this vector and <code>v</code>
*/
public final float dot(Vec4 v) {
public float dot(Vec4 v) {
return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;
}
@@ -206,7 +206,7 @@ public class Vec4 {
*
* @return the square of the Euclidean norm
*/
public final float lengthSquared() {
public float lengthSquared() {
return this.dot(this);
}
@@ -215,7 +215,7 @@ public class Vec4 {
*
* @return the Euclidean norm
*/
public final float length() {
public float length() {
return (float) Math.sqrt(this.lengthSquared());
}
@@ -227,7 +227,7 @@ public class Vec4 {
* @param v the other vector
* @return <code>this + v</code>
*/
public final Vec4 plus(Vec4 v) {
public Vec4 plus(Vec4 v) {
return new Vec4(this.x + v.x, this.y + v.y, this.z + v.z, this.w + v.w);
}
@@ -238,7 +238,7 @@ public class Vec4 {
* @param v the other vector
* @return <code>this + s*v</code>
*/
public final Vec4 plus(float s, Vec4 v) {
public Vec4 plus(float s, Vec4 v) {
return new Vec4(this.x + s * v.x, this.y + s * v.y, this.z + s * v.z, this.w + s * v.w);
}
@@ -248,7 +248,7 @@ public class Vec4 {
* @param v the other vector
* @return <code>this - v</code>
*/
public final Vec4 minus(Vec4 v) {
public Vec4 minus(Vec4 v) {
return new Vec4(this.x - v.x, this.y - v.y, this.z - v.z, this.w - v.w);
}
@@ -260,7 +260,7 @@ public class Vec4 {
* @param v the other vector
* @return <code>this - s*v</code>
*/
public final Vec4 minus(float s, Vec4 v) {
public Vec4 minus(float s, Vec4 v) {
return new Vec4(this.x - s * v.x, this.y - s * v.y, this.z - s * v.z, this.w - s * v.w);
}
@@ -270,7 +270,7 @@ public class Vec4 {
* @param s the scalar
* @return <code>this * s</code>
*/
public final Vec4 times(float s) {
public Vec4 times(float s) {
return new Vec4(s * this.x, s * this.y, s * this.z, s * this.w);
}
@@ -282,7 +282,7 @@ public class Vec4 {
* @param v the other vector
* @return <code>this + v</code>
*/
public final Vec4M plusM(Vec4 v) {
public Vec4M plusM(Vec4 v) {
return new Vec4M(this.x + v.x, this.y + v.y, this.z + v.z, this.w + v.w);
}
@@ -293,7 +293,7 @@ public class Vec4 {
* @param v the other vector
* @return <code>this + s*v</code>
*/
public final Vec4M plusM(float s, Vec4 v) {
public Vec4M plusM(float s, Vec4 v) {
return new Vec4M(this.x + s * v.x, this.y + s * v.y, this.z + s * v.z, this.w + s * v.w);
}
@@ -303,7 +303,7 @@ public class Vec4 {
* @param v the other vector
* @return <code>this - v</code>
*/
public final Vec4M minusM(Vec4 v) {
public Vec4M minusM(Vec4 v) {
return new Vec4M(this.x - v.x, this.y - v.y, this.z - v.z, this.w - v.w);
}
@@ -315,7 +315,7 @@ public class Vec4 {
* @param v the other vector
* @return <code>this - s*v</code>
*/
public final Vec4M minusM(float s, Vec4 v) {
public Vec4M minusM(float s, Vec4 v) {
return new Vec4M(this.x - s * v.x, this.y - s * v.y, this.z - s * v.z, this.w - s * v.w);
}
@@ -325,7 +325,7 @@ public class Vec4 {
* @param s the scalar
* @return <code>this * s</code>
*/
public final Vec4M timesM(float s) {
public Vec4M timesM(float s) {
return new Vec4M(s * this.x, s * this.y, s * this.z, s * this.w);
}
@@ -336,7 +336,7 @@ public class Vec4 {
*
* @return <code>-this</code>
*/
public final Vec4 negated() {
public Vec4 negated() {
return this.times(-1.0f);
}
@@ -345,7 +345,7 @@ public class Vec4 {
*
* @return <code>this / this.length()</code>
*/
public final Vec4 normalized() {
public Vec4 normalized() {
final float oneOnLength = 1.0f / this.length();
return this.times(oneOnLength);
}
@@ -357,7 +357,7 @@ public class Vec4 {
*
* @return <code>-this</code>
*/
public final Vec4M negatedM() {
public Vec4M negatedM() {
return this.timesM(-1.0f);
}
@@ -366,7 +366,7 @@ public class Vec4 {
*
* @return <code>this / this.length()</code>
*/
public final Vec4M normalizedM() {
public Vec4M normalizedM() {
final float oneOnLength = 1.0f / this.length();
return this.timesM(oneOnLength);
}
@@ -382,7 +382,7 @@ public class Vec4 {
* @param sw scalar factor along the w-axis
* @return the scaled vector
*/
public final Vec4 scaled(float sx, float sy, float sz, float sw) {
public Vec4 scaled(float sx, float sy, float sz, float sw) {
return new Vec4(sx * this.x, sy * this.y, sz * this.z, sw * this.w);
}
@@ -392,7 +392,7 @@ public class Vec4 {
* @param s scalar factors stored in a vector
* @return the scaled vector
*/
public final Vec4 scaled(Vec4 s) {
public Vec4 scaled(Vec4 s) {
return this.scaled(s.x, s.y, s.z, s.w);
}
@@ -407,7 +407,7 @@ public class Vec4 {
* @param sw scalar factor along the w-axis
* @return the scaled vector
*/
public final Vec4M scaledM(float sx, float sy, float sz, float sw) {
public Vec4M scaledM(float sx, float sy, float sz, float sw) {
return new Vec4M(sx * this.x, sy * this.y, sz * this.z, sw * this.w);
}
@@ -417,7 +417,7 @@ public class Vec4 {
* @param s scalar factors stored in a vector
* @return the scaled vector
*/
public final Vec4M scaledM(Vec4 s) {
public Vec4M scaledM(Vec4 s) {
return this.scaledM(s.x, s.y, s.z, s.w);
}
@@ -428,7 +428,7 @@ public class Vec4 {
*
* @return the new array
*/
public final float[] toArray() {
public float[] toArray() {
return new float[]{this.x, this.y, this.z, this.w};
}
@@ -437,7 +437,7 @@ public class Vec4 {
*
* @return the immutable copy of this vector
*/
public final Vec4 copy() {
public Vec4 copy() {
return new Vec4(this.x, this.y, this.z, this.w);
}
@@ -446,7 +446,7 @@ public class Vec4 {
*
* @return the mutable copy of this vector
*/
public final Vec4M copyM() {
public Vec4M copyM() {
return new Vec4M(this.x, this.y, this.z, this.w);
}
@@ -461,7 +461,7 @@ public class Vec4 {
* remaining in the buffer
* @throws ReadOnlyBufferException if the buffer is read-only
*/
public final void writeTo(ByteBuffer b) throws BufferOverflowException,
public void writeTo(ByteBuffer b) throws BufferOverflowException,
ReadOnlyBufferException {
b.putFloat(this.x);
b.putFloat(this.y);
@@ -479,7 +479,7 @@ public class Vec4 {
* remaining in the buffer
* @throws ReadOnlyBufferException if the buffer is read-only
*/
public final int writeTo(ByteBuffer b, int i)
public int writeTo(ByteBuffer b, int i)
throws BufferOverflowException, ReadOnlyBufferException {
b.putFloat(i, this.x);
b.putFloat(i+4, this.y);
@@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.math.linalg;
package org.gephi.math;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
@@ -22,9 +22,9 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.camera;
import java.awt.Dimension;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.linalg.Vec2M;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec2;
import org.gephi.math.Vec2M;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.Camera;
import org.gephi.visualization.api.vizmodel.GraphLimits;
@@ -22,11 +22,11 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.camera;
import java.awt.Dimension;
import org.gephi.math.linalg.Mat4M;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.linalg.Vec3M;
import org.gephi.math.linalg.Vec4;
import org.gephi.math.Mat4M;
import org.gephi.math.Vec3;
import org.gephi.math.Vec3;
import org.gephi.math.Vec3M;
import org.gephi.math.Vec4;
import org.gephi.visualization.api.Camera;
import org.gephi.visualization.api.vizmodel.GraphLimits;
@@ -27,7 +27,7 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import javax.swing.SwingUtilities;
import org.gephi.graph.api.Node;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.MotionManager;
import org.gephi.visualization.api.VisualizationController;
import org.gephi.visualization.api.vizmodel.VizConfig;
@@ -37,7 +37,7 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import org.gephi.data.attributes.api.AttributeColumn;
import org.gephi.graph.api.Node;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.project.api.ProjectController;
import org.gephi.project.api.Workspace;
import org.gephi.project.api.WorkspaceListener;
@@ -24,9 +24,9 @@ package org.gephi.visualization.data;
import java.util.Collections;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.Command;
/**
@@ -30,7 +30,7 @@ import org.gephi.visualization.api.Camera;
import org.gephi.visualization.api.view.ui.UIShape;
import org.gephi.visualization.data.graph.styler.EdgeStyler;
import org.gephi.visualization.data.graph.styler.NodeStyler;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.rendering.command.CommandListBuilders;
/**
@@ -24,7 +24,7 @@ package org.gephi.visualization.data;
import java.util.List;
import org.gephi.graph.api.Edge;
import org.gephi.graph.api.Node;
import org.gephi.math.qrand.VanDerCorputSequence;
import org.gephi.math.VanDerCorputSequence;
import org.gephi.visualization.api.view.ui.UIShape;
import org.gephi.visualization.camera.Camera2d;
import org.gephi.visualization.camera.Camera3d;
@@ -34,10 +34,10 @@ import org.gephi.visualization.data.graph.styler.EdgeStyler;
import org.gephi.visualization.data.graph.styler.NodeStyler;
import org.gephi.visualization.data.graph.VizNode2D;
import org.gephi.visualization.data.graph.VizNode3D;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.OrthoCameraBuilder;
import org.gephi.visualization.rendering.camera.PerspCameraBuilder;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.OrthoCameraBuilder;
import org.gephi.visualization.data.camera.PerspCameraBuilder;
import org.gephi.visualization.rendering.command.Command;
import org.gephi.visualization.rendering.command.CommandListBuilders;
@@ -18,9 +18,9 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
import org.gephi.math.linalg.Mat4;
import org.gephi.math.Mat4;
/**
*
@@ -28,8 +28,8 @@ import org.gephi.math.linalg.Mat4;
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public abstract class Camera {
public final float near;
public final float far;
protected float near;
protected float far;
protected RenderArea area;
protected Mat4 viewMatrix;
@@ -0,0 +1,79 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.data.camera;
import org.gephi.math.Mat4;
import org.gephi.math.Mat4M;
/**
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public abstract class Camera2 {
protected float near;
protected float far;
protected RenderArea area;
protected final Mat4M viewMatrix;
protected final Mat4M projMatrix;
public Camera2() {
this.near = 0.0f;
this.far = 0.0f;
this.area = null;
this.viewMatrix = new Mat4M(1.0f);
this.projMatrix = new Mat4M(1.0f);
}
public float near() {
return near;
}
public float far() {
return far;
}
public Mat4 viewMatrix(RenderArea area) {
if (this.area != area) {
this.area = area;
recomputeMatrices();
}
return this.viewMatrix;
}
public Mat4 projMatrix(RenderArea area) {
if (this.area != area) {
this.area = area;
recomputeMatrices();
}
return this.projMatrix;
}
public Mat4 viewProjMatrix(RenderArea area) {
if (this.area != area) {
this.area = area;
recomputeMatrices();
}
return this.projMatrix.times(this.viewMatrix);
}
protected abstract void recomputeMatrices();
}
@@ -18,7 +18,7 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
/**
* Immutable size of an image.
@@ -18,17 +18,17 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
import org.gephi.math.linalg.Mat4;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Mat4;
import org.gephi.math.Vec2;
/**
* Orthographic camera used for 2D rendering.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public final class OrthoCamera extends Camera {
public class OrthoCamera extends Camera {
public final Vec2 center;
public final float height;
@@ -0,0 +1,56 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.data.camera;
import org.gephi.math.Vec2;
import org.gephi.math.Vec2M;
/**
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class OrthoCamera2 extends Camera2 {
public final Vec2M center;
public float height;
public OrthoCamera2(Vec2 center, float height) {
this.center = center.copyM();
this.height = height;
}
public OrthoCamera2 near(float near) {
this.near = near;
return this;
}
public OrthoCamera2 far(float far) {
this.far = far;
return this;
}
@Override
protected void recomputeMatrices() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
@@ -18,9 +18,9 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
import org.gephi.visualization.camera.Camera2d;
import org.gephi.visualization.data.graph.VizNode2D;
@@ -18,10 +18,10 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
import org.gephi.math.linalg.Mat4;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Mat4;
import org.gephi.math.Vec3;
/**
*
@@ -18,9 +18,9 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.visualization.camera.Camera3d;
import org.gephi.visualization.data.graph.VizNode3D;
@@ -18,7 +18,7 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
/**
*
@@ -18,7 +18,7 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
/**
*
@@ -18,7 +18,7 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.camera;
package org.gephi.visualization.data.camera;
/**
* Data used to draw a screenshot.
@@ -21,7 +21,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.data.graph;
import org.gephi.graph.api.NodeShape;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
import org.gephi.visualization.api.Color;
/**
@@ -21,7 +21,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.data.graph;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.Color;
/**
@@ -20,7 +20,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.data.graph;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
import org.gephi.visualization.api.Color;
/**
@@ -20,7 +20,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.data.graph;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.Color;
/**
@@ -21,7 +21,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.data.graph;
import org.gephi.graph.api.NodeShape;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
import org.gephi.visualization.api.Color;
/**
@@ -21,7 +21,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.data.graph;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.Color;
/**
@@ -18,9 +18,10 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.buffer;
package org.gephi.visualization.drawcall;
import java.nio.ByteBuffer;
import org.gephi.visualization.rendering.command.Technique;
/**
* It represents a draw call using index and vertex buffers.
@@ -28,6 +29,10 @@ import java.nio.ByteBuffer;
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class DrawCall {
/**
* Technique which should be used to draw execute this draw call.
*/
public final Technique<DrawCall> technique;
/**
* Buffer containing the vertex data for this draw call.
@@ -65,6 +70,7 @@ public class DrawCall {
/**
* Creates a draw call from its public final fields.
*
* @param technique the technique which should be used to execture this
* @param vertexBuffer the vertex buffer
* @param indexBuffer the index buffer
* @param start the position of the first index
@@ -72,8 +78,9 @@ public class DrawCall {
* @param mode the drawing mode
* @param type the type of the indexes
*/
public DrawCall(ByteBuffer vertexBuffer, ByteBuffer indexBuffer, int start,
int count, int mode, int type) {
public DrawCall(Technique<DrawCall> technique, ByteBuffer vertexBuffer,
ByteBuffer indexBuffer, int start, int count, int mode, int type) {
this.technique = technique;
this.vertexBuffer = vertexBuffer;
this.indexBuffer = indexBuffer;
this.start = start;
@@ -0,0 +1,34 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.drawcall;
import java.util.List;
/**
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public interface DrawCallBuilder<E> {
public DrawCall add(MemoryPool memory, E e);
public List<DrawCall> create();
}
@@ -18,7 +18,7 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.buffer;
package org.gephi.visualization.drawcall;
import com.jogamp.common.nio.Buffers;
import java.nio.ByteBuffer;
@@ -0,0 +1,66 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.drawcall;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.command.Technique;
/**
* Creates a new Technique to process draw calls using vertex arrays or VBOs or
* VAOs based on the OpenGL version.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class TechniqueFactory {
private final Type type;
public TechniqueFactory(GL gl) {
/*
if (gl.isExtensionAvailable("GL_VERSION_3_1")) {
type = Type.VAO;
} else if (gl.isExtensionAvailable("GL_VERSION_1_5")) {
type = Type.VBO;
} else {
type = Type.VA;
}
*/
type = Type.VA; // it is the only class implemented so far
}
public Technique<DrawCall> create(TechniqueImpl impl) {
switch (type) {
case VA:
return new TechniqueVA(impl);
case VBO:
return new TechniqueVBO(impl);
case VAO:
return new TechniqueVAO(impl);
default:
// it shouldn't be possible to reach the following line of code
assert false : type;
return null;
}
}
private enum Type {
VA, VBO, VAO
}
}
@@ -18,11 +18,11 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.buffer;
package org.gephi.visualization.drawcall;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
/**
*
@@ -18,11 +18,11 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.buffer;
package org.gephi.visualization.drawcall;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.Technique;
/**
@@ -0,0 +1,63 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.drawcall;
import javax.media.opengl.GL;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.Technique;
/**
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class TechniqueVAO implements Technique<DrawCall> {
TechniqueVAO(TechniqueImpl impl) {
throw new UnsupportedOperationException("Not yet implemented");
}
@Override
public boolean begin(GL gl, Camera camera, RenderArea renderArea, boolean reuseResources) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean advanceToNextPass(GL gl) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void draw(GL gl, DrawCall e) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void end(GL gl) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void dispose(GL gl) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
@@ -0,0 +1,63 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.drawcall;
import javax.media.opengl.GL;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.Technique;
/**
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class TechniqueVBO implements Technique<DrawCall> {
TechniqueVBO(TechniqueImpl impl) {
throw new UnsupportedOperationException("Not yet implemented");
}
@Override
public boolean begin(GL gl, Camera camera, RenderArea renderArea, boolean reuseResources) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean advanceToNextPass(GL gl) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void draw(GL gl, DrawCall e) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void end(GL gl) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void dispose(GL gl) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
@@ -0,0 +1,216 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.drawcall.edge;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.math.Vec2;
import org.gephi.math.Vec2M;
import org.gephi.visualization.api.Color;
import org.gephi.visualization.data.graph.VizEdge2D;
import org.gephi.visualization.data.graph.VizEdgeShape;
import org.gephi.visualization.drawcall.DrawCall;
import org.gephi.visualization.drawcall.DrawCallBuilder;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.drawcall.TechniqueFactory;
import org.gephi.visualization.rendering.command.Technique;
/**
* This class creates the draw calls for the edges which are not edge loops.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class Edge2DDrawCallBuilder implements DrawCallBuilder<VizEdge2D> {
protected static final int VERTEX_SIZE = 3*4;
protected static final int INDEX_SIZE = 2;
private final Technique<DrawCall> technique;
private ByteBuffer vertexBuffer;
private ByteBuffer indexBuffer;
private int start;
public Edge2DDrawCallBuilder(TechniqueFactory factory) {
this.technique = factory.create(new Edge2DTechniqueFixedImpl());
this.vertexBuffer = null;
this.indexBuffer = null;
this.start = 0;
}
@Override
@SuppressWarnings("fallthrough")
public DrawCall add(MemoryPool memory, VizEdge2D e) {
if (e.shape == VizEdgeShape.EDGE_LOOP) return null;
if (this.vertexBuffer == null) {
this.vertexBuffer = memory.newBuffer();
}
if (this.indexBuffer == null) {
this.indexBuffer = memory.newBuffer();
this.start = 0;
}
int requiredVertexSize = VERTEX_SIZE * 4;
int requiredIndexSize = INDEX_SIZE * 6;
if (e.shape == VizEdgeShape.STRAIGHT_EDGE_BIDIRECTIONAL) {
requiredVertexSize += VERTEX_SIZE * 6;
requiredIndexSize += INDEX_SIZE * 6;
} else if (e.shape == VizEdgeShape.STRAIGHT_EDGE_DIRECTIONAL) {
requiredVertexSize += VERTEX_SIZE * 3;
requiredIndexSize += INDEX_SIZE * 3;
}
boolean vBuffFull = requiredVertexSize > this.vertexBuffer.remaining();
boolean iBuffFull = requiredIndexSize > this.indexBuffer.remaining();
final DrawCall result = vBuffFull && iBuffFull ?
new DrawCall(this.technique, this.vertexBuffer,
this.indexBuffer, start,
(this.indexBuffer.position() - start)/INDEX_SIZE,
GL.GL_TRIANGLES, GL.GL_UNSIGNED_SHORT) : null;
if (vBuffFull) {
this.vertexBuffer = memory.newBuffer();
}
if (iBuffFull) {
this.indexBuffer = memory.newBuffer();
this.start = 0;
} else {
this.start = this.indexBuffer.position();
}
final Vec2 diff = e.destinationPosition.minus(e.sourcePosition);
final float len = diff.length();
final Vec2 d = diff.normalized();
final Vec2 d_perp = d.perp();
final int startIdx = vertexBuffer.position() / VERTEX_SIZE;
final Vec2M vert = e.sourcePosition.plusM(e.thickness, d_perp);
e.gradientStart.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
vert.minusEq(2.0f * e.thickness, d_perp);
e.gradientStart.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
vert.add(e.destinationPosition, - e.thickness, d_perp);
e.gradientEnd.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
vert.plusEq(2.0f * e.thickness, d_perp);
e.gradientEnd.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
this.indexBuffer.putShort((short)(startIdx));
this.indexBuffer.putShort((short)(startIdx + 2));
this.indexBuffer.putShort((short)(startIdx + 1));
this.indexBuffer.putShort((short)(startIdx));
this.indexBuffer.putShort((short)(startIdx + 3));
this.indexBuffer.putShort((short)(startIdx + 2));
int triStart = startIdx + 4;
float t;
Color g;
switch (e.shape) {
case STRAIGHT_EDGE_BIDIRECTIONAL:
vert.add(e.sourcePosition, e.sourceSize, d);
t = e.sourceSize / len;
g = Color.lerp(1.0f - t, e.gradientStart, t, e.gradientEnd);
g.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
vert.plusEq(3.0f * e.thickness, d).minusEq(3.0f * e.thickness, d_perp);
t += (3.0f * e.thickness) / len;
g = Color.lerp(1.0f - t, e.gradientEnd, t, e.gradientStart);
g.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
vert.plusEq(6.0f * e.thickness, d_perp);
g.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
this.indexBuffer.putShort((short)triStart);
this.indexBuffer.putShort((short)(triStart + 1));
this.indexBuffer.putShort((short)(triStart + 2));
triStart += 3;
// continue in the following case
case STRAIGHT_EDGE_DIRECTIONAL:
vert.sub(e.destinationPosition, e.destinationSize, d);
t = e.destinationSize / len;
g = Color.lerp(1.0f - t, e.gradientEnd, t, e.gradientStart);
g.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
vert.minusEq(3.0f * e.thickness, d).plusEq(3.0f * e.thickness, d_perp);
t += (3.0f * e.thickness) / len;
g = Color.lerp(1.0f - t, e.gradientEnd, t, e.gradientStart);
g.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
vert.minusEq(6.0f * e.thickness, d_perp);
g.writeRGBA8To(this.vertexBuffer);
this.vertexBuffer.putFloat(vert.x());
this.vertexBuffer.putFloat(vert.y());
this.indexBuffer.putShort((short)triStart);
this.indexBuffer.putShort((short)(triStart + 2));
this.indexBuffer.putShort((short)(triStart + 3));
break;
case STRAIGHT_EDGE_NO_DIRECTION:
default:
/* DO NOTHING */
}
return result;
}
@Override
public List<DrawCall> create() {
if (this.vertexBuffer == null || this.vertexBuffer.position() == 0 ||
this.indexBuffer == null || this.indexBuffer.position() == 0) {
return Collections.emptyList();
}
DrawCall result = new DrawCall(this.technique, this.vertexBuffer,
this.indexBuffer, start,
(this.indexBuffer.position() - start)/INDEX_SIZE,
GL.GL_TRIANGLES, GL.GL_UNSIGNED_SHORT);
this.vertexBuffer = null;
this.indexBuffer = null;
this.start = 0;
return Collections.singletonList(result);
}
}
@@ -0,0 +1,120 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.drawcall.edge;
import java.nio.ByteBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.drawcall.DrawCall;
import org.gephi.visualization.drawcall.TechniqueImpl;
/**
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
class Edge2DTechniqueFixedImpl implements TechniqueImpl {
@Override
public boolean begin(GL gl, Camera camera, RenderArea renderArea) {
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glDepthMask(false);
GL2 gl2 = gl.getGL2();
if (gl2 == null) return false;
gl2.glMatrixMode(GL2.GL_PROJECTION);
gl2.glLoadMatrixf(camera.projMatrix(renderArea).toArray(), 0);
gl2.glMatrixMode(GL2.GL_MODELVIEW);
gl2.glLoadMatrixf(camera.viewMatrix(renderArea).toArray(), 0);
return true;
}
@Override
public void enableClientStates(GL gl, int currentPass) {
GL2 gl2 = gl.getGL2();
if (gl2 == null) return;
gl2.glEnableClientState(GL2.GL_COLOR_ARRAY);
gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY);
}
@Override
public void initPass(GL gl, int currentPass) {
assert currentPass == 0 : currentPass;
// Nothing to set..
}
@Override
public void endPass(GL gl, int currentPass) {
assert currentPass == 0 : currentPass;
// Nothing to reset
}
@Override
public void disableClientStates(GL gl, int currentPass) {
GL2 gl2 = gl.getGL2();
if (gl2 == null) return;
gl2.glDisableClientState(GL2.GL_COLOR_ARRAY);
gl2.glDisableClientState(GL2.GL_VERTEX_ARRAY);
}
@Override
public int numberOfPasses() {
return 1;
}
@Override
public void end(GL gl) {
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glDepthMask(true);
}
@Override
public void dispose(GL gl) {
// Empty block
}
@Override
public void setPointers(GL gl, DrawCall e, int currentPass) {
assert currentPass == 0 : currentPass;
GL2 gl2 = gl.getGL2();
if (gl2 == null) return;
final ByteBuffer vert = e.vertexBuffer;
final int oldPos = vert.position();
vert.position(0);
gl2.glColorPointer(4, GL.GL_UNSIGNED_BYTE, Edge2DDrawCallBuilder.VERTEX_SIZE, vert);
vert.position(4);
gl2.glVertexPointer(2, GL.GL_FLOAT, Edge2DDrawCallBuilder.VERTEX_SIZE, vert);
vert.position(oldPos);
}
}
@@ -31,7 +31,7 @@ import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.gephi.graph.api.Node;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.MotionManager;
import org.gephi.visualization.api.VisualizationController;
import org.gephi.visualization.api.event.VizEvent;
@@ -0,0 +1,30 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.framedata;
/**
* Visualization data for a single frame.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class FrameData {
}
@@ -0,0 +1,39 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.framedata;
import org.gephi.visualization.drawcall.MemoryPool;
/**
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
class FrameDataM extends FrameData {
private final MemoryPool memory;
FrameDataM() {
this.memory = new MemoryPool();
}
void reset() {
this.memory.recycleAll();
}
}
@@ -26,7 +26,7 @@ import org.gephi.visualization.data.graph.styler.EdgeStyler;
import org.gephi.graph.api.MetaEdge;
import org.gephi.graph.api.Node;
import org.gephi.graph.api.NodeData;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
import org.gephi.visualization.api.Color;
import org.gephi.visualization.api.vizmodel.VizConfig;
import org.gephi.visualization.api.vizmodel.VizModel;
@@ -23,8 +23,8 @@ package org.gephi.visualization.model.styler;
import org.gephi.graph.api.Node;
import org.gephi.graph.api.NodeShape;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec2;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.Color;
import org.gephi.visualization.api.vizmodel.VizConfig;
import org.gephi.visualization.api.vizmodel.VizModel;
@@ -23,7 +23,7 @@ package org.gephi.visualization.rendering.apiimpl.command.edge;
import java.nio.ByteBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import org.gephi.math.linalg.Vec2M;
import org.gephi.math.Vec2M;
import org.gephi.visualization.data.graph.VizEdge2D;
import org.gephi.visualization.data.graph.VizEdgeShape;
import org.gephi.visualization.rendering.command.buffer.Layout;
@@ -23,9 +23,8 @@ package org.gephi.visualization.rendering.apiimpl.command.edge;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import org.gephi.visualization.data.graph.VizEdge2D;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.OrthoCamera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.buffer.Buffer.Type;
import org.gephi.visualization.rendering.command.buffer.BufferedTechnique;
@@ -50,7 +49,7 @@ public class EdgeBody2DTechniqueGL12 extends BufferedTechnique<VizEdge2D> {
@Override
protected boolean setCamera(GL gl, Camera camera, RenderArea renderArea) {
GL2 gl2 = gl.getGL2();
if (gl2 == null || !(camera instanceof OrthoCamera)) return false;
if (gl2 == null) return false;
gl2.glMatrixMode(GL2.GL_PROJECTION);
@@ -23,7 +23,7 @@ package org.gephi.visualization.rendering.apiimpl.command.edge;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.visualization.data.graph.VizEdge2D;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.rendering.command.Command;
import org.gephi.visualization.rendering.command.CommandListBuilder;
import org.gephi.visualization.rendering.command.buffer.Buffer;
@@ -28,7 +28,7 @@ import java.util.Map;
import javax.media.opengl.GL;
import org.gephi.graph.api.NodeShape;
import org.gephi.visualization.data.graph.VizNode2D;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.rendering.command.Command;
import org.gephi.visualization.rendering.command.CommandListBuilder;
import org.gephi.visualization.rendering.command.buffer.Buffer;
@@ -22,8 +22,8 @@ package org.gephi.visualization.rendering.apiimpl.command.node;
import javax.media.opengl.GL;
import org.gephi.visualization.data.graph.VizNode3D;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.Technique;
/**
@@ -27,9 +27,8 @@ import javax.media.opengl.GL2;
import org.gephi.graph.api.NodeShape;
import org.gephi.visualization.data.graph.VizNode2D;
import org.gephi.visualization.rendering.apiimpl.command.node.texture.Node2DTextureBuilder;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.OrthoCamera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.buffer.Buffer;
import org.gephi.visualization.rendering.command.buffer.BufferedTechnique;
@@ -141,7 +140,7 @@ public final class Shape2DTechniqueGL12 extends BufferedTechnique<VizNode2D> {
@Override
protected boolean setCamera(GL gl, Camera camera, RenderArea renderArea) {
GL2 gl2 = gl.getGL2();
if (gl2 == null || !(camera instanceof OrthoCamera)) return false;
if (gl2 == null) return false;
gl2.glMatrixMode(GL2.GL_PROJECTION);
@@ -20,7 +20,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.rendering.apiimpl.command.node.texture;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
/**
* Creates a regular polygon texture.
@@ -24,13 +24,13 @@ import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.gl2.GLUgl2;
import org.gephi.math.linalg.Vec2M;
import org.gephi.math.Vec2M;
import org.gephi.visualization.api.view.ui.UIShape;
import org.gephi.visualization.api.view.ui.UIShape.UIConvexPolygon;
import org.gephi.visualization.api.view.ui.UIShape.UIEllipse;
import org.gephi.visualization.api.view.ui.UIStyle;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.Technique;
/**
@@ -21,8 +21,8 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.rendering.command;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
/**
* A Rendering Command contains a list of objects to draw using the same
@@ -22,7 +22,7 @@ package org.gephi.visualization.rendering.command;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.drawcall.MemoryPool;
/**
* A command list builder creates a list of rendering commands from a list of
@@ -22,8 +22,8 @@ package org.gephi.visualization.rendering.command;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
/**
* Generic implementation of command. This implementation works equally well
@@ -7,7 +7,7 @@ package org.gephi.visualization.rendering.command;
import java.util.Collections;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.drawcall.MemoryPool;
/**
*
@@ -21,8 +21,8 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.rendering.command;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
/**
* A rendering technique is a class which can be used to draw some kind of
@@ -22,7 +22,7 @@ package org.gephi.visualization.rendering.command.buffer;
import java.nio.ByteBuffer;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.drawcall.MemoryPool;
/**
* Generic implementation of a Buffer. The behavior is controlled by the Layout
@@ -24,7 +24,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.rendering.command.Command;
import org.gephi.visualization.rendering.command.CommandListBuilder;
import org.gephi.visualization.rendering.command.GenericCommand;
@@ -21,8 +21,8 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.rendering.command.buffer;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.camera.Camera;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.Technique;
/**
@@ -24,7 +24,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.visualization.rendering.buffer.MemoryPool;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.rendering.command.Command;
import org.gephi.visualization.rendering.command.CommandListBuilder;
import org.gephi.visualization.rendering.command.GenericCommand;
@@ -32,8 +32,8 @@ import org.gephi.visualization.api.vizmodel.VizConfig;
import org.gephi.visualization.api.vizmodel.VizModel;
import org.gephi.visualization.data.FrameData;
import org.gephi.visualization.rendering.RenderingEngine;
import org.gephi.visualization.rendering.camera.Rectangle;
import org.gephi.visualization.rendering.camera.RenderArea;
import org.gephi.visualization.data.camera.Rectangle;
import org.gephi.visualization.data.camera.RenderArea;
/**
*
@@ -0,0 +1,119 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.renderqueue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.media.opengl.GL;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.drawcall.DrawCall;
import org.gephi.visualization.drawcall.DrawCallBuilder;
import org.gephi.visualization.drawcall.MemoryPool;
import org.gephi.visualization.rendering.command.Technique;
/**
* Render queue implementation which render several objects in the same batch.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
class BufferedRenderQueueImpl<E> implements RenderQueueImpl<E> {
private final MemoryPool memory;
private final List<DrawCallBuilder<E>> builders;
private final Map<Technique, Integer> techniqueMap;
private final List<List<DrawCall>> drawCalls;
public BufferedRenderQueueImpl(MemoryPool memory,
List<DrawCallBuilder<E>> builders) {
this.memory = memory;
this.builders = builders;
this.techniqueMap = new HashMap<Technique, Integer>();
this.drawCalls = new ArrayList<List<DrawCall>>();
}
@Override
public void makeDrawable() {
for (DrawCallBuilder<E> b : this.builders) {
List<DrawCall> dcs = b.create();
for (DrawCall dc : dcs) {
addDrawCall(dc);
}
}
}
@Override
public void makeEditable() {
/* EMPTY BLOCK */
}
@Override
public void add(E e) {
for (DrawCallBuilder<E> b : this.builders) {
DrawCall dc = b.add(this.memory, e);
addDrawCall(dc);
}
}
private void addDrawCall(DrawCall drawCall) {
if (drawCall == null) return;
if (this.techniqueMap.containsKey(drawCall.technique)) {
final int i = this.techniqueMap.get(drawCall.technique);
this.drawCalls.get(i).add(drawCall);
} else {
final ArrayList<DrawCall> lst = new ArrayList<DrawCall>();
lst.add(drawCall);
this.drawCalls.add(lst);
this.techniqueMap.put(drawCall.technique, this.drawCalls.size() - 1);
}
}
@Override
public void clearQueue() {
this.techniqueMap.clear();
this.drawCalls.clear();
}
@Override
public void draw(GL gl, Camera camera, RenderArea area, int drawCalls) {
for (List<DrawCall> dcs : this.drawCalls) {
assert dcs.size() > 0 : dcs.size();
final Technique<DrawCall> technique = dcs.get(0).technique;
if (!technique.begin(gl, camera, area, drawCalls > 0)) return;
while (technique.advanceToNextPass(gl)) {
for (DrawCall dc : dcs) {
technique.draw(gl, dc);
}
}
technique.end(gl);
}
}
}
@@ -0,0 +1,77 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.renderqueue;
import java.util.ArrayList;
import java.util.List;
import javax.media.opengl.GL;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
import org.gephi.visualization.rendering.command.Technique;
/**
* Render queue implementation which simply draw a list of objects.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
class InstancedRenderQueueImpl<E> implements RenderQueueImpl<E> {
private final List<E> elements;
private final Technique<E> technique;
public InstancedRenderQueueImpl(Technique<E> technique) {
this.elements = new ArrayList<E>();
this.technique = technique;
}
@Override
public void makeDrawable() {
/* EMPTY BLOCK */
}
@Override
public void makeEditable() {
/* EMPTY BLOCK */
}
@Override
public void add(E e) {
this.elements.add(e);
}
@Override
public void clearQueue() {
this.elements.clear();
}
@Override
public void draw(GL gl, Camera camera, RenderArea area, int drawCalls) {
if (!this.technique.begin(gl, camera, area, drawCalls > 0)) return;
while (this.technique.advanceToNextPass(gl)) {
for (E e : this.elements) {
this.technique.draw(gl, e);
}
}
this.technique.end(gl);
}
}
@@ -0,0 +1,149 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.renderqueue;
import javax.media.opengl.GL;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
/**
* A <code>RenderQueue</code> represents a list of rendering commands needed to
* draw a set of objects of the same type. It may be in one of the two states:
* EDITABLE and DRAWABLE. In the EDITABLE state additional objects can be added
* to the rendering queue, while in the DRAWABLE state the content is fixed
* and it is only possible to draw them (and come back to the EDITABLE state).
* The <code>makeEditable</code> and <code>makeDrawable</code> methods should
* be used to change the current state of the class. It uses the bridge pattern
* to maintain some common behaviour while changing the implementation. It is
* not thread-safe.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class RenderQueue<E> {
/** Possible states in which a <code>RenderQueue</code> can stay. */
private enum State {
/** The <code>RenderQueue</code> can be modified adding new objects. */
EDITABLE,
/** The <code>RenderQueue</code> can only be rendered. */
DRAWABLE
}
/** Current state of this class. */
private State state;
/**
* Number of times this queue has been rendered from the last time it became
* drawable.
*/
private int drawCalls;
/**
* Internal implementation of a <code>RenderQueue</code>.
*/
private final RenderQueueImpl<E> impl;
/**
* Creates a new <code>RenderQueue</code> from its implementaion.
*
* @param impl the implementation
*/
RenderQueue(RenderQueueImpl<E> impl) {
this.state = State.EDITABLE;
this.drawCalls = 0;
this.impl = impl;
}
/** Change the state to DRAWABLE. */
public final void makeDrawable() {
if (isDrawable()) return;
this.state = State.DRAWABLE;
this.drawCalls = 0;
impl.makeDrawable();
}
/**
* Query if this class is drawable.
* @return <code>true</code> if the state of this class is DRAWABLE,
* <code>false</code> otherwise
*/
public final boolean isDrawable() {
return this.state == State.DRAWABLE;
}
/** Change the state to DRAWABLE. */
public final void makeEditable() {
if (isEditable()) return;
this.state = State.EDITABLE;
impl.makeEditable();
}
/**
* Query if this class is editable.
* @return <code>true</code> if the state of this class is EDITABLE,
* <code>false</code> otherwise
*/
public final boolean isEditable() {
return this.state == State.EDITABLE;
}
/**
* Adds an element to this queue if this class is editable.
* @param e the element to add to the queue
*/
public final void add(E e) {
if (!isEditable()) {
assert false : this.state; // crash in debug
return;
}
impl.add(e);
}
/** Clears the queue of objects to draw if this is editable. */
public final void clearQueue() {
if (!isEditable()) {
assert false : this.state; // crash in debug
return;
}
impl.clearQueue();
}
/**
* Draws the current queue on screen if this is drawable.
*
* @param gl the GL object
* @param camera the current camera
* @param area the region of the screen used for rendering
*/
public final void draw(GL gl, Camera camera, RenderArea area) {
if (!isDrawable()) {
assert false : this.state; // crash in debug
return;
}
impl.draw(gl, camera, area, this.drawCalls);
++this.drawCalls;
}
}
@@ -0,0 +1,55 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.renderqueue;
import org.gephi.visualization.api.view.ui.UIShape;
import org.gephi.visualization.data.graph.VizEdge2D;
import org.gephi.visualization.data.graph.VizEdge3D;
import org.gephi.visualization.data.graph.VizNode2D;
import org.gephi.visualization.data.graph.VizNode3D;
import org.gephi.visualization.drawcall.MemoryPool;
/**
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
public class RenderQueueFactory {
public RenderQueue<VizNode2D> newNode2DRenderQueue(MemoryPool memory) {
throw new UnsupportedOperationException("Not supported yet.");
}
public RenderQueue<VizNode3D> newNode3DRenderQueue(MemoryPool memory) {
throw new UnsupportedOperationException("Not supported yet.");
}
public RenderQueue<VizEdge2D> newEdge2DRenderQueue(MemoryPool memory) {
throw new UnsupportedOperationException("Not supported yet.");
}
public RenderQueue<VizEdge3D> newEdge3DRenderQueue(MemoryPool memory) {
throw new UnsupportedOperationException("Not supported yet.");
}
public RenderQueue<UIShape> newUIRenderQueue(MemoryPool memory) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
@@ -0,0 +1,62 @@
/*
Copyright 2008-2011 Gephi
Authors : Antonio Patriarca <antoniopatriarca@gmail.com>
Website : http://www.gephi.org
This file is part of Gephi.
Gephi is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Gephi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.renderqueue;
import javax.media.opengl.GL;
import org.gephi.visualization.data.camera.Camera;
import org.gephi.visualization.data.camera.RenderArea;
/**
* Implementation of a <code>RenderQueue</code>. Classes implementing this
* interface may assume all the states are correctly handles by the
* <code>RenderQueue</code> which contains it. Implementations do not have to
* be thread-safe since the <code>RenderQueue</code> objects are not
* thread-safe.
*
* @author Antonio Patriarca <antoniopatriarca@gmail.com>
*/
interface RenderQueueImpl<E> {
/** Change the state to DRAWABLE. */
public void makeDrawable();
/** Change the state to EDITABLE. */
public void makeEditable();
/**
* Adds an element to this queue if this class is editable.
* @param e the element to add to the queue
*/
public void add(E e);
/** Clears the queue of objects to draw if this is editable. */
public void clearQueue();
/**
* Draws the current queue on screen if this is drawable.
*
* @param gl the GL object
* @param camera the current camera
* @param area the region of the screen used for rendering
* @param drawCalls the number of times this method has been called
*/
public void draw(GL gl, Camera camera, RenderArea area, int drawCalls);
}
@@ -25,8 +25,8 @@ import java.awt.Font;
import java.util.Map;
import org.gephi.data.attributes.api.AttributeColumn;
import org.gephi.graph.api.NodeShape;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec2;
import org.gephi.math.Vec3;
import org.gephi.ui.utils.ColorUtils;
import org.gephi.ui.utils.FontUtils;
import org.gephi.visualization.api.rendering.ScreenshotSettings;
@@ -34,8 +34,8 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import org.gephi.data.attributes.api.AttributeColumn;
import org.gephi.graph.api.NodeShape;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec2;
import org.gephi.math.Vec3;
import org.gephi.project.api.Workspace;
import org.gephi.ui.utils.ColorUtils;
import org.gephi.visualization.api.Camera;
@@ -21,8 +21,8 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.api;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.linalg.Vec3M;
import org.gephi.math.Vec3;
import org.gephi.math.Vec3M;
/**
*
@@ -62,11 +62,11 @@ public class AABB {
}
public Vec3 minVec() {
return this.minVec;
return this.minVec.copy();
}
public Vec3 maxVec() {
return this.maxVec;
return this.maxVec.copy();
}
public void addPoint(Vec3 point, Vec3 scale) {
@@ -22,8 +22,8 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.api;
import java.awt.Dimension;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.vizmodel.GraphLimits;
/**
@@ -258,6 +258,11 @@ public final class Color {
public Color clamp() {
return clamp(0.0f, 1.0f);
}
public static Color lerp(float s, Color c0, float t, Color c1) {
return new Color(s*c0.r + t*c1.r, s*c0.g + t*c1.g, s*c0.b + t*c1.b,
s*c0.a + t*c1.a);
}
/*
* Static methods.
@@ -23,7 +23,7 @@ package org.gephi.visualization.api;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec3;
import org.gephi.visualization.api.selection.Shape;
/**
@@ -20,7 +20,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.api.rendering.background;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
/**
* Defines how the background image is positioned on the screen or world.
@@ -20,7 +20,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
*/
package org.gephi.visualization.api.rendering.background;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
/**
* Defines how big the background image is. Inspired by the CSS
@@ -22,7 +22,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.api.view.ui;
import java.nio.ByteBuffer;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
/**
* 2D shape which can be drawn on screen for UI purposes.
@@ -22,8 +22,8 @@ package org.gephi.visualization.api.vizmodel;
import java.awt.Color;
import java.awt.Font;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.linalg.Vec3;
import org.gephi.math.Vec2;
import org.gephi.math.Vec3;
/**
* Visualization configuration interface that holds every visualization property
@@ -21,7 +21,7 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.apiimpl.shape;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
import org.gephi.visualization.api.selection.SelectionType;
import org.gephi.visualization.api.selection.Shape;
import org.gephi.visualization.api.view.ui.UIShape;
@@ -27,7 +27,7 @@ import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.Vec2;
import org.gephi.visualization.api.selection.SelectionType;
import org.gephi.visualization.api.selection.Shape;
import org.gephi.visualization.api.view.ui.UIShape;
@@ -21,8 +21,8 @@ along with Gephi. If not, see <http://www.gnu.org/licenses/>.
package org.gephi.visualization.apiimpl.shape;
import org.gephi.math.linalg.Vec2;
import org.gephi.math.linalg.Vec2M;
import org.gephi.math.Vec2;
import org.gephi.math.Vec2M;
import org.gephi.visualization.api.selection.SelectionType;
import org.gephi.visualization.api.selection.Shape;
import org.gephi.visualization.api.view.ui.UIShape;