$darkmode
DENOPTIM
FragIsomorphNode.java
Go to the documentation of this file.
1package denoptim.graph;
2
3import javax.vecmath.Point3d;
4
5import org.openscience.cdk.interfaces.IAtom;
6
7import denoptim.utils.MoleculeUtils;
8
9public class FragIsomorphNode
10{
14 String label = "none";
15
19 Object original;
20
24 boolean isAtm = true;
25
26//------------------------------------------------------------------------------
27
28 public FragIsomorphNode(IAtom atm)
29 {
30 this.original = atm;
31 this.label = MoleculeUtils.getSymbolOrLabel(atm);
32 this.isAtm = true;
33 }
34
35//------------------------------------------------------------------------------
36
38 {
39 this.original = ap;
40 this.label = ap.getAPClass().toString();
41 this.isAtm = false;
42 }
43
44//------------------------------------------------------------------------------
45
46 public String getLabel()
47 {
48 return label;
49 }
50
51//------------------------------------------------------------------------------
52
53 public Object getOriginal()
54 {
55 return original;
56 }
57
58//------------------------------------------------------------------------------
59
60 public boolean isAtm()
61 {
62 return isAtm;
63 }
64
65//------------------------------------------------------------------------------
66
67 public Point3d getPoint3d()
68 {
69 if (original instanceof AttachmentPoint)
70 return ((AttachmentPoint) original).getDirectionVector();
71 if (original instanceof IAtom)
72 return MoleculeUtils.getPoint3d((IAtom) original);
73 return null;
74 }
75
76//------------------------------------------------------------------------------
77
78}
String toString()
Do not use this to make SDF representations.
Definition: APClass.java:352
An attachment point (AP) is a possibility to attach a Vertex onto the vertex holding the AP (i....
APClass getAPClass()
Returns the Attachment Point class.
FragIsomorphNode(AttachmentPoint ap)
String label
Elemental symbol or name used to identify the node content.
Object original
Reference to the object that originally generated this node.
boolean isAtm
true if the original object was an atom.
Utilities for molecule conversion.
static String getSymbolOrLabel(IAtom atm)
Gets either the elemental symbol (for standard atoms) of the label (for pseudo-atoms).
static Point3d getPoint3d(IAtom atm)
Return the 3D coordinates, if present.