NAP
Public Member Functions | Public Attributes | List of all members
Icon Class Reference

#include <imguiicon.h>

Public Member Functions

 Icon (nap::IMGuiService &guiService)
 
 Icon (nap::IMGuiService &guiService, const std::string &imagePath)
 
virtual bool init (utility::ErrorState &error)
 
const std::string & getPath () const
 
const std::string & getName () const
 
const nap::Texture2DgetTexture () const
 
IMGuiServicegetGuiService ()
 
ImTextureID getTextureHandle () const
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

bool mInvert = false
 Property: 'Invert' if the icon colors should be inverted. More...
 
std::string mImagePath
 Property: 'ImagePath' path to the image on disk. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Generic icon that can be displayed in a GUI.

Inheritance diagram for Icon:
[legend]
Collaboration diagram for Icon:
[legend]

Constructor & Destructor Documentation

◆ Icon() [1/2]

Icon ( nap::IMGuiService guiService)

Creates the icon.

Parameters
guiServicegui reference

◆ Icon() [2/2]

Icon ( nap::IMGuiService guiService,
const std::string &  imagePath 
)

Creates the icon.

Parameters
guiServicegui reference
imagePathpath, absolute or relative, to icon

Member Function Documentation

◆ getGuiService()

IMGuiService& getGuiService ( )
Returns
the GUI Service

◆ getName()

const std::string& getName ( ) const
Returns
name of the icon, without extension;

◆ getPath()

const std::string& getPath ( ) const
Returns
path to icon.

◆ getTexture()

const nap::Texture2D& getTexture ( ) const
Returns
2DTexture that can be rendered

◆ getTextureHandle()

ImTextureID getTextureHandle ( ) const

Returns the GUI texture handle of this icon.

Returns
the GUI texture handle

◆ init()

virtual bool init ( utility::ErrorState error)
virtual

Loads the icon and creates icon LODs. Note that until this function is called, the Icon will not have a valid name.

Parameters
errorcontains the error if loading fails
Returns
if loading succeeded.

Reimplemented from Object.

Member Data Documentation

◆ mImagePath

std::string mImagePath

Property: 'ImagePath' path to the image on disk.

◆ mInvert

bool mInvert = false

Property: 'Invert' if the icon colors should be inverted.