|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.grogra.ext.x3d.util.Util
public class Util
This class provides usefull static methods for recurring tasks.
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static int |
colorToInt(Tuple3f color)
Converts a Tuple3f color object (range from 0-1) to an int color. |
static int |
colorToInt(Tuple4f color)
Converts a Tuple4f color object (range from 0-1) to an int color. |
static AxisAngle4d |
convertStringToAxisAngle4d(AxisAngle4d result,
java.lang.String value)
Split string and convert into groimp coordinates. |
static Tuple3d |
convertStringToTuple3d(Tuple3d result,
java.lang.String value)
Split string and convert into groimp coordinates. |
static Tuple3f |
convertStringToTuple3f(Tuple3f result,
java.lang.String value)
Split string and convert into groimp coordinates. |
static Tuple4f |
convertStringToTuple4f(Tuple4f result,
java.lang.String value)
Split string and convert into groimp coordinates. |
static Vector3d |
findOrthogonalVector(Vector3d vec1)
Returns an orthogonal vector to given vector. |
static ImageAdapter |
getImageForURL(java.util.List<java.lang.String> imgURL,
java.util.HashMap<java.lang.String,java.lang.String> valueMap,
boolean saveInGroIMP)
|
static ImageAdapter |
getImageForURL(java.lang.String imgUrl,
boolean saveInGroIMP)
|
static java.lang.String |
getRealPath(java.io.File file)
Extract the path-part as a String from the URL. |
static java.lang.String |
getRealPath(java.net.URL url)
Extract the path-part as a String from the URL. |
static float |
intToGray(int color)
|
static RGBColor |
intToRGB(int color)
|
static int |
overlapPixel(int background,
int foreground)
Calculates to an background pixel a new foreground pixel in consideration of transparency of foreground pixel. |
static boolean |
pointsOnLine(java.util.ArrayList<Point3d> points)
Checks if given points are on a straight line. |
static int |
round(double value)
Rounds the value with the Math.round() function and casts the result to int. |
static float[] |
splitStringToArray2f(java.lang.String value)
|
static float[] |
splitStringToArray2f(java.lang.String value,
float default1,
float default2)
|
static double[] |
splitStringToArray3d(java.lang.String value)
|
static double[] |
splitStringToArray3d(java.lang.String value,
double default1,
double default2,
double default3)
|
static float[] |
splitStringToArray3f(java.lang.String value)
|
static float[] |
splitStringToArray3f(java.lang.String value,
float default1,
float default2,
float default3)
|
static double[] |
splitStringToArray4d(java.lang.String value)
Split String on Whitespaces and return values as double-Array |
static double[] |
splitStringToArray4d(java.lang.String value,
double default1,
double default2,
double default3,
double default4)
Split String on Whitespaces and return values as double-Array |
static float[] |
splitStringToArray4f(java.lang.String value)
Split String on Whitespaces and return values as double-Array |
static float[] |
splitStringToArray4f(java.lang.String value,
float default1,
float default2,
float default3,
float default4)
Split String on Whitespaces and return values as double-Array |
static double[] |
splitStringToArrayOfDouble(java.lang.String value)
|
static double[] |
splitStringToArrayOfDouble(java.lang.String value,
double[] def)
|
static float[] |
splitStringToArrayOfFloat(java.lang.String value)
|
static float[] |
splitStringToArrayOfFloat(java.lang.String value,
float[] defaultArray)
|
static int[] |
splitStringToArrayOfInt(java.lang.String value)
|
static int[] |
splitStringToArrayOfInt(java.lang.String value,
int[] defaultArray)
|
static java.lang.String[] |
splitStringToArrayOfString(java.lang.String value)
Splits a string containing multiple strings to an array of strings. |
static java.lang.String[] |
splitStringToArrayOfString(java.lang.String value,
java.lang.String[] def)
Splits a string containing multiple strings to an array of strings. |
static AxisAngle4d |
splitStringToAxisAngle4d(AxisAngle4d result,
java.lang.String value)
Split string without convert. |
static java.util.List<java.lang.String> |
splitStringToListOfStrings(java.lang.String value)
|
static Tuple2f |
splitStringToTuple2f(Tuple2f result,
java.lang.String value)
|
static Tuple3d |
splitStringToTuple3d(Tuple3d result,
java.lang.String value)
Split string without convert. |
static Tuple3f |
splitStringToTuple3f(Tuple3f result,
java.lang.String value)
Split string without convert. |
static Tuple4f |
splitStringToTuple4f(Tuple4f result,
java.lang.String value)
Split string without convert. |
static Matrix4d |
vectorsToTransMatrix(Vector3d vec1,
Vector3d vec2)
This methode returns a transformation matrix with a rotational component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static int colorToInt(Tuple3f color)
color
-
public static int colorToInt(Tuple4f color)
color
-
public static AxisAngle4d convertStringToAxisAngle4d(AxisAngle4d result, java.lang.String value)
result
- AxisAngle4d resultvalue
- String value (must not be null!)
public static Tuple3d convertStringToTuple3d(Tuple3d result, java.lang.String value)
result
- Tuple3d resultvalue
- String value (must not be null!)
public static Tuple3f convertStringToTuple3f(Tuple3f result, java.lang.String value)
result
- Tuple3f resultvalue
- String value (must not be null!)
public static Tuple4f convertStringToTuple4f(Tuple4f result, java.lang.String value)
result
- Tuple4f resultvalue
- String value (must not be null!)
public static Vector3d findOrthogonalVector(Vector3d vec1)
vec1
-
public static ImageAdapter getImageForURL(java.util.List<java.lang.String> imgURL, java.util.HashMap<java.lang.String,java.lang.String> valueMap, boolean saveInGroIMP)
public static ImageAdapter getImageForURL(java.lang.String imgUrl, boolean saveInGroIMP)
public static java.lang.String getRealPath(java.io.File file)
File
- file
public static java.lang.String getRealPath(java.net.URL url)
URL
- url
public static float intToGray(int color)
public static RGBColor intToRGB(int color)
public static int overlapPixel(int background, int foreground)
background
- foreground
-
public static boolean pointsOnLine(java.util.ArrayList<Point3d> points)
vectors
-
public static int round(double value)
value
-
public static float[] splitStringToArray2f(java.lang.String value)
value
-
public static float[] splitStringToArray2f(java.lang.String value, float default1, float default2)
value
- String valuedefault1
- default2
-
public static double[] splitStringToArray3d(java.lang.String value)
value
-
public static double[] splitStringToArray3d(java.lang.String value, double default1, double default2, double default3)
value
- String valuedefault1
- default2
- default3
-
public static float[] splitStringToArray3f(java.lang.String value)
value
-
public static float[] splitStringToArray3f(java.lang.String value, float default1, float default2, float default3)
value
- String valuedefault1
- default2
- default3
-
public static double[] splitStringToArray4d(java.lang.String value)
value
-
public static double[] splitStringToArray4d(java.lang.String value, double default1, double default2, double default3, double default4)
value
- String valuedefault1
- default2
- default3
- default4
-
public static float[] splitStringToArray4f(java.lang.String value)
value
-
public static float[] splitStringToArray4f(java.lang.String value, float default1, float default2, float default3, float default4)
value
- String valuedefault1
- default2
- default3
- default4
-
public static double[] splitStringToArrayOfDouble(java.lang.String value)
value
- String with double values
public static double[] splitStringToArrayOfDouble(java.lang.String value, double[] def)
value
- String with double valuesdef
- default values
public static float[] splitStringToArrayOfFloat(java.lang.String value)
value
- String with float valuesdef
- default values
public static float[] splitStringToArrayOfFloat(java.lang.String value, float[] defaultArray)
value
- String with float valuesdef
- default values
public static int[] splitStringToArrayOfInt(java.lang.String value)
value
- String with int valuesdef
- default values
public static int[] splitStringToArrayOfInt(java.lang.String value, int[] defaultArray)
value
- String with int valuesdef
- default values
public static java.lang.String[] splitStringToArrayOfString(java.lang.String value)
value
- String with String valuesdef
- default values
public static java.lang.String[] splitStringToArrayOfString(java.lang.String value, java.lang.String[] def)
value
- String with String valuesdef
- default values
public static AxisAngle4d splitStringToAxisAngle4d(AxisAngle4d result, java.lang.String value)
result
- AxisAngle4d resultvalue
- String value (must not be null!)
public static java.util.List<java.lang.String> splitStringToListOfStrings(java.lang.String value)
public static Tuple2f splitStringToTuple2f(Tuple2f result, java.lang.String value)
result
- Tuple2f resultvalue
- String value (must not be null!)
public static Tuple3d splitStringToTuple3d(Tuple3d result, java.lang.String value)
result
- Tuple3d resultvalue
- String value (must not be null!)
public static Tuple3f splitStringToTuple3f(Tuple3f result, java.lang.String value)
result
- Tuple3f resultvalue
- String value (must not be null!)
public static Tuple4f splitStringToTuple4f(Tuple4f result, java.lang.String value)
result
- Tuple4f resultvalue
- String value (must not be null!)
public static Matrix4d vectorsToTransMatrix(Vector3d vec1, Vector3d vec2)
vec1
- vec2
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |