# cee::vis::OverlayColorLegendContinuousDomain

class `OverlayColorLegendContinuousDomain` : public OverlayItem

  The OverlayColorLegendContinuousDomain is capable of visualizing all scalar mappers that derives from the ScalarMapperContinuousDomain.

  The following scalar mappers can be used:

  - ScalarMapperFilledContoursUniform
  - ScalarMapperFilledContours
  - ScalarMapperContinuous
  - ScalarMapperContinuousPiecewise

  The color legend is configured from the scalar mapper with the setupFromScalarMapper() method. After doing that the appearance of the color legend can be configured with the settings in the class, e.g. set a title, custom tick marks, number formatting and custom labels.

  See tutorial Geometry: Create a Geometry Model with Texture for an example of the use of OverlayColorLegendContinuousDomain.

  Below is an example of each of the scalar mappers:

  See also

  OverlayItem, ScalarMapperFilledContoursUniform, ScalarMapperFilledContours, ScalarMapperContinuous, ScalarMapperContinuousPiecewise, and View

  Public Types

  enum `Direction`

    Values:

    enumerator `HORIZONTAL`

      Draw horizontal color legend bar.

    enumerator `VERTICAL`

      Draw vertical color legend bar.

  Public Functions

  `OverlayColorLegendContinuousDomain`(Font *font)

    Creates an overlay legend object.

  void `setupFromScalarMapper`(const ScalarMapperContinuousDomain *scalarMapper)

    Sets up the color legend from the scalar mapper.

    This will configure the color legend so that the legend will reflect the given scalar mapper If the mapper returns tick values (with the tickValuesHint() method) the tick values will also be configured (as is the case for Filled Contours style mappers). If not, only the min and max value will be added as tick marks. In this case, use the setupNiceNumbersTickmarks() or setupNiceNumbersTickmarksLogarithmic() methods to create appropriate tickmarks.

  void `setupNiceNumbersTickMarks`(unsigned int maxNumTickMarks, const ScalarMapperContinuousDomain *scalarMapper)

    Setup tickmarks on the color legend using round and human readable values.

    This method assumes a linear scalar mapper.

  void `setupNiceNumbersTickMarksLogarithmic`(unsigned int maxNumTickMarks, const ScalarMapperContinuousDomain *scalarMapper)

    Setup tickmarks on the color legend using round and human readable values.

    This method assumes a logarithmic scalar mapper.

  void `setTickValues`(const std::vector<double> &tickValues, const ScalarMapperContinuousDomain *scalarMapper)

    Sets the tick values to show on the color legend.

  void `setWidthToFitText`()

    Sets the width of the legend to fit the current text.

  Font *`titleFont`()

    Returns the font used for showing the title of the legend.

  void `setTitleFont`(Font *font)

    Sets the font to use for the title of the legend.

  Font *`tickMarkFont`()

    Returns the font used to show the tick marks of the legend.

  void `setTickMarkFont`(Font *font)

    Sets the font to use for the tickmark labels.

  unsigned int `legendBarWidth`() const

    Returns the width of the legend bar in pixels.

  void `setLegendBarWidth`(unsigned int widthInPixels)

    Sets the width of the legend bar in pixels.

  Str `title`() const

    Returns the title of the legend.

  void `setTitle`(const Str &title)

    Sets the title of the legend.

    Multiple lines can be specified by using the ‘

    ’ separator

  Color3f `textColor`() const

    Returns the text color.

  void `setTextColor`(const Color3f &color)

    Sets the text color for the category labels. Also sets the border color for the category bar.

  char `numericFormat`() const

    Returns the numeric format used for this legend.

  void `setNumericFormat`(char format)

    Sets the numeric format used for this legend.

  int `numericPrecision`() const

    Returns the numeric precision used for this legend.

  void `setNumericPrecision`(int precision)

    Sets the numeric precision used for this legend.

  void `setShowTickMarkLabels`(bool show)

    Specifies if the tick mark labels (usually the number values) should be shown together with the tick mark lines.

  bool `showTickMarkLabels`() const

    Returns true if the tick mark labels will be shown.

  void `setForceUniformTickMarkSpacing`(bool forceUniformSpacing)

    Returns true if the legend should be drawn with a uniform spacing between the tick values (not taking the actual value into account).

    The color legend bar will be modified accordingly so the tick values indicate the right color.

  bool `forceUniformTickMarkSpacing`() const

    Returns true if the legend is drawn with a uniform spacing between tick values.

  void `setTickMarksThroughLegendBar`(bool drawOverLegendBar)

    Sets tick marks to be shown through the legend bar.

  bool `tickMarksThroughLegendBar`() const

    Returns true if tick marks are shown through the legend bar.

  void `setCustomLabels`(const std::vector<Str> &labels, const std::vector<double> &relativePositions)

    Sets custom labels that will be drawn at the given relative position on the color legend.

    This could be used to render a description for the given color (for filled contour type legends) and may be used in combination with setShowTickmarkLabels(false) to create a more category type legend.

  void `clearCustomLabels`()

    Clears the custom labels.

    See also

    setCustomLabels

  void `setDirection`(Direction direction)
  Direction `direction`() const
  void `setDistributionCurve`(const std::vector<float> &relativePos, const std::vector<float> &normalizedValues)

    Sets the distribution curve data for the color legend.

    The curve is rendered as a filled silhouette next to the colorbar on the side opposite the tick labels, using a semi-transparent fill derived from the legend’s text color.

  void `clearDistributionCurve`()

    Clears the distribution curve.

  void `setDistributionCurveWidth`(float width)

    Sets the line width for the distribution curve.

  float `distributionCurveWidth`() const

    Returns the line width for the distribution curve.

  void `setDistributionCurveBinCount`(int binCount)

    Sets the number of bins for the distribution curve histogram.

  int `distributionCurveBinCount`() const

    Returns the number of bins for the distribution curve histogram.

  void `setDistributionCurveConcentrationThreshold`(float threshold)

    Sets the concentration threshold for hiding distribution curves.

  float `distributionCurveConcentrationThreshold`() const

    Returns the concentration threshold for hiding distribution curves.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...