Tulip  5.2.1
Large graphs analysis and drawing
tlp::TulipMaterialDesignIcons Class Reference

#include <TulipMaterialDesignIcons.h>

Static Public Member Functions

static unsigned int getIconCodePoint (const std::string &iconName)
 
static std::string getIconFamily (const std::string &iconName)
 
static std::string getIconUtf8String (const std::string &iconName)
 
static const std::vector< std::string > & getSupportedIcons ()
 
static std::string getTTFLocation ()
 
static std::string getVersion ()
 
static std::string getWOFF2Location ()
 
static std::string getWOFFLocation ()
 
static bool isIconSupported (const std::string &iconName)
 

Detailed Description

Helper class for the configuration of a Material Design Icon glyph.

Since
Tulip 5.0

Material Design Icons (https://materialdesignicons.com/) : a growing icon collection allows designers and developers targeting various platforms to download icons in the format, color and size they need for any project.

A glyph has been added to Tulip enabling to use these great icons as nodes and edges extremities shapes.

That class offers utility functions and supported icons names constants.

To set a node glyph as a Material Design icon, the Icon glyph must be associated to the node through the modification of the "viewShape" integer property attached to the graph. The name of the icon to use must then be set in the "viewIcon" string property. As an example, the following code snippet activates the Material Design glyph for all nodes and sets the "user" icon.

// graph is a pointer to a tlp::Graph object
tlp::IntegerProperty *viewShape = graph->getProperty<tlp::IntegerProperty>("viewShape");
tlp::StringProperty *viewIcon = graph->getProperty<tlp::StringProperty>("viewIcon");
// sets the Icon glyph on all nodes
viewShape->setAllNodeValue(tlp::NodeShape::Icon);
// sets the "user" glyph for all nodes
viewIcon->setAllNodeValue("md-user");

Definition at line 64 of file TulipMaterialDesignIcons.h.

Member Function Documentation

◆ getIconCodePoint()

static unsigned int tlp::TulipMaterialDesignIcons::getIconCodePoint ( const std::string &  iconName)
static

Returns the Unicode code point associated to an icon name

Parameters
iconNamethe name of the icon to get the codepoint

◆ getIconFamily()

static std::string tlp::TulipMaterialDesignIcons::getIconFamily ( const std::string &  iconName)
static

Returns the font family name associated to an icon name

Parameters
iconNamethe name of the icon

◆ getIconUtf8String()

static std::string tlp::TulipMaterialDesignIcons::getIconUtf8String ( const std::string &  iconName)
static

Returns an UTF-8 encoded string of a Material Design icon

Parameters
iconNamea Material Design icon name
Returns

◆ getSupportedIcons()

static const std::vector<std::string>& tlp::TulipMaterialDesignIcons::getSupportedIcons ( )
static

Returns the list of supported Material Design icons names

◆ getTTFLocation()

static std::string tlp::TulipMaterialDesignIcons::getTTFLocation ( )
static

Returns the location of the Material Design Icons .ttf file bundled with Tulip

◆ getVersion()

static std::string tlp::TulipMaterialDesignIcons::getVersion ( )
static

Returns the current Material Design Icons version

◆ getWOFF2Location()

static std::string tlp::TulipMaterialDesignIcons::getWOFF2Location ( )
static

Returns the location of the Material Design Icons .woff2 file bundled with Tulip

◆ getWOFFLocation()

static std::string tlp::TulipMaterialDesignIcons::getWOFFLocation ( )
static

Returns the location of the Material Design Icons .woff file bundled with Tulip

◆ isIconSupported()

static bool tlp::TulipMaterialDesignIcons::isIconSupported ( const std::string &  iconName)
static

Checks if the provided Material Design icon name is supported

Parameters
iconNamethe name of the icon to check support