$darkmode
DENOPTIM
LWAtom.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2022 Marco Foscato <marco.foscato@uib.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.json;
20
21import javax.vecmath.Point3d;
22
23import org.openscience.cdk.Atom;
24import org.openscience.cdk.PseudoAtom;
25import org.openscience.cdk.interfaces.IAtom;
26
27import denoptim.utils.MoleculeUtils;
28
36public class LWAtom
37{
41 protected String elSymbol = "";
42
46 protected Point3d p3d = null;
47
48//------------------------------------------------------------------------------
49
55 public LWAtom(String elSymbol, Point3d p3d)
56 {
57 this.elSymbol = elSymbol;
58 this.p3d = p3d;
59 }
60
61//------------------------------------------------------------------------------
62
67 public IAtom toIAtom()
68 {
69 IAtom atm = null;
71 {
72 atm = new Atom(elSymbol);
73 } else {
74 atm = new PseudoAtom(elSymbol);
75 }
76 atm.setPoint3d(new Point3d(p3d));
77 return atm;
78 }
79
80//------------------------------------------------------------------------------
81
82}
A light-weight atom representation to facilitate json serialization of IAtom.
Definition: LWAtom.java:37
Point3d p3d
Cartesian coordinates of this center.
Definition: LWAtom.java:46
String elSymbol
The elemental symbol of this center, i.e., an atom or a pseudo-atom.
Definition: LWAtom.java:41
IAtom toIAtom()
Returns a CDK representation of this center.
Definition: LWAtom.java:67
LWAtom(String elSymbol, Point3d p3d)
Constructor.
Definition: LWAtom.java:55
Utilities for molecule conversion.
static boolean isElement(IAtom atom)
Check element symbol corresponds to real element of Periodic Table.