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

The OE2DPropMap class can be customized with the following properties:

Property Get method Set method Corresponding namespace/class
legend font GetLegendFont SetLegendFont OEFont
legend font scale GetLegendFontScale SetLegendFontScale  
legend location GetLegendLocation SetLegendLocation OELegendLocation
maximum value GetMaxValue SetMaxValue  
minimum value GetMinValue SetMinValue  
negative color GetNegativeColor SetNegativeColor OEColor
positive color GetPositiveColor SetPositiveColor OEColor
radius ratio GetRadiusRatio SetRadiusRatio  
grid resolution GetResolution SetResolution  

Constructors

OE2DPropMap(const OESystem::OEColor &bgColor=OESystem::OEColor(250, 250, 250))

Default constructor.

OE2DPropMap(const OE2DPropMap &rhs)

Copy constructor.

operator=

OE2DPropMap &operator=(const OE2DPropMap &)

Assignment operator.

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 an other 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

GetLegendFontScale

double GetLegendFontScale() const

Returns the multiplier that can be used to increase or decrease the size of the legend fonts.

GetLegendLocation

unsigned int GetLegendLocation() const

Returns the position of the legend. The return value is taken from the OELegendLocation namespace.

GetMaxValue

double GetMaxValue() const

Returns the maximum value that is used to construct the color gradient of the property map.

See also

GetMinValue

double GetMinValue() const

Returns the minimum value that is used to construct the color gradient of the property map.

See also

GetNegativeColor

const OESystem::OEColor &GetNegativeColor() const

Returns the color that is used to represent negative atom property values.

See also

GetPositiveColor

const OESystem::OEColor &GetPositiveColor() const

Returns the color that is used to represent positive atom property values.

See also

GetRadiusRatio

double GetRadiusRatio() const

Returns he ratio that is used to scale the Gaussian radius.

See also

GetResolution

unsigned int GetResolution() const

Returns the resolution of the property grid.

See also

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 f = new OEFont();
f.SetStyle(OEFontStyle.Bold);
f.SetColor(OEChem.OEDarkBlue);
propmap.SetLegendFont(f);
../../_images/OE2DPropMap_SetLegendFont.png

Example of using the SetLegendFont method

See also

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);
../../_images/OE2DPropMap_SetLegendFontScale.png

Example of using the SetLegendFontScale method

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);
../../_images/OE2DPropMap_SetLegendLocation.png

Example of using the SetLegendLocation method

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);
../../_images/OE2DPropMap_SetMaxValue.png

Example of using the SetMaxValue method

See also

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);
../../_images/OE2DPropMap_SetMinValue.png

Example of using the SetMinValue method

See also

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.OEDarkGreen);
../../_images/OE2DPropMap_SetNegativeColor.png

Example of using the SetNegativeColor method

See also

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.OEDarkGreen);
../../_images/OE2DPropMap_SetPositiveColor.png

Example of using the SetPositiveColor method

See also

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);
../../_images/OE2DPropMap_SetRadiusRatio.png

Example of using the SetRadiusRatio method

See also

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);
../../_images/OE2DPropMap_SetResolution.png

Example of using the SetResolution method

See also