chemaxon.struc
Class SelectionMolecule

java.lang.Object
  extended by chemaxon.struc.CGraph
      extended by chemaxon.struc.MoleculeGraph
          extended by chemaxon.struc.SelectionMolecule
All Implemented Interfaces:
MTransformable, chemaxon.struc.ReadableMolecule, StereoConstants, java.io.Serializable, java.lang.Cloneable

public class SelectionMolecule
extends MoleculeGraph

A selection object derived from Molecule's ancestor.

Since:
Marvin 3.0
Version:
5.1, 03/07/2008
Author:
Peter Csizmadia
See Also:
Serialized Form

Field Summary
 
Fields inherited from class chemaxon.struc.MoleculeGraph
AROM_BASIC, AROM_CHEMAXON, AROM_DAYLIGHT, AROM_GENERAL, CACHE_REMOVE_AROMATAMODULE, CACHE_REMOVE_GRINVMODULE, CACHE_REMOVE_PARITYMODULE, CACHE_REMOVE_SSSRMODULE, DIM_MASK, GRINV_DONT_STORE, GRINV_NOHYDROGEN, GRINV_OLDSTEREO, GRINV_STEREO, GRINV_USEMAPS, GRINV_VALUE_OPTIONS, INVALID_LINKNODE_MESSAGE, MIN_RING_SIZE_FOR_TRANS_DB, OMIT_POSTCLEAN, orix, oriy, oriz, propertyContainer, RMCLEANUP_MOBJECT, RMCLEANUP_PARENTDOC, RMCLEANUP_STEREO, useOnlyFirstAtomInStereoCalculation
 
Fields inherited from class chemaxon.struc.CGraph
btab, CACHE_REMOVE_ALL, CACHE_REMOVE_CACHEMEMORY, cacheMemory, cssr, ctab, edgeCount, edges, fragIds, grinv, grinvCC, grinvOptions, INITIAL_CAPACITY, nFrags, nGrinv, nodeCount, nodes, parentGraph, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_FIXCOMPONENT, RMCLEANUP_NONE, sssr, sssr2idx, sssrl2idx, superGraph
 
Fields inherited from interface chemaxon.struc.ReadableMolecule
HS_S, HS_SP, HS_SP2, HS_SP3, HS_UNKNOWN
 
Fields inherited from interface chemaxon.struc.StereoConstants
ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_MASK, CHIRALITY_R, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, TRANS
 
Constructor Summary
SelectionMolecule()
           
 
Method Summary
 void add(CEdge edge)
          Adds an edge to the graph.
protected  void addEdge0(CEdge edge)
          Adds an edge.
protected  void addNode0(CNode node)
          Adds a node.
protected  void checkEdgeConsistency()
          Empty implementation, edge consistency is not checked in case of selections.
 boolean clean(int dim, java.lang.String opts, MProgressMonitor pmon)
          Calculates atom coordinates.
 java.lang.Object clone()
          Create a clone of the selection.
 void clonecopy(CGraph graph)
          Copies the clones of nodes and edges of this graph to another one.
protected  boolean clonecopyCGraphWithoutSgroups(int[] iatoms, CEdge[] cedges, int nb, CGraph g)
          Copies the specified atoms and bonds of this graph to another one.
protected  void fuse0(CGraph g, boolean check)
          Adds those nodes and edges of a graph to this one that are not already elements.
protected  boolean isGrinvCCValid()
          Tests whether the graph invariant change count is valid.
protected  boolean isRealNodeParent()
          Selection molecules are not real node parents.
protected  void regenCtabs()
          Regenerates connection table and edge table.
protected  void regenFragIds()
          Searches the disconnected fragments.
 void removeEdge(CEdge edge)
          Removes an edge by reference.
 void removeEdge(int i)
          Removes an edge from the graph.
 void removeNode(CNode node)
          Removes a node and its edges.
 void removeNode(int i)
          Removes a node and its edges from the graph.
 void setEdge(int i, CEdge edge)
          Sets the edge at the specified index.
protected  void setNode0(int i, CNode node)
          Sets the node at the specified index.
 void swapNodes(int i, int j)
          Swap two nodes.
 void transform(CTransform3D t)
          Apply a transformation matrix to the atomic coordinates.
 
