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

kalzium

Avogadro::SphereEngine

Avogadro::SphereEngine Class Reference

#include <sphereengine.h>

Inheritance diagram for Avogadro::SphereEngine:

Inheritance graph
[legend]

List of all members.


Detailed Description

Sphere Engine class.

Definition at line 42 of file sphereengine.h.


Public Member Functions

 SphereEngine (QObject *parent=0)
 ~SphereEngine ()
double radius (const Primitive *p=0)
Description methods
QString name ()
QString description ()
Render Methods
bool render (const Atom *a)
bool render (GLWidget *gl)

Constructor & Destructor Documentation

Avogadro::SphereEngine::SphereEngine ( QObject *  parent = 0  )  [inline]

Constructor.

Definition at line 48 of file sphereengine.h.

Avogadro::SphereEngine::~SphereEngine (  )  [inline]

Deconstructor.

Definition at line 50 of file sphereengine.h.


Member Function Documentation

QString Avogadro::SphereEngine::name (  )  [inline, virtual]

Returns:
engine name

Implements Avogadro::Engine.

Definition at line 55 of file sphereengine.h.

QString Avogadro::SphereEngine::description (  )  [inline, virtual]

Returns:
engine description

Implements Avogadro::Engine.

Definition at line 57 of file sphereengine.h.

bool SphereEngine::render ( const Atom *  a  ) 

Render an Atom.

Definition at line 89 of file sphereengine.cpp.

bool SphereEngine::render ( GLWidget *  gl  )  [virtual]

Render a PrimitiveQueue.

This function is allowed to rendering whatever primitives it wishes. There is no requirement that it render every primitive.

Parameters:
queue This parameter is of type PrimitiveQueue which provides an organized list of Primitive* objects. During generation of the GL view engines will have their render function called at most once. It is the responsibility of the engine to render all of the objects in it's queue if it can.
Returns:
true if the rendering was completed successfully, false otherwise
Example
 Engine::render(const PrimitiveQueue *queue)
 {
   const QList<Primitive *> *list;

   glPushName(Primitive::AtomType);
   list = q->primitiveList(Primitive::AtomType);
   for( int i=0; i<list->size(); i++ ) {
     Bond *atom = (*list)[i];
     glPushName(atom->GetIdx());
     *** render atom ***
     glPopName();
   }

   glPushName(Primitive::BondType);
   list = q->primitiveList(Primitive::BondType);
   for( int i=0; i<list->size(); i++ ) {
     Bond *bond = (*list)[i];
     glPushName(bond->GetIdx());
     *** render bond ***
     glPopName();
   }
   glPopName();

   return true;
 }

Note:
To allow picking to happen you need to push the object type and name. If objects cannot be picked this may be omitted.
For more information on the various primitive lists available see PrimitiveQueue.

Implements Avogadro::Engine.

Definition at line 45 of file sphereengine.cpp.

double SphereEngine::radius ( const Primitive *  primitive = 0  )  [virtual]

Get the radius of the primitive referred to.

Parameters:
primitive is the Primitive to get the radius of
Returns:
the radius of the Primitive

Reimplemented from Avogadro::Engine.

Definition at line 72 of file sphereengine.cpp.


The documentation for this class was generated from the following files:
  • sphereengine.h
  • sphereengine.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