MorphoGraphX  2.0-1-227
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
mgx::Colors Class Reference

#include <Colors.hpp>

+ Inheritance diagram for mgx::Colors:

Public Types

enum  ColorType {
  Mesh1Color, Mesh1BorderColor, Mesh1SelectColor, Mesh1CellsColor,
  Stack1BBoxColor, Mesh2Color, Mesh2BorderColor, Mesh2SelectColor,
  Mesh2CellsColor, Stack2BBoxColor, BackgroundColor, Clip1GridColor,
  Clip2GridColor, Clip3GridColor, CuttingPlaneGridColor, LegendColor,
  ScaleBarColor, VoxelEditColor, NbColors, StartMesh1,
  StartMesh2, StartOthers
}
 Mesh1 and 2 must have the same order for their colors. More...
 

Public Slots

void backupColors ()
 
void restoreColors ()
 
void resetColors ()
 

Signals

void colorsChanged ()
 

Public Member Functions

 Colors ()
 
virtual ~Colors ()
 
void readParms (Parms &parms, QString section)
 
void writeParms (QTextStream &pout, QString section)
 
bool hasChildren (const QModelIndex &parent=QModelIndex()) const
 
QColor color (const QModelIndex &index) const
 
void setColor (const QModelIndex &index, QColor col)
 
QColor qcolor (ColorType type) const
 
Colorf color (ColorType type) const
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
QModelIndex parent (const QModelIndex &index) const
 

Static Public Member Functions

static Colorsinstance ()
 
static QColor getQColor (ColorType type)
 
static Colorf getColor (ColorType type)
 

Static Public Attributes

static const QString colorNames [NbColors]
 
static const QString categoryNames [3]
 
static const int categoryShift [3]
 
static const int categorySize [3]
 

Protected Attributes

std::vector< QColor > colors
 
std::vector< QColor > backup
 
QFont _font
 

Static Protected Attributes

static Colors_instance
 

Detailed Description

Definition at line 29 of file Colors.hpp.

Member Enumeration Documentation

◆ ColorType

Mesh1 and 2 must have the same order for their colors.

Enumerator
Mesh1Color 

Color of the lines.

Mesh1BorderColor 

Color of the border.

Mesh1SelectColor 

Color of the selected points and edges.

Mesh1CellsColor 

Color of the cell ids.

Stack1BBoxColor 

Color of the bounding box.

Mesh2Color 

Color of the lines

Mesh2BorderColor 

Color of the border.

Mesh2SelectColor 

Color of the selected points and edges.

Mesh2CellsColor 

Color of the cell ids.

Stack2BBoxColor 

Color of the bounding box.

BackgroundColor 

Color of the image background

Clip1GridColor 

Color of the grid of the 1st clipping planes.

Clip2GridColor 

Color of the grid of the 2nd clipping planes.

Clip3GridColor 

Color of the grid of the 3rd clipping planes.

CuttingPlaneGridColor 

Color of the grid of the cutting surface.

LegendColor 

Color of the text and lines in the color bar.

ScaleBarColor 

Color of the text and lines in the scale bar.

VoxelEditColor 

Color of the xircle for the pixel edit tool.

NbColors 

Total number of colors

StartMesh1 

First id for the mesh2 colors.

StartMesh2 

First id for the mesh2 colors.

StartOthers 

First id for the other colors.

Definition at line 35 of file Colors.hpp.

Constructor & Destructor Documentation

◆ Colors()

mgx::Colors::Colors ( )

◆ ~Colors()

virtual mgx::Colors::~Colors ( )
inlinevirtual

Definition at line 80 of file Colors.hpp.

Member Function Documentation

◆ backupColors

void mgx::Colors::backupColors ( )
slot

◆ color() [1/2]

Colorf mgx::Colors::color ( ColorType  type) const
inline

Definition at line 97 of file Colors.hpp.

◆ color() [2/2]

QColor mgx::Colors::color ( const QModelIndex &  index) const
inline

Definition at line 87 of file Colors.hpp.

◆ colorsChanged

void mgx::Colors::colorsChanged ( )
signal

◆ columnCount()

int mgx::Colors::columnCount ( const QModelIndex &  parent = QModelIndex()) const

◆ data()

QVariant mgx::Colors::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

◆ flags()

Qt::ItemFlags mgx::Colors::flags ( const QModelIndex &  index) const

◆ getColor()

static Colorf mgx::Colors::getColor ( ColorType  type)
inlinestatic

Definition at line 122 of file Colors.hpp.

◆ getQColor()

static QColor mgx::Colors::getQColor ( ColorType  type)
inlinestatic

Definition at line 118 of file Colors.hpp.

◆ hasChildren()

bool mgx::Colors::hasChildren ( const QModelIndex &  parent = QModelIndex()) const

◆ headerData()

QVariant mgx::Colors::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

◆ index()

QModelIndex mgx::Colors::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

◆ instance()

static Colors* mgx::Colors::instance ( )
inlinestatic

Definition at line 111 of file Colors.hpp.

◆ parent()

QModelIndex mgx::Colors::parent ( const QModelIndex &  index) const

◆ qcolor()

QColor mgx::Colors::qcolor ( ColorType  type) const
inline

Definition at line 96 of file Colors.hpp.

◆ readParms()

void mgx::Colors::readParms ( Parms parms,
QString  section 
)

◆ resetColors

void mgx::Colors::resetColors ( )
slot

◆ restoreColors

void mgx::Colors::restoreColors ( )
slot

◆ rowCount()

int mgx::Colors::rowCount ( const QModelIndex &  parent = QModelIndex()) const

◆ setColor()

void mgx::Colors::setColor ( const QModelIndex &  index,
QColor  col 
)
inline

Definition at line 91 of file Colors.hpp.

◆ setData()

bool mgx::Colors::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

◆ writeParms()

void mgx::Colors::writeParms ( QTextStream &  pout,
QString  section 
)

Member Data Documentation

◆ _font

QFont mgx::Colors::_font
protected

Definition at line 136 of file Colors.hpp.

◆ _instance

Colors* mgx::Colors::_instance
staticprotected

Definition at line 137 of file Colors.hpp.

◆ backup

std::vector<QColor> mgx::Colors::backup
protected

Definition at line 135 of file Colors.hpp.

◆ categoryNames

const QString mgx::Colors::categoryNames[3]
static

Definition at line 75 of file Colors.hpp.

◆ categoryShift

const int mgx::Colors::categoryShift[3]
static

Definition at line 76 of file Colors.hpp.

◆ categorySize

const int mgx::Colors::categorySize[3]
static

Definition at line 77 of file Colors.hpp.

◆ colorNames

const QString mgx::Colors::colorNames[NbColors]
static

Definition at line 74 of file Colors.hpp.

◆ colors

std::vector<QColor> mgx::Colors::colors
protected

Definition at line 135 of file Colors.hpp.


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