# Hurricane Design Viewer

Static Public Member Functions | List of all members
Hurricane::Graphics Class Reference
Graphics

Manage basic graphical configuration (API) More...

## Static Public Member Functions
static Graphics * | getGraphics ()
static bool | isEnabled ()
static const QFont | getFixedFont (int weight=QFont::Normal, bool italic=false, bool underline=false, int scale=0)
static const Name & | getGroup (const Name &key)
static QColor | getColor (const Name &key, const DisplayStyle::HSVr &darkening=DisplayStyle::HSVr())
static QPen | getPen (const Name &key, const DisplayStyle::HSVr &darkening=DisplayStyle::HSVr())
static QBrush | getBrush (const Name &key, const DisplayStyle::HSVr &darkening=DisplayStyle::HSVr())
static const string & | getPattern (const Name &key)
static float | getThreshold (const Name &key)
static const DisplayStyle::HSVr & | getDarkening ()
static const ColorScale & | getColorScale (ColorScale::ScaleType)
static QColor | darken (const QColor &)
static const TextTranslator & | getHtmlTranslator ()
static string | toHtml (const string &)
static void | addStyle (DisplayStyle *displayStyle)
static void | setStyle (const Name &key)
static DisplayStyle * | getStyle (const Name &key)
static DisplayStyle * | getStyle ()
static void | enable ()

## Detailed Description

Manage basic graphical configuration (API)

The Graphics class is a singleton which provides a simplificated access to graphical resources from Qt and manages graphics styles used to draw all the objects from the CellWidget.

## Member Function Documentation

## ◆ getGraphics()

Graphics * Hurricane::Graphics::getGraphics | ( |  | ) |
| static

Returns: The Graphics singleton.

## ◆ isEnabled()

bool Hurricane::Graphics::isEnabled | ( |  | ) |
| static

Returns: true if Qt has been activated.

## ◆ getFixedFont()

const QFont Hurricane::Graphics::getFixedFont | ( | int | weight = `QFont::Normal`,
|  | bool | italic = `false`,
|  | bool | underline = `false`,
|  | int | scale = `0`
| ) |  |
| static

Parameters

  weight | the font's weight (see Qt::Weight).
  italic | select the italic variant of the font.
  underline | the font will be underlined.
  scale | added to the font's default point size.

Returns
  A QFont, the size of the font is guessed from the system's default.

## ◆ getGroup()

const Name & Hurricane::Graphics::getGroup | ( | const Name & | key | ) |
| static

Returns: The group owning the DrawingStyle of which key is key.

## ◆ getColor()

const QColor & Hurricane::Graphics::getColor | ( | const Name & | key,
|  | const DisplayStyle::HSVr & | darkening = `DisplayStyle::HSVr()`
| ) |  |
| static

Returns: The QColor associated to the DrawingStyle key darkened by a factor darkening.

## ◆ getPen()

const QPen & Hurricane::Graphics::getPen | ( | const Name & | key,
|  | const DisplayStyle::HSVr & | darkening = `DisplayStyle::HSVr()`
| ) |  |
| static

Returns: The QPen associated to the DrawingStyle key darkened by a factor darkening.

## ◆ getBrush()

const QBrush & Hurricane::Graphics::getBrush | ( | const Name & | key,
|  | const DisplayStyle::HSVr & | darkening = `DisplayStyle::HSVr()`
| ) |  |
| static

Returns: The QBrush associated to the DrawingStyle key by a factor darkening.

## ◆ getPattern()

const string & Hurricane::Graphics::getPattern | ( | const Name & | key | ) |
| static

Returns: The pattern associated to the DrawingStyle key.

## ◆ getThreshold()

const float Hurricane::Graphics::getThreshold | ( | const Name & | key | ) |
| static

Returns: The display threshold associated to the DrawingStyle key.

## ◆ getDarkening()

const DisplayStyle::HSVr & Hurricane::Graphics::getDarkening | ( |  | ) |
| static

Returns: The darkening factor applied to non-selected objects.

## ◆ getColorScale()

const ColorScale & Hurricane::Graphics::getColorScale | ( | ColorScale::ScaleType |  | ) |
| static

Returns: The darkening factor applied to non-selected objects.

## ◆ darken()

const QColor Hurricane::Graphics::darken | ( | const QColor & | color | ) |
| static

Returns: The QColor with the darkening factor applied.

## ◆ getHtmlTranslator()

const TextTranslator & Hurricane::Graphics::getHtmlTranslator | ( |  | ) |
| static

Returns: The translator applied to generate html text.

See also
  toHtml()

## ◆ toHtml()

const string Hurricane::Graphics::toHtml | ( | const string & |  | ) |
| static

Returns: A string suitable for HTML enabled devices, such as most of the Qt widgets. Special characters like `'&'` are replaced by their HTML counterpart (`&amp`;)

## ◆ addStyle()

const void Hurricane::Graphics::addStyle | ( | DisplayStyle * | displayStyle | ) |
| static

Adds a new DisplayStyle to the Graphics environment. The DisplayStyle contains it's name by which it can be accessed later. If any previous DisplayStyle of the same name was existing it is silently replaced.

## ◆ setStyle()

void Hurricane::Graphics::setStyle | ( | const Name & | key | ) |
| static

Make the DisplayStyle whose name is key the currently used one.

## ◆ getStyle() [1/2]

DisplayStyle * Hurricane::Graphics::getStyle | ( | const Name & | key | ) |
| static

Returns: The DisplayStyle whose name is key.

## ◆ getStyle() [2/2]

DisplayStyle * Hurricane::Graphics::getStyle | ( |  | ) |
| static

Returns: The DisplayStyle which is currently in use.

## ◆ enable()

void Hurricane::Graphics::enable | ( |  | ) |
| static

Effectively calls Qt, allocated Pens & Brushes and so on.

The documentation for this class was generated from the following files:

- Graphics.h
- Graphics.dox

Generated by doxygen 1.8.14 on Tue Jul 21 2020 | Return to top of page

Hurricane Design Viewer | Copyright © 2008-2016 UPMC All rights reserved