OE2DPropMap¶
class OE2DPropMap
The OE2DPropMap class maps atom properties into a 2D grid and then blurs the image by using a Gaussian function. The points of the 2D grid are then colored using the OELinearColorGradient class that interpolates colors between a specified range.
See also
Depicting Property Maps chapter
Code Example
Visualizing Molecular Dipole Moment OpenEye Python Cookbook recipe
The OE2DPropMap class can be customized with the following properties:
Property
Get method
Set method
Corresponding namespace/class
legend font
legend font scale
legend location
maximum value
minimum value
negative color
positive color
radius ratio
grid resolution
Constructors¶
OE2DPropMap(const OESystem::OEColor &bgColor=OESystem::OEColor(250, 250, 250))
Default constructor.
OE2DPropMap(const OE2DPropMap &rhs)
Copy constructor.
Render¶
bool Render(OEDepict::OE2DMolDisplay &disp, const std::string &tagname)
Renders the property map into a molecule display.
- disp
The molecule display that holds the molecule for which the property map is calculated and on which the property map is drawn. The property map is drawn onto the below layer of the molecule display i.e., it appears underneath the molecular diagram.
- tagname
The generic data identifier that is used to retrieve the properties being depicted on the property map.
bool Render(OEDepict::OEImageBase &image, const OEDepict::OE2DMolDisplay &disp,
const std::string &tagname)
Renders the property map into an image.
- image
The image on which the property map is drawn.
- disp
The molecule display that holds the molecule for which the property map is calculated.
- tagname
The generic data identifier that is used to retrieve the properties being depicted on the property map.
bool Render(OEDepict::OE2DMolDisplay &disp,
const OEDepict::OE2DMolDisplay &refdisp, const std::string &tagname)
Renders the property map calculated for one display, onto another display.
- disp
The molecule display on which the property map is drawn. The property map is drawn onto the below layer of the molecule display i.e., it appears underneath the molecular diagram.
- refdisp
The molecule display that holds the molecule for which the property map is calculated.
- tagname
The generic data identifier that used to retrieve the properties being depicted on the property map.
GetLegendFont¶
const OEDepict::OEFont& GetLegendFont() const
Returns the font that is used to render the title of the legend and the color stops of the linear color gradient.
See also
OE2DPropMap.SetLegendFont
methodOEFont class
GetLegendFontScale¶
double GetLegendFontScale() const
Returns the multiplier that can be used to increase or decrease the size of the legend fonts.
See also
GetLegendLocation¶
unsigned int GetLegendLocation() const
Returns the position of the legend.
The return value is taken from the
OELegendLocation
namespace.
See also
OELegendLocation
namespace
GetMaxValue¶
double GetMaxValue() const
Returns the maximum value that is used to construct the color gradient of the property map.
See also
OE2DPropMap.SetMaxValue
method
GetMinValue¶
double GetMinValue() const
Returns the minimum value that is used to construct the color gradient of the property map.
See also
OE2DPropMap.SetMinValue
method
GetNegativeColor¶
const OESystem::OEColor &GetNegativeColor() const
Returns the color that is used to represent negative atom property values.
See also
OE2DPropMap.SetNegativeColor
methodOEColor class
GetPositiveColor¶
const OESystem::OEColor &GetPositiveColor() const
Returns the color that is used to represent positive atom property values.
See also
OE2DPropMap.SetPositiveColor
methodOEColor class
GetRadiusRatio¶
double GetRadiusRatio() const
Returns he ratio that is used to scale the Gaussian radius.
See also
OE2DPropMap.SetRadiusRatio
method
GetResolution¶
unsigned int GetResolution() const
Returns the resolution of the property grid.
See also
OE2DPropMap.SetResolution
method
SetLegendFont¶
void SetLegendFont(const OEDepict::OEFont &font)
Sets the font that is used to render the title of the legend and the color stops of the linear color gradient.
Note
The size of fonts of the legend also depends on
the scaling factor used to fit the linear color gradient into the
given dimensions and the multiplier set by the
OE2DPropMap.SetLegendFontScale
method.
Example (see Figure: Example of using the SetLegendFont method)
OE2DPropMap propmap = new OE2DPropMap();
OEFont font = new OEFont();
font.SetStyle(OEFontStyle.Bold);
font.SetColor(oechem.getOEDarkBlue());
propmap.SetLegendFont(font);
See also
OE2DPropMap.GetLegendFont
methodOEFont class
SetLegendFontScale¶
void SetLegendFontScale(double scale)
Sets the multiplier that can be used to increase or decrease the size of the legend fonts.
- scale
This value has to be in the range of
[0.5, 2.0]
.
Example (see Figure: Example of using the SetLegendFontScale method)
OE2DPropMap propmap = new OE2DPropMap();
propmap.SetLegendFontScale(1.5);
See also
SetLegendLocation¶
void SetLegendLocation(unsigned int loc)
Sets the position of the legend.
- loc
This value has to be from the
OELegendLocation
namespace.
Example (see Figure: Example of using the SetLegendLocation method)
OE2DPropMap propmap = new OE2DPropMap();
propmap.SetLegendLocation(OELegendLocation.Left);
See also
OELegendLocation
namespace
SetMaxValue¶
void SetMaxValue(double maxv)
Sets the maximum value that is used to construct the
color gradient of the property map.
If no maximum value is specified prior to calling the
OE2DPropMap.Render
method, then the
maximum value will be the largest atom property value.
Example (see Figure: Example of using the SetMaxValue method)
OE2DPropMap propmap = new OE2DPropMap();
propmap.SetMaxValue(0.0);
See also
OE2DPropMap.GetMaxValue
method
SetMinValue¶
void SetMinValue(double minv)
Sets the minimum value that is used to construct the
color gradient of the property map.
If no minimum value is specified prior to calling the
OE2DPropMap.Render
method, then the
minimum value will be the smallest atom property value.
Example (see Figure: Example of using the SetMinValue method)
OE2DPropMap propmap = new OE2DPropMap();
propmap.SetMinValue(0.0);
See also
OE2DPropMap.GetMinValue
method
SetNegativeColor¶
void SetNegativeColor(const OESystem::OEColor &color)
Sets the color that is used to represent negative atom property values.
Example (see Figure: Example of using the SetNegativeColor method)
OE2DPropMap propmap = new OE2DPropMap();
propmap.SetNegativeColor(oechem.getOEDarkGreen());
See also
OE2DPropMap.GetNegativeColor
methodOEColor class
SetPositiveColor¶
void SetPositiveColor(const OESystem::OEColor &color)
Sets the color that is used to represent positive atom property values.
Example (see Figure: Example of using the SetPositiveColor method)
OE2DPropMap propmap = new OE2DPropMap();
propmap.SetPositiveColor(oechem.getOEDarkGreen());
See also
OE2DPropMap.GetPositiveColor
methodOEColor class
SetRadiusRatio¶
void SetRadiusRatio(double ratio)
Sets the ratio that is used to scale the Gaussian radius.
- ratio
This value has to be in the range of [0.5, 2.0].
Example (see Figure: Example of using the SetRadiusRatio method)
OE2DPropMap propmap = new OE2DPropMap();
propmap.SetRadiusRatio(0.75);
See also
OE2DPropMap.GetRadiusRatio
method
SetResolution¶
void SetResolution(unsigned int resolution)
Sets the resolution of the property grid.
- resolution
This value has to be in the range of [2, 20].
Example (see Figure: Example of using the SetResolution method)
OE2DPropMap propmap = new OE2DPropMap();
propmap.SetResolution(5);
See also
OE2DPropMap.GetResolution
method.