@PublicAPI public class SurfaceColoring extends java.lang.Object
SurfaceColoring sc = new SurfaceColoring(surface);
sc.setPropertyObject(myGrid);
sc.setPropertyMethod(myGrid.getClass().getMethod("get",
new Class[] {float.class, float.class, float.class} ));
sc.addColors( blue, cyan, green, yellow, red );
SurfaceColoring sc = new SurfaceColoring(molecules, surface);
sc.setPropertyMethod( myMolecule.getClass().getMethod("getAtomType", new Class[] {int.class}) );
// it has to have 1 int argument
// it will be called through getAtomProperty() of MoleculeInterface:
// ((MoleculeInterface)molecules.get(i)).getAtomProperty().getAtomType(atomIndex);
sc.setPropertyColorMapperMethod( getMethod( "getAtomColor", new Class[] {float.class} ) );
Modifier and Type | Field and Description |
---|---|
static int |
ATOM_PROPERTY_MAPPING
Coloring by mapping atom based property values to the surface.
|
static int |
BUILT_IN_CHAIN_MAPPING
Coloring by built-in chain colors.
|
static int |
BUILT_IN_CPK_MAPPING
Coloring by built-in cpk colors.
|
static int |
BUILT_IN_RAINBOW_MAPPING
Coloring by built-in rainbow colors.
|
static int |
BUILT_IN_RESIDUE_MAPPING
Coloring by built-in residue colors.
|
static int |
BUILT_IN_SECONDARY_STRUCTURE_MAPPING
Coloring by built-in secondary structure colors.
|
static int |
COLOR_MAPPER_BLUE_TO_GREEN
Built-in blue-cyan-green palette will be used.
|
static int |
COLOR_MAPPER_BLUE_TO_RED
Built-in blue-lightgray-red palette will be used.
|
static int |
COLOR_MAPPER_FIRE
Built-in "fire" palette will be used.
|
static int |
COLOR_MAPPER_GREEN_TO_BLUE
Built-in green-cyan-blue palette will be used.
|
static int |
COLOR_MAPPER_RAINBOW
Built-in rainbow palette will be used.
|
static int |
COLOR_MAPPER_RED_TO_BLUE
Built-in red-lightgray-blue palette will be used.
|
static int |
COLOR_MAPPER_REVERSE_RAINBOW
Built-in reverse rainbow palette will be used.
|
static int |
DECREASE_LINEAR
The property values will decrease when getting farther from the atom center.
|
static int |
DECREASE_RECIPROCAL_SQUARE
The property values will decrease when getting farther from the atom center.
|
static int |
DECREASE_SQUARE
The property values will decrease when getting farther from the atom center.
|
static int |
DISTANCE_CONSTANT
Is the distance measured from the atom center extended by a constant value.
|
static int |
DISTANCE_FROM_VDW
In case of distance weighted property mapping is the distance measured from the atom center
extended by the van der Waals radius.
|
static int |
DISTANCE_FROM_VDW_EXTENDED
Is the distance measured from the atom center extended by the van der Waals
radius plus a constant, typically the probe radius.
|
static int |
DISTANCE_WEIGHTED
Will all affecting properties be mapped onto the surface weighted by atom distances.
|
static int |
GRID_MAPPING
Coloring by mapping values form a grid to the surface.
|
static int |
MEAN_VALUE
Will the mean of the affecting properties be mapped onto the surface.
|
static int |
NEAREST_VALUE
Will only the property of the nearest atom be mapped onto the surface.
|
static int |
NO_DECREASE
The property values will not decrease when getting farther from the atom center.
|
static int |
RADIUS_CONSTANT
Is the atom property range a fix value
|
static int |
RADIUS_VDW
Is the atom property range the van der Waals radius
|
static int |
RADIUS_VDW_EXTENDED
Is the atom property range the van der Waals radius plus a fix value (for example the probe radius)
|
static int |
SUM_OF_VALUES
Will the sum of the affecting properties be mapped onto the surface.
|
Constructor and Description |
---|
SurfaceColoring(java.util.ArrayList molecules,
SurfaceComponent surface)
The given surface of the given molecules is to be colored after the parametrization.
|
SurfaceColoring(java.util.ArrayList molecules,
SurfaceComponent surface,
float step)
The given surface of the given molecules is to be colored after the parametrization.
|
SurfaceColoring(SurfaceComponent surface)
The given surface is to be colored after the parametrization.
|
Modifier and Type | Method and Description |
---|---|
void |
changeColorMapperColors(int mode)
Switches to another built-in color palette and leaves minimum, maximum
and cutoff values unchanged.
|
void |
doColoring()
This function has to be called after proper parametrization of the
SurfaceColoring object in case of custom properties. |
void |
doColoring(int mappingMode)
This function has to be called after proper parametrization of the
SurfaceColoring object in case of built-in properties. |
protected void |
finalize() |
static byte[][] |
getBuiltInPalette(int paletteId)
Returns the colors of a built-in palette.
|
static byte[][] |
getBuiltInPalette(java.lang.Object paletteId)
Returns the colors of a built-in palette.
|
static java.lang.String[] |
getBuiltInPalettes()
Returns the string identifiers of the built-in palettes.
|
double |
getMaximumValue()
Returns the greatest property value of the surface vertices.
|
double |
getMinimumValue()
Returns the lowest property value of the surface vertices.
|
void |
reset()
Resets all parameters to the default.
|
void |
setAtomRadiusExtension(float r)
In case of {#RADIUS_VDW_EXTENDED} mode the extension can be set.
|
void |
setBuiltInColorMapperMethod(int mode)
Selection of built-in color palettes through their identifier.
|
void |
setBuiltInColorMapperMethod(int mode,
boolean twoPolePalette)
Selection of built-in color palettes through their identifier.
|
void |
setConstantAtomRadius(float r)
In case of {#RADIUS_CONSTANT} mode the constant radius can be set.
|
void |
setConstantDistanceRadius(float r)
In case of distance weighted property values constant radius can be set.
|
void |
setDistanceRadiusExtension(float r)
In case of distance weighted property values radius extension can be set.
|
void |
setDistanceRadiusMode(int pvs)
In case of distance weighted property values the distance computation can
be set differently from the property radius but in the same way.
|
void |
setEnrtyRadiusMode(int pvs)
Atom properties will effect surface vertices being closer than a certain radius.
|
void |
setHomogeneousPaletteColors(byte[][] colorArray)
This is an easy way to create a homogenous palette and use it as a color mapper.
|
void |
setLowerCutoffValue(double v)
Cutoff values can be set to the built-in two pole palettes.
|
void |
setMaximumValue(double v)
Sets the greatest property value of the surface vertices considered.
|
void |
setMinimumValue(double v)
Sets the lowest property value of the surface vertices considered.
|
void |
setProgressBar(chemaxon.marvin.space.ProgressBarInterface progressBar) |
void |
setPropertyColorMapperMethod(java.lang.reflect.Method m)
Colors will be got by this method.
|
void |
setPropertyColorMapperRange(double min,
double max)
Sets the range of the built-in palette.
|
void |
setPropertyColorObject(java.lang.Object o)
Colors will be got from this object.
|
void |
setPropertyMethod(java.lang.reflect.Method m)
Atom properties will be got by this method.
|
void |
setPropertyObject(java.lang.Object o,
int mappingMode)
Atom properties will be get from this object.
|
void |
setPropertyValueDecreasement(int pvd)
Atom property values can decrease when getting farhter from the atom center.
|
void |
setReciprocalConstant(double c)
Atom property values will decrease by (1.0/(4*PI*c)) * (v/(d*d)).
|
void |
setSmoothColoringToCutoffValues(boolean b)
See
Palette.smoothColorToCutoffValues(boolean) . |
void |
setSurface(SurfaceComponent surface)
Sets the surface for coloring.
|
void |
setUpperCutoffValue(double v)
Cutoff values can be set to the built-in two pole palettes.
|
void |
setWeightMode(int mode)
Way of handling values when multiple atoms have effect on one surface vertex.
|
void |
updateColors()
Useful fast updating method when the atom properties have not changed,
but there is a change in the way of coloring.
|
public static final int RADIUS_VDW
public static final int RADIUS_VDW_EXTENDED
public static final int RADIUS_CONSTANT
public static final int NEAREST_VALUE
public static final int SUM_OF_VALUES
public static final int MEAN_VALUE
public static final int DISTANCE_WEIGHTED
public static final int DISTANCE_FROM_VDW
public static final int DISTANCE_FROM_VDW_EXTENDED
public static final int DISTANCE_CONSTANT
public static final int BUILT_IN_CPK_MAPPING
public static final int BUILT_IN_RESIDUE_MAPPING
public static final int BUILT_IN_CHAIN_MAPPING
public static final int BUILT_IN_SECONDARY_STRUCTURE_MAPPING
public static final int BUILT_IN_RAINBOW_MAPPING
public static final int ATOM_PROPERTY_MAPPING
public static final int GRID_MAPPING
public static final int NO_DECREASE
public static final int DECREASE_LINEAR
public static final int DECREASE_SQUARE
public static final int DECREASE_RECIPROCAL_SQUARE
public static final int COLOR_MAPPER_RAINBOW
public static final int COLOR_MAPPER_REVERSE_RAINBOW
public static final int COLOR_MAPPER_RED_TO_BLUE
public static final int COLOR_MAPPER_BLUE_TO_RED
public static final int COLOR_MAPPER_GREEN_TO_BLUE
public static final int COLOR_MAPPER_BLUE_TO_GREEN
public static final int COLOR_MAPPER_FIRE
public SurfaceColoring(SurfaceComponent surface)
surface
- surface to be coloredpublic SurfaceColoring(java.util.ArrayList molecules, SurfaceComponent surface)
molecules
- set of MoleculeInterface
ssurface
- surface to be coloredpublic SurfaceColoring(java.util.ArrayList molecules, SurfaceComponent surface, float step)
molecules
- set of MoleculeInterface
ssurface
- surface to be coloredstep
- precision value, it is an approximate value of distances between surface verticesprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void setProgressBar(chemaxon.marvin.space.ProgressBarInterface progressBar)
public void setSurface(SurfaceComponent surface)
surface
- public void reset()
public void setPropertyObject(java.lang.Object o, int mappingMode)
o
- object that has the property methodmappingMode
- either GRID_MAPPING
or ATOM_PROPERTY_MAPPING
indicating {int} or {float, float, float} arguments to the property methodpublic void setPropertyMethod(java.lang.reflect.Method m) throws java.lang.Exception
m
- custom method that computes the atom propertiesjava.lang.Exception
- in case of illegal method or illegal argumentspublic void setBuiltInColorMapperMethod(int mode) throws java.lang.Exception
mode
- See {#COLOR_MAPPER_RAINBOW}, {#COLOR_MAPPER_RED_AND_BLUE}.java.lang.Exception
public void setBuiltInColorMapperMethod(int mode, boolean twoPolePalette) throws java.lang.Exception
mode
- See {#COLOR_MAPPER_RAINBOW}, {#COLOR_MAPPER_RED_AND_BLUE}.
"param twoPolePalette if the palette should handle negative and positive
values separatelyjava.lang.Exception
public void changeColorMapperColors(int mode)
mode
- internal id of the newly set color palettepublic void setPropertyColorMapperRange(double min, double max)
min
- Sets the minimum value the palette assignes color to.max
- Sets the maximum value the palette assignes color to.public void setPropertyColorMapperMethod(java.lang.reflect.Method m) throws java.lang.Exception
byte[]
colors.m
- custom method that returns a color to an atom propertyjava.lang.Exception
- in case of illegal method or illegal argumentspublic void setPropertyColorObject(java.lang.Object o)
o
- object that has the color mapper methodpublic void doColoring() throws java.lang.Exception
SurfaceColoring
object in case of custom properties.java.lang.Exception
public void doColoring(int mappingMode) throws java.lang.Exception
SurfaceColoring
object in case of built-in properties.mappingMode
- identifier of the built-in method, see {#BUILT_IN_CPK_MAPPING},
{#BUILT_IN_RESIDUE_MAPPING}, {#BUILT_IN_CHAIN_MAPPING}java.lang.Exception
public void setEnrtyRadiusMode(int pvs)
pvs
- See {#RADIUS_VDW}, {#RADIUS_VDW_EXTENDED}, {#RADIUS_CONSTANT}.public void setAtomRadiusExtension(float r)
r
- radius extension in angstromspublic void setConstantAtomRadius(float r)
r
- radius in angstromspublic void setDistanceRadiusMode(int pvs)
pvs
- mode as distance is computed, see {#DISTANCE_FROM_VDW}, {#DISTANCE_FROM_VDW_EXTENDED},
{#DISTANCE_CONSTANT}.public void setDistanceRadiusExtension(float r)
r
- distance radius extension in angstromspublic void setConstantDistanceRadius(float r)
r
- constant distance radius in angstromspublic void setPropertyValueDecreasement(int pvd)
pvd
- See {#NO_DECREASE}, {#DECREASE_LINEAR}, {#DECREASE_SQUARE}, {#DECREASE_RECIPROCAL_SQUARE}.public void setReciprocalConstant(double c)
c
- public void setWeightMode(int mode)
mode
- See {#NEAREST_VALUE}, {#SUM_OF_VALUES}, {#MEAN_VALUE}, {#DISTANCE_WEIGHTED}.public void setHomogeneousPaletteColors(byte[][] colorArray)
colorArray
- array of byte[]
colors.public static java.lang.String[] getBuiltInPalettes()
public static byte[][] getBuiltInPalette(int paletteId)
paletteId
- int identifier of a built-in palettepublic static byte[][] getBuiltInPalette(java.lang.Object paletteId)
paletteId
- string identifier of a built-in palettepublic double getMinimumValue()
public double getMaximumValue()
public void setMinimumValue(double v)
v
- minimum weighted valuepublic void setMaximumValue(double v)
v
- maximum weighted valuepublic void setLowerCutoffValue(double v)
v
- lower cutoff valuepublic void setUpperCutoffValue(double v)
v
- upper cutoff valuepublic void setSmoothColoringToCutoffValues(boolean b)
Palette.smoothColorToCutoffValues(boolean)
.b
- public void updateColors() throws java.lang.Exception
java.lang.Exception