# Class AtomIteratorWithinModel

java.lang.Object
org.jmol.modelset.AtomIteratorWithinModel

All Implemented Interfaces:
  `AtomIndexIterator`

Direct Known Subclasses:
  `AtomIteratorWithinModelSet`

public class AtomIteratorWithinModel extends Object implements AtomIndexIterator

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Bspf`
`bspf`
`protected CubeIterator`
`cubeIterator`
`protected int`
`modelIndex`

## Method Summary

Modifier and Type
Method
Description
`void`
`addAtoms(BS bsResult)`
turns this into a SPHERICAL iterator for "within Distance" measures
`float`
`foundDistance2()`
`P3`
`getPosition()`
`boolean`
`hasNext()`
`protected boolean`
`hasNext2()`
`int`
`next()`
`void`
`release()`
`void`
`setCenter(T3 center, float distance)`
`protected void`
`setCenter2(T3 center, float distance)`
`void`
`setModel(ModelSet modelSet, int modelIndex, int firstModelAtom, int atomIndex, T3 center, float distance, RadiusData rd)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### cubeIterator

protected CubeIterator cubeIterator

### bspf

protected Bspf bspf

### modelIndex

protected int modelIndex

## Method Details

### setModel

public void setModel(ModelSet modelSet, int modelIndex, int firstModelAtom, int atomIndex, T3 center, float distance, RadiusData rd)

Specified by:
  `setModel` in interface `AtomIndexIterator`
Parameters:
  `modelSet` -
  `modelIndex` -
  `firstModelAtom` - an offset used in the AtomIteratorWithinSet only
  `atomIndex` -
  `center` -
  `distance` -
  `rd` -

### setCenter

public void setCenter(T3 center, float distance)

Specified by:
  `setCenter` in interface `AtomIndexIterator`

### setCenter2

protected void setCenter2(T3 center, float distance)

### hasNext

public boolean hasNext()

Specified by:
  `hasNext` in interface `AtomIndexIterator`

### hasNext2

protected boolean hasNext2()

### next

public int next()

Specified by:
  `next` in interface `AtomIndexIterator`

### foundDistance2

public float foundDistance2()

Specified by:
  `foundDistance2` in interface `AtomIndexIterator`

### addAtoms

public void addAtoms(BS bsResult)
turns this into a SPHERICAL iterator for "within Distance" measures

Specified by:
  `addAtoms` in interface `AtomIndexIterator`
Parameters:
  `bsResult` -

### release

public void release()

Specified by:
  `release` in interface `AtomIndexIterator`

### getPosition

public P3 getPosition()

Specified by:
  `getPosition` in interface `AtomIndexIterator`