Methods inherited from class chemaxon.struc.MoleculeGraph
addAtomsAndBondsTo, addExplicitHydrogens, addExplicitHydrogens, addExplicitLonePairs, adjustMultiChiralFlag, aromatize, aromatize, aromatize, arrangeComponents, bondlength, calcCenter, calcCenter, calcDehydrogenizedGrinv, calcHeight, calcHybridization, calcOutRect, calcOutRect, calcOutRectCenter, calcOutRectCenter, calcWidth, canBeCT, canBeCT, clean, clear, clearCachedInfo, clearForImport, clonecopy, clonelesscopy, contains, createBHtab, createCHtab, createDehydrogenizedReadOnlyGraph, dearomatize, findAtomClone, fixSelfReferringProperty, getAromaticAndAliphaticRings, getAromrings, getAromrings, getAtom, getAtomArray, getAtomCount, getBond, getBondArray, getBondCount, getCharge, getChirality, getDesiredLength, getDesiredLength, getDim, getDocument, getDocumentForChild, getEdgeArray, getEdgeVector, getExactMass, getExplicitHcount, getExplicitLonePairCount, getFlags, getFormalCharge, getFormula, getGraphUnion, getGrinv, getGrinv, getGrinv, getGrinvOptions, getHybridizationState, getImplicitHcount, getLocalChirality, getLocalParity, getLocation, getLonePairCount, getMass, getMassno, getName, getNeighbor, getNeighborCount, getNodeVector, getNonAromrings, getNonAromrings, getParentDocument, getParity, getPoints, getRadical, getSSSRBondSet, getSSSRBondSetInLong, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getStereo2, getSubGraphCount, getSubGraphs, getSubGraphs, getTotalCharge, getVisibleCoords, hasAtomSet, hasBondSet, hasExplicitLonePairs, hasExtraLabelSet, hasImplicitH, hasSelfReferringProperty, hasValenceError, hydrogenize, implicitizeHydrogens, implicitizeHydrogens, implicitizeHydrogens, isAbsStereo, isAtom, isBond, isMultiChiral, isOnlyFirstAtomInStereoCalculation, isQuery, isRingBond, isSelfReference, isSimilarTo, isValidLinkNode, makeItSimilar, mergeNodes, moveTo, newInstance, partialClean, partialClean, properties, qpropCheck, removeEdge, removeExplicitLonePairs, removeNode, removeNode, restoreCache, revalidateCoordDependentProps, saveCache, setAbsStereo, setAtomSetSeqs, setBondSetSeqs, setChirality, setDim, setFlags, setGrinvOptions, setLinkNodeDefaultOuters, setLocalParity, setLocation, setParity, setParity, setParity, setSetSeqs, stereoClean, sumConservedQuantities, toString, transform, updateDim, useOnlyFirstAtomInStereoCalculation, valenceCheck, valenceCheck
 
Methods inherited from class chemaxon.struc.CGraph
add, addEdgeWithoutChangingIt, addNodeWithoutChangingIt, checkConsistency, contains, contains, findBasicFrags, findComponentIds, findComponentIds, findEdge, findFrag, findFragById, findFrags, findInArray, findNode, fuse, fuse, fuse0, getBtab, getCSSR, getCtab, getEdge, getEdgeCount, getEdgeList, getForefather, getFragCount, getFragIds, getGrinv, getGrinvCC, getLock, getNode, getNodeCount, getParent, getSmallestRingSizeForIdx, getSSSR, getSSSREdges, getSSSRIdxesForAtoms, incGrinvCC, incGrinvCCOnly, indexOf, indexOf, insertEdge, insertEdgeInOrder, insertNode, insertNullEdges, insertNullNodes, isEmpty, isolate, isolate, isRing, isSymmetric, mergeFrags, pack, regenEdges, removeAll, removeAllEdges, removeEdge, removeIsolatedEdges, removeIsolatedNodes, replaceEdge, resetCtab, resetGrinvInParents, setGrinvCC, setNode, sortEdgesAccordingTo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectionMolecule

public SelectionMolecule()
Method Detail

isRealNodeParent

protected boolean isRealNodeParent()
Selection molecules are not real node parents. However, in some special cases a selection molecule can be a node parent.

Overrides:
isRealNodeParent in class CGraph
Returns:
false
Since:
Marvin 3.0

setEdge

public void setEdge(int i,
                    CEdge edge)
Sets the edge at the specified index.

Overrides:
setEdge in class MoleculeGraph
Parameters:
i - edge index
edge - the edge reference

add

public void add(CEdge edge)
Adds an edge to the graph. If the graph is a superGraph, the edge is also added to its endpoints (two CNode objects).

Overrides:
add in class CGraph
Parameters:
edge - the edge object

swapNodes

