Avogadro  1.1.0
Public Member Functions
Avogadro::GLHit Class Reference

Hits from OpenGL selections/picking. More...

#include <avogadro/glhit.h>

List of all members.

Public Member Functions

 GLHit ()
 GLHit (const GLHit &glHit)
 GLHit (GLuint type, GLuint name, GLuint minZ, GLuint maxZ)
 ~GLHit ()
bool operator< (const GLHit &other) const
bool operator== (const GLHit &other) const
GLHitoperator= (const GLHit &other)
GLuint type () const
GLuint name () const
GLuint minZ () const
GLuint maxZ () const
void setType (GLuint type)
void setName (GLuint name)
void setMinZ (GLuint minZ)
void setMaxZ (GLuint maxZ)

Detailed Description

Hits from OpenGL selections/picking.

Author:
Donald Ephraim Curtis

Provides an easy to use class to contain OpenGL hits returned from the process of picking. This class relies on the Engine subclasses properly naming the objects that they are rendering. For more information see the Engine documentation.


Constructor & Destructor Documentation

Blank constructor.

Avogadro::GLHit::GLHit ( const GLHit glHit)

Copy constructor.

Avogadro::GLHit::GLHit ( GLuint  type,
GLuint  name,
GLuint  minZ,
GLuint  maxZ 
)

Constructor.

Parameters:
typeThe type of the OpenGL object that was picked which corresponds to the Primitive::Type for the object (i.e. type==Primitive::AtomType means an Atom was picked).
nameThe name of the OpenGL object that was picked corresponding to the primitive index (i.e. name==1 means Atom 1).
minZminimum window Z value of the hit
maxZmaximum window Z value of the hit

References maxZ(), minZ(), name(), and type().

Destructor.


Member Function Documentation

GLuint Avogadro::GLHit::maxZ ( ) const
Returns:
the maximum z value of this hit corresponding to the z value of the drawn object farthest from the camera.

Referenced by GLHit(), and setMaxZ().

GLuint Avogadro::GLHit::minZ ( ) const
Returns:
the minimum z value of this hit corresponding to the z value of the drawn object closest to the camera.

Referenced by GLHit(), and setMinZ().

GLuint Avogadro::GLHit::name ( ) const
bool Avogadro::GLHit::operator< ( const GLHit other) const

Less than operator.

Parameters:
otherthe other GLHit object to compare to.
Returns:
(this->minZ < other->minZ) ? true : false
GLHit & Avogadro::GLHit::operator= ( const GLHit other)

Copy operator.

Parameters:
otherthe GLHit object to set this object equal to.
Returns:
*this
bool Avogadro::GLHit::operator== ( const GLHit other) const

Equivalence operator.

Parameters:
otherthe other GLHit object to test equivalence with.
Returns:
returns true if all elements are equivalent (type, name, minZ, maxZ).
void Avogadro::GLHit::setMaxZ ( GLuint  maxZ)
Parameters:
maxZmaximum z value to set for this object.

References maxZ().

void Avogadro::GLHit::setMinZ ( GLuint  minZ)
Parameters:
minZminimum z value to set for this object.

References minZ().

void Avogadro::GLHit::setName ( GLuint  name)
Parameters:
namenew object name.

References name().

void Avogadro::GLHit::setType ( GLuint  type)
Parameters:
typenew object type.

References type().

GLuint Avogadro::GLHit::type ( ) const

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