42 mAtomLabelTemplate(new
Text),
43 mAtomLabelEffect(new
Effect)
45 VL_DEBUG_SET_OBJECT_NAME()
79 super::operator=(other);
91 std::map<const Atom*, Atom*> atom_map;
92 for(
unsigned i=0; i<other.
atoms().size(); ++i)
95 atom_map[ other.
atom(i) ] =
atoms().back().get();
98 for(
unsigned i=0; i<other.
bonds().size(); ++i)
106 for(
unsigned i=0; i<other.
mCycles.size(); ++i)
109 for(
unsigned j=0; j<other.
cycle(i).size(); ++j)
110 cycle(i)[j] = atom_map[ other.
cycle(i)[j].get() ];
122 atoms().push_back(atom);
134 std::vector<Bond*> incident_bonds;
136 for(
unsigned j=0; j<incident_bonds.size(); ++j)
143 for(
unsigned i=0; i<
atoms().size(); ++i)
147 std::vector<Bond*> incident_bonds;
149 for(
unsigned j=0; j<incident_bonds.size(); ++j)
163 bonds().push_back(bond);
173 for(
unsigned i=0; i<
bonds().size(); ++i)
175 return bonds()[i].get();
181 for(
unsigned i=0; i<
bonds().size(); ++i)
183 return bonds()[i].get();
190 bonds().push_back(bond);
195 for(
unsigned i=0; i<
bonds().size(); ++i)
211 for(
unsigned i=0; i<
bonds().size(); ++i)
213 if ( (
bond(i)->atom1() == a1 &&
bond(i)->atom2() == a2) ||
237 incident_bonds.clear();
240 incident_bonds.push_back(
bond(i) );
245 for(
unsigned i=0; i<
atoms().size(); ++i)
251 for(
unsigned i=0; i<
atoms().size(); ++i)
252 atoms()[i]->setColor( color );
257 for(
unsigned i=0; i<
atoms().size(); ++i)
263 for(
unsigned i=0; i<
atoms().size(); ++i)
269 for(
unsigned i=0; i<
atoms().size(); ++i)
275 for(
unsigned i=0; i<
atoms().size(); ++i)
281 for(
unsigned i=0; i<
atoms().size(); ++i)
282 atoms()[i]->setRadius( radius );
287 for(
unsigned i=0; i<
bonds().size(); ++i)
288 bonds()[i]->setRadius( radius );
293 for(
unsigned i=0; i<
atoms().size(); ++i)
300 for(
unsigned i=0; i<
bonds().size(); ++i)
303 bonds()[i]->setColor(color);
The Molecule class is used to manage and render 3D molecular structures.
std::map< ref< Bond >, ref< Actor > > mBondToActorMap
Vector4< float > fvec4
A 4 components vector with float precision.
void eraseBond(Bond *bond)
void setAtomRadii(float radius)
Sets all the atoms' radii to the specified one.
A Renderable that renders text with a given Font.
void setAtom1(Atom *atom)
const std::vector< ref< Atom > > & cycle(int i) const
Returns the i-th cycle.
void setEmpiricalAtomRadii(float percentage=1.0f)
Sets all the atoms' radii to their empirical atom radii.
EMoleculeStyle mMoleculeStyle
const Atom * atom(int index) const
If enabled, blend the incoming RGBA color values with the values in the color buffers, see also BlendFunc for more information.
const std::vector< ref< Bond > > & bonds() const
void setVisible(bool visible)
bool mMoleculeToActorMapEnabled
ref< ActorTree > mActorTree
void setVanDerWaalsAtomRadii(float percentage=1.0f)
Sets all the atoms' radii to their van der Waals atom radii.
const std::vector< ref< Atom > > & atoms() const
std::vector< ref< Bond > > mBonds
Visualization Library main namespace.
void setAromaticBondsColor(const fvec4 &color)
const ActorCollection * actors() const
Returns the actors contained in a ActorTree node.
void prepareBondInsert(int bonus=100)
std::map< ref< Actor >, ref< Atom > > mActorToAtomMap
EAtomType atomType(const char *type)
Translates a string containing atom type name, atom symbol or a Sybyl type into an EAtomType...
void setAtom2(Atom *atom)
const std::vector< Atom *> & adjacentAtoms() const
const Bond * bond(int index) const
void setAtomTypeVisible(EAtomType type, bool visible)
std::vector< ref< Atom > > mAtoms
Defines the sequence of Shader objects used to render an Actor.
void setCovalentAtomRadii(float percentage=1.0f)
Sets all the atoms' radii to their covalent atom radii.
const AtomInfo & atomInfo(EAtomType type)
Returns an AtomInfo representing the properties of the given atom type.
EAtomType atomType() const
std::map< ref< Actor >, ref< Bond > > mActorToBondMap
void computeAtomAdjacency()
void setAtomColors(const fvec4 &color)
Sets all the atoms' color to the specified color.
void prepareAtomInsert(int bonus=100)
void setCPKAtomColors()
Sets all the atoms' color to their CPK color.
void eraseAtom(Atom *atom)
ref< Effect > mAtomLabelEffect
void setBondRadii(float radius)
Sets all the bonds' radii to the specified one.
The Bond class represents a bond to be used with the Molecule class.
std::map< ref< Atom >, ref< Actor > > mAtomToActorMap
The ref<> class is used to reference-count an Object.
The Atom class represents an atom to be used with the Molecule class.
void setCalculatedAtomRadii(float percentage=1.0f)
Sets all the atoms' radii to their calculated atom radii.
bool mActorToMoleculeMapEnabled
The ActorTree class implements a generic tree whose nodes contain Actors.
Molecule & operator=(const Molecule &other)
String & clear()
Clears the string.
A set of key/value pairs usually used to associate generic information, tags, attributes etc...
std::vector< std::vector< ref< Atom > > > mCycles
void incidentBonds(std::vector< Bond *> &inc_bonds, Atom *atom)