[0b990d] | 1 | //
|
---|
| 2 | // molrender.h
|
---|
| 3 | //
|
---|
| 4 | // Copyright (C) 1996 Limit Point Systems, Inc.
|
---|
| 5 | //
|
---|
| 6 | // Author: Curtis Janssen <cljanss@limitpt.com>
|
---|
| 7 | // Maintainer: LPS
|
---|
| 8 | //
|
---|
| 9 | // This file is part of the SC Toolkit.
|
---|
| 10 | //
|
---|
| 11 | // The SC Toolkit is free software; you can redistribute it and/or modify
|
---|
| 12 | // it under the terms of the GNU Library General Public License as published by
|
---|
| 13 | // the Free Software Foundation; either version 2, or (at your option)
|
---|
| 14 | // any later version.
|
---|
| 15 | //
|
---|
| 16 | // The SC Toolkit is distributed in the hope that it will be useful,
|
---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | // GNU Library General Public License for more details.
|
---|
| 20 | //
|
---|
| 21 | // You should have received a copy of the GNU Library General Public License
|
---|
| 22 | // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
|
---|
| 23 | // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 24 | //
|
---|
| 25 | // The U.S. Government is granted a limited license as per AL 91-7.
|
---|
| 26 | //
|
---|
| 27 |
|
---|
| 28 | #ifdef __GNUC__
|
---|
| 29 | #pragma interface
|
---|
| 30 | #endif
|
---|
| 31 |
|
---|
| 32 | #ifndef _chemistry_molecule_molrender_h
|
---|
| 33 | #define _chemistry_molecule_molrender_h
|
---|
| 34 |
|
---|
| 35 | #include <util/render/object.h>
|
---|
| 36 | #include <util/keyval/keyval.h>
|
---|
| 37 | #include <chemistry/molecule/molecule.h>
|
---|
| 38 | #include <chemistry/molecule/atominfo.h>
|
---|
| 39 | #include <math/isosurf/surf.h>
|
---|
| 40 |
|
---|
| 41 | namespace sc {
|
---|
| 42 |
|
---|
| 43 | class RenderedMolecule: public RenderedObject {
|
---|
| 44 | protected:
|
---|
| 45 | Ref<RenderedObject> object_;
|
---|
| 46 | Ref<Molecule> mol_;
|
---|
| 47 | Ref<AtomInfo> atominfo_;
|
---|
| 48 |
|
---|
| 49 | public:
|
---|
| 50 | RenderedMolecule(const Ref<KeyVal>& keyval);
|
---|
| 51 | ~RenderedMolecule();
|
---|
| 52 |
|
---|
| 53 | Ref<Molecule> molecule() { return mol_; }
|
---|
| 54 |
|
---|
| 55 | // init must be called if the molecule changes
|
---|
| 56 | virtual void init() = 0;
|
---|
| 57 |
|
---|
| 58 | void render(const Ref<Render>&);
|
---|
| 59 | };
|
---|
| 60 |
|
---|
| 61 |
|
---|
| 62 | class RenderedStickMolecule: public RenderedMolecule {
|
---|
| 63 | protected:
|
---|
| 64 | int use_color_;
|
---|
| 65 | public:
|
---|
| 66 | RenderedStickMolecule(const Ref<KeyVal>& keyval);
|
---|
| 67 | ~RenderedStickMolecule();
|
---|
| 68 |
|
---|
| 69 | void init();
|
---|
| 70 | };
|
---|
| 71 |
|
---|
| 72 | class RenderedBallMolecule: public RenderedMolecule {
|
---|
| 73 | protected:
|
---|
| 74 | public:
|
---|
| 75 | RenderedBallMolecule(const Ref<KeyVal>& keyval);
|
---|
| 76 | ~RenderedBallMolecule();
|
---|
| 77 |
|
---|
| 78 | void init();
|
---|
| 79 | };
|
---|
| 80 |
|
---|
| 81 | class MoleculeColorizer: public DescribedClass {
|
---|
| 82 | protected:
|
---|
| 83 | Ref<Molecule> mol_;
|
---|
| 84 | public:
|
---|
| 85 | MoleculeColorizer(const Ref<Molecule> &);
|
---|
| 86 | MoleculeColorizer(const Ref<KeyVal>&);
|
---|
| 87 | ~MoleculeColorizer();
|
---|
| 88 |
|
---|
| 89 | virtual void colorize(const Ref<RenderedPolygons> &) = 0;
|
---|
| 90 | };
|
---|
| 91 |
|
---|
| 92 |
|
---|
| 93 | class AtomProximityColorizer: public MoleculeColorizer {
|
---|
| 94 | protected:
|
---|
| 95 | Ref<AtomInfo> atominfo_;
|
---|
| 96 | public:
|
---|
| 97 | AtomProximityColorizer(const Ref<Molecule>&, const Ref<AtomInfo> &);
|
---|
| 98 | AtomProximityColorizer(const Ref<KeyVal> &);
|
---|
| 99 | ~AtomProximityColorizer();
|
---|
| 100 |
|
---|
| 101 | void colorize(const Ref<RenderedPolygons> &);
|
---|
| 102 | };
|
---|
| 103 |
|
---|
| 104 | class RenderedMolecularSurface: public RenderedMolecule {
|
---|
| 105 | protected:
|
---|
| 106 | Ref<TriangulatedImplicitSurface> surf_;
|
---|
| 107 | Ref<MoleculeColorizer> colorizer_;
|
---|
| 108 | public:
|
---|
| 109 | RenderedMolecularSurface(const Ref<KeyVal>& keyval);
|
---|
| 110 | ~RenderedMolecularSurface();
|
---|
| 111 |
|
---|
| 112 | void init(int reinit_surf);
|
---|
| 113 | void init();
|
---|
| 114 | };
|
---|
| 115 |
|
---|
| 116 | }
|
---|
| 117 |
|
---|
| 118 | #endif
|
---|
| 119 |
|
---|
| 120 | // Local Variables:
|
---|
| 121 | // mode: c++
|
---|
| 122 | // c-file-style: "CLJ"
|
---|
| 123 | // End:
|
---|