• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kalzium

Avogadro::Color

Avogadro::Color Class Reference

#include <avogadro/color.h>

Inheritance diagram for Avogadro::Color:

Inheritance graph
[legend]

List of all members.


Detailed Description

Author:
Benoit Jacob

Author:
Geoff Hutchison Color in OpenGL float red, green, blue, alpha format.
This class represents a color in OpenGL float red, green, blue, alpha format.

Definition at line 47 of file src/color.h.


Public Member Functions

float alpha ()
virtual void apply ()
virtual void applyAsFlatMaterials ()
virtual void applyAsMaterials ()
float blue ()
QColor color ()
 Color (const Primitive *)
 Color (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha=1.0)
 Color ()
float green ()
virtual QString name () const
Color & operator= (const QColor &)
float red ()
virtual void set (const Primitive *)
virtual void set (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha=1.0)
virtual void setAlpha (double alpha)
virtual void setName (const QString &name)
virtual QWidget * settingsWidget ()
virtual void setToSelectionColor ()
virtual QString type () const
virtual ~Color ()

Protected Attributes

ColorPrivate * d
GLfloat m_alpha
GLfloat m_blue
GLfloat m_green
QString m_name
GLfloat m_red

Constructor & Destructor Documentation

Avogadro::Color::Color (  ) 

Definition at line 42 of file color.cpp.

Avogadro::Color::~Color (  )  [virtual]

Definition at line 45 of file color.cpp.

Avogadro::Color::Color ( GLfloat  red,
GLfloat  green,
GLfloat  blue,
GLfloat  alpha = 1.0 
)

This constructor sets the four components of the color individually.

Each one ranges from 0.0 (lowest intensity) to 1.0 (highest intensity). For the alpha component, 0.0 means totally transparent and 1.0 (the default) means totally opaque.

Definition at line 49 of file color.cpp.

Avogadro::Color::Color ( const Primitive *  p  ) 

Set the color based on the supplied Primitive.

If NULL is passed do nothing.

Parameters:
Primitive the color is derived from this primitive.

Definition at line 53 of file color.cpp.


Member Function Documentation

float Avogadro::Color::alpha (  )  [inline]

Returns:
the alpha component of the color.

Definition at line 145 of file src/color.h.

virtual void Avogadro::Color::apply (  )  [inline, virtual]

Sets this color to be the one used by OpenGL for rendering when lighting is disabled.

Definition at line 105 of file src/color.h.

void Avogadro::Color::applyAsFlatMaterials (  )  [virtual]

Applies an OpenGL material more appropriate for flat surfaces.

Definition at line 116 of file color.cpp.

void Avogadro::Color::applyAsMaterials (  )  [virtual]

Applies nice OpenGL materials using this color as the diffuse color while using different shades for the ambient and specular colors.

This is only useful if lighting is enabled.

Definition at line 94 of file color.cpp.

float Avogadro::Color::blue (  )  [inline]

Returns:
the blue component of the color.

Definition at line 141 of file src/color.h.

QColor Avogadro::Color::color (  )  [inline]

Returns:
the color as a QColor.

Definition at line 125 of file src/color.h.

float Avogadro::Color::green (  )  [inline]

Returns:
the green component of the color.

Definition at line 137 of file src/color.h.

QString Avogadro::Color::name (  )  const [virtual]

Returns:
the name of this instance of the class.

Definition at line 131 of file color.cpp.

Color & Avogadro::Color::operator= ( const QColor &  other  ) 

Set the color based on the supplied QColor.

Parameters:
QColor the color to use

Definition at line 58 of file color.cpp.

float Avogadro::Color::red (  )  [inline]

Returns:
the red component of the color.

Definition at line 133 of file src/color.h.

void Avogadro::Color::set ( const Primitive *   )  [virtual]

Set the color based on the supplied Primitive.

If NULL is passed do nothing.

Parameters:
Primitive the color is derived from this primitive.

Reimplemented in Avogadro::ElementColor, and Avogadro::ResidueColor.

Definition at line 84 of file color.cpp.

void Avogadro::Color::set ( GLfloat  red,
GLfloat  green,
GLfloat  blue,
GLfloat  alpha = 1.0 
) [virtual]

Set the four components of the color individually.

Each one ranges from 0.0 (lowest intensity) to 1.0 (highest intensity). For the alpha component, 0.0 means totally transparent and 1.0 (the default) means totally opaque.

Definition at line 68 of file color.cpp.

void Avogadro::Color::setAlpha ( double  alpha  )  [virtual]

Set the alpha component of the color, 0.0 means totally transparent and 1.0 means totally opaque.

Definition at line 89 of file color.cpp.

void Avogadro::Color::setName ( const QString &  name  )  [virtual]

Set the name of this instance of the class.

Definition at line 126 of file color.cpp.

virtual QWidget* Avogadro::Color::settingsWidget (  )  [inline, virtual]

Returns:
the widget for controlling settings for this color map or NULL if none exists.

Definition at line 163 of file src/color.h.

void Avogadro::Color::setToSelectionColor (  )  [virtual]

Set the color to the selection color By default, the selection color is (0.3, 0.6, 1.0, 0.7) which is a light transparent blue.

Definition at line 76 of file color.cpp.

virtual QString Avogadro::Color::type (  )  const [inline, virtual]

Returns:
the type of the Color class.

Reimplemented in Avogadro::ElementColor, and Avogadro::ResidueColor.

Definition at line 158 of file src/color.h.


Member Data Documentation

ColorPrivate* Avogadro::Color::d [protected]

The d-pointer used to preserve binary compatibility.

Definition at line 192 of file src/color.h.

GLfloat Avogadro::Color::m_alpha [protected]

The alpha component of the color ranging from 0 to 1.

Definition at line 182 of file src/color.h.

GLfloat Avogadro::Color::m_blue [protected]

The blue component of the color ranging from 0 to 1.

Definition at line 182 of file src/color.h.

GLfloat Avogadro::Color::m_green [protected]

The green component of the color ranging from 0 to 1.

Definition at line 182 of file src/color.h.

QString Avogadro::Color::m_name [protected]

The name of the class instance.

Definition at line 187 of file src/color.h.

GLfloat Avogadro::Color::m_red [protected]

The red component of the color ranging from 0 to 1.

Definition at line 182 of file src/color.h.


The documentation for this class was generated from the following files:
  • src/color.h
  • color.cpp

kalzium

Skip menu "kalzium"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal