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

kalzium

Avogadro::Color

Avogadro::Color Class Reference

#include <color.h>

List of all members.


Detailed Description

This class represents a color in OpenGL float red-green-blue-alpha format.

Author:
Benoit Jacob <jacob@math.jussieu.fr>

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


Public Member Functions

 Color ()
virtual ~Color ()
 Color (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha=1.0)
 Color (const OpenBabel::OBAtom *atom)
Color & operator= (const Color &other)
virtual void set (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha=1.0)
virtual void set (const OpenBabel::OBAtom *atom)
virtual void set (double value, double low, double high)
virtual void apply ()
virtual void applyAsMaterials ()

Constructor & Destructor Documentation

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

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

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

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

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 fully transparent and 1.0 (the default) means fully opaque.

Definition at line 34 of file color.cpp.

Avogadro::Color::Color ( const OpenBabel::OBAtom *  atom  ) 

This constructor uses OpenBabel to retrieve the color in which the atom should be rendered.

Default is to render based on element.


Member Function Documentation

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

Equal overloading operator.

Definition at line 45 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 fully transparent and 1.0 (the default) means fully opaque.

Definition at line 55 of file color.cpp.

void Avogadro::Color::set ( const OpenBabel::OBAtom *  atom  )  [virtual]

Set the color in which the atom should be rendered.

If NULL is passed, do nothing

Definition at line 63 of file color.cpp.

void Avogadro::Color::set ( double  value,
double  low,
double  high 
) [virtual]

Set the color from an floating-point range Default will just set white for everything.

Definition at line 75 of file color.cpp.

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 86 of file src/color.h.

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 83 of file color.cpp.


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
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
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