Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

molrender.h

00001 //
00002 // molrender.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027 
00028 #ifdef __GNUC__
00029 #pragma interface
00030 #endif
00031 
00032 #ifndef _chemistry_molecule_molrender_h
00033 #define _chemistry_molecule_molrender_h
00034 
00035 #include <util/render/object.h>
00036 #include <util/keyval/keyval.h>
00037 #include <chemistry/molecule/molecule.h>
00038 #include <chemistry/molecule/atominfo.h>
00039 #include <math/isosurf/surf.h>
00040 
00041 namespace sc {
00042 
00043 class RenderedMolecule: public RenderedObject {
00044   protected:
00045     Ref<RenderedObject> object_;
00046     Ref<Molecule> mol_;
00047     Ref<AtomInfo> atominfo_;
00048 
00049   public:
00050     RenderedMolecule(const Ref<KeyVal>& keyval);
00051     ~RenderedMolecule();
00052 
00053     Ref<Molecule> molecule() { return mol_; }
00054 
00055     // init must be called if the molecule changes
00056     virtual void init() = 0;
00057 
00058     void render(const Ref<Render>&);
00059 };
00060 
00061 
00062 class RenderedStickMolecule: public RenderedMolecule {
00063   protected:
00064     int use_color_;
00065   public:
00066     RenderedStickMolecule(const Ref<KeyVal>& keyval);
00067     ~RenderedStickMolecule();
00068 
00069     void init();
00070 };
00071 
00072 class RenderedBallMolecule: public RenderedMolecule {
00073   protected:
00074   public:
00075     RenderedBallMolecule(const Ref<KeyVal>& keyval);
00076     ~RenderedBallMolecule();
00077 
00078     void init();
00079 };
00080 
00081 class MoleculeColorizer: public DescribedClass {
00082   protected:
00083     Ref<Molecule> mol_;
00084   public:
00085     MoleculeColorizer(const Ref<Molecule> &);
00086     MoleculeColorizer(const Ref<KeyVal>&);
00087     ~MoleculeColorizer();
00088 
00089     virtual void colorize(const Ref<RenderedPolygons> &) = 0;
00090 };
00091 
00092 
00093 class AtomProximityColorizer: public MoleculeColorizer {
00094   protected:
00095     Ref<AtomInfo> atominfo_;
00096   public:
00097     AtomProximityColorizer(const Ref<Molecule>&, const Ref<AtomInfo> &);
00098     AtomProximityColorizer(const Ref<KeyVal> &);
00099     ~AtomProximityColorizer();
00100 
00101     void colorize(const Ref<RenderedPolygons> &);
00102 };
00103 
00104 class RenderedMolecularSurface: public RenderedMolecule {
00105   protected:
00106     Ref<TriangulatedImplicitSurface> surf_;
00107     Ref<MoleculeColorizer> colorizer_;
00108   public:
00109     RenderedMolecularSurface(const Ref<KeyVal>& keyval);
00110     ~RenderedMolecularSurface();
00111 
00112     void init(int reinit_surf);
00113     void init();
00114 };
00115 
00116 }
00117 
00118 #endif
00119 
00120 // Local Variables:
00121 // mode: c++
00122 // c-file-style: "CLJ"
00123 // End:

Generated at Fri Jan 10 08:14:09 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14.