public void swapNodes(int i,
                      int j)
Swap two nodes.

Parameters:
i - index of the first node
j - index of the second node
Since:
Marvin 3.3, 11/04/2003

removeNode

public void removeNode(CNode node)
Removes a node and its edges.

Overrides:
removeNode in class CGraph
Parameters:
node - the node

removeNode

public void removeNode(int i)
Removes a node and its edges from the graph.

Overrides:
removeNode in class CGraph
Parameters:
i - the node index

removeEdge

public void removeEdge(CEdge edge)
Removes an edge by reference.

Overrides:
removeEdge in class CGraph
Parameters:
edge - the edge

removeEdge

public void removeEdge(int i)
Removes an edge from the graph.

Overrides:
removeEdge in class CGraph
Parameters:
i - the edge index

addNode0

protected void addNode0(CNode node)
Adds a node.

Overrides:
addNode0 in class CGraph
Parameters:
node - the node reference

setNode0

protected void setNode0(int i,
                        CNode node)
Sets the node at the specified index.

Overrides:
setNode0 in class MoleculeGraph
Parameters:
i - node index
node - new node reference

addEdge0

protected void addEdge0(CEdge edge)
Adds an edge.

Overrides:
addEdge0 in class CGraph
Parameters:
edge - the edge reference

regenCtabs

protected void regenCtabs()
Regenerates connection table and edge table.

Overrides:
regenCtabs in class CGraph
Since:
Marvin 3.5.2, 12/16/2004

fuse0

protected void fuse0(CGraph g,
                     boolean check)
Adds those nodes and edges of a graph to this one that are not already elements.

Overrides:
fuse0 in class MoleculeGraph
Parameters:
g - the graph
check - true if a containment check should be performed to ensure that only those nodes and edges are added that are not already elements - false if the graph is known to be disjoint from this graph and this check can be safely skipped
Since:
Marvin 5.0

transform

public void transform(CTransform3D t)
Apply a transformation matrix to the atomic coordinates.

Specified by:
transform in interface MTransformable
Overrides:
transform in class MoleculeGraph
Parameters:
t - the transformation matrix

clonecopy

public void clonecopy(CGraph graph)
Copies the clones of nodes and edges of this graph to another one.

Overrides:
clonecopy in class MoleculeGraph
Parameters:
graph - the target graph

clonecopyCGraphWithoutSgroups

protected boolean clonecopyCGraphWithoutSgroups(int[] iatoms,
                                                CEdge[] cedges,
                                                int nb,
                                                CGraph g)
Copies the specified atoms and bonds of this graph to another one.

Overrides:
clonecopyCGraphWithoutSgroups in class MoleculeGraph
Parameters:
iatoms - array of atoms indices to copy
cedges - array of bonds to copy or null to copy edges in cnodes only
nb - number of edges
g - the target graph
Returns:
false if the nodes array contains all edge end points, true if there is at least one external bond
Since:
Marvin 5.0.2, 03/07/2008

clone

public java.lang.Object clone()
Create a clone of the selection.

Overrides:
clone in class MoleculeGraph
Returns:
the clone

clean

public boolean clean(int dim,
                     java.lang.String opts,
                     MProgressMonitor pmon)
Calculates atom coordinates.

Overrides:
clean in class MoleculeGraph
Parameters:
dim - dimensions
opts - cleaning options
pmon - progress monitor or null
Returns:
true for success, false if an error occured
Throws:
java.lang.SecurityException - cannot load module because of a security problem (firewall)
Since:
Marvin 4.1, 15/08/2006
See Also:
MoleculeGraph.clean(int, java.lang.String)

regenFragIds

protected final void regenFragIds()
Searches the disconnected fragments. Fragment order is determined by the node order. The first fragment is the one containing node 0, the second fragment is the one containing the smallest indexed node not in the first fragment, etc. Provides a proper fragmentation for coordination compounds: keeps the atoms in the sgroupGraph of MulticenterSgroup and its central atom in the same fragment.

Overrides:
regenFragIds in class CGraph
Since:
Marvin 5.0

isGrinvCCValid

protected boolean isGrinvCCValid()
Tests whether the graph invariant change count is valid.

Overrides:
isGrinvCCValid in class CGraph
Returns:
false
Since:
Marvin 5.0, 11/30/2007

checkEdgeConsistency

protected void checkEdgeConsistency()
Empty implementation, edge consistency is not checked in case of selections.

Overrides:
checkEdgeConsistency in class CGraph
Since:
Marvin 5.0, 11/06/2007