casa
$Rev:20696$
|
Simple class which provides brute force n-body simulation and display. More...
#include <NBody.h>
Public Member Functions | |
NBody () | |
Constructor. | |
virtual | ~NBody () |
Destructor. | |
virtual Bool | linToWorld (Vector< Double > &world, const Vector< Double > &lin) |
Coordinate transformations, called by the WorldCanvasHolder. | |
virtual Bool | worldToLin (Vector< Double > &lin, const Vector< Double > &world) |
virtual void | setActiveImage (uInt zindex) |
irrelevant in this part of the tree | |
virtual Vector< String > | worldAxisNames () const |
Routines which yield information on the axis names and units, and some miscellaneous information. | |
virtual Vector< String > | worldAxisUnits () const |
virtual const Unit | dataUnit () |
virtual const RecordInterface & | miscInfo () |
virtual const uInt | nelements (const WorldCanvasHolder &wcHolder) const |
Return the number of elements in this DisplayData. | |
virtual const uInt | nelements () const |
and non-specific | |
virtual void | addElementRestrictions (const uInt itemNum, AttributeBuffer &other) |
Add a restriction for item itemNum of this DisplayData. | |
virtual void | addElementRestriction (const uInt itemNum, Attribute &newRestriction, Bool permanent) |
virtual void | setElementRestrictions (const uInt itemNum, AttributeBuffer &other) |
Set a restriction for item itemNum of this DisplayData. | |
virtual void | setElementRestriction (const uInt itemNum, Attribute &newRestriction) |
virtual void | removeElementRestriction (const uInt itemNum, const String &name) |
Remove a restriction from item itemNum . | |
virtual void | clearElementRestrictions (const uInt itemNum) |
Clear all restrictions of item itemNum (except the ones that are permanent of course). | |
virtual Bool | existElementRestriction (const uInt itemNum, const String &name) |
Check if a restriction for item itemNum with name name exists. | |
virtual AttributeBuffer * | elementRestrictionBuffer (const uInt itemNum) |
Get a handle to the buffer of restrictions for item itemNum . | |
virtual Double | getDataMin () |
Report the minimum and maximum data values for this DisplayData. | |
virtual Double | getDataMax () |
virtual Bool | sizeControl (WorldCanvasHolder &wcHolder, AttributeBuffer &holderBuf) |
sizeControlFunction, called by the WorldCanvasHolder. | |
virtual void | positionEH (const WCPositionEvent &ev) |
Position event handler, called by the WorldCanvasHolder. | |
virtual void | motionEH (const WCMotionEvent &ev) |
Motion event handler, called by the WorldCanvasHolder. | |
virtual void | refreshEH (const WCRefreshEvent &ev) |
Refresh event handler, called by the WorldCanvasHolder. | |
virtual void | cleanup () |
Clean up, ie. | |
virtual String | showPosition (const Vector< Double > &, const Bool &) |
required functions with null implementations | |
virtual String | showValue (const Vector< Double > &) |
Format a string containing value information at the given world coordinate. | |
virtual Display::DisplayDataType | classType () |
Return the DisplayData type; used by the WorldCanvasHolder to determine the order of drawing. | |
Private Member Functions | |
void | setupStars () |
void | cleanupStars () |
void | drawImage (WorldCanvas &wCanvas) |
void | setScale () |
Bool | iDidSizeControl (WorldCanvas &wCanvas) |
Check if this NBody did the sizeControl. | |
void | drawMovie (WorldCanvas &wCanvas, Int numSteps, Double timeStep, Double dampingFactor) |
Private Attributes | |
Bool | turnedOff |
General restrictions (already declared in DisplayData.h) AttributeBuffer restrictions; True if nothing should be drawn by the NBody. | |
Double | dataMin |
The min and max to use for drawing. | |
Double | dataMax |
Double | itsTimeStep |
Double | itsDampingFactor |
Int | itsNumSteps |
Int | itsXSize |
Int | itsYSize |
AttributeBuffer | sizeControlBuf |
internal bookkeeping: buffer for stroing sizecontrol done by this NBody | |
Record | miscInfoDummy |
List< void * > | itsGalaxyList |
ListIter< void * > * | itsGalaxyListIter |
Simple class which provides brute force n-body simulation and display.
This class provides a simple object which can (by brute force) calculated the internal gravitational forces acting on a self-gravitating set of bodies.
Constructor.
virtual casa::NBody::~NBody | ( | ) | [virtual] |
Destructor.
virtual void casa::NBody::addElementRestriction | ( | const uInt | itemNum, |
Attribute & | newRestriction, | ||
Bool | permanent | ||
) | [virtual] |
Reimplemented from casa::DisplayData.
virtual void casa::NBody::addElementRestrictions | ( | const uInt | itemNum, |
AttributeBuffer & | other | ||
) | [virtual] |
Add a restriction for item itemNum
of this DisplayData.
Reimplemented from casa::DisplayData.
virtual Display::DisplayDataType casa::NBody::classType | ( | ) | [inline, virtual] |
Return the DisplayData type; used by the WorldCanvasHolder to determine the order of drawing.
Implements casa::DisplayData.
virtual void casa::NBody::cleanup | ( | ) | [virtual] |
void casa::NBody::cleanupStars | ( | ) | [private] |
virtual void casa::NBody::clearElementRestrictions | ( | const uInt | itemNum | ) | [virtual] |
Clear all restrictions of item itemNum
(except the ones that are permanent of course).
Reimplemented from casa::DisplayData.
virtual const Unit casa::NBody::dataUnit | ( | ) | [virtual] |
void casa::NBody::drawImage | ( | WorldCanvas & | wCanvas | ) | [private] |
void casa::NBody::drawMovie | ( | WorldCanvas & | wCanvas, |
Int | numSteps, | ||
Double | timeStep, | ||
Double | dampingFactor | ||
) | [private] |
virtual AttributeBuffer* casa::NBody::elementRestrictionBuffer | ( | const uInt | itemNum | ) | [virtual] |
Get a handle to the buffer of restrictions for item itemNum
.
Throws an exception of type AipsError if itemNum
is out of range.
Reimplemented from casa::DisplayData.
virtual Bool casa::NBody::existElementRestriction | ( | const uInt | itemNum, |
const String & | name | ||
) | [virtual] |
Check if a restriction for item itemNum
with name name
exists.
Reimplemented from casa::DisplayData.
virtual Double casa::NBody::getDataMax | ( | ) | [virtual] |
virtual Double casa::NBody::getDataMin | ( | ) | [virtual] |
Report the minimum and maximum data values for this DisplayData.
Bool casa::NBody::iDidSizeControl | ( | WorldCanvas & | wCanvas | ) | [private] |
Check if this NBody did the sizeControl.
virtual Bool casa::NBody::linToWorld | ( | Vector< Double > & | world, |
const Vector< Double > & | lin | ||
) | [virtual] |
Coordinate transformations, called by the WorldCanvasHolder.
Implements casa::DisplayData.
virtual const RecordInterface& casa::NBody::miscInfo | ( | ) | [virtual] |
virtual void casa::NBody::motionEH | ( | const WCMotionEvent & | ev | ) | [virtual] |
Motion event handler, called by the WorldCanvasHolder.
Reimplemented from casa::DisplayData.
virtual const uInt casa::NBody::nelements | ( | const WorldCanvasHolder & | wcHolder | ) | const [virtual] |
Return the number of elements in this DisplayData.
Implements casa::DisplayData.
virtual const uInt casa::NBody::nelements | ( | ) | const [virtual] |
and non-specific
Implements casa::DisplayData.
virtual void casa::NBody::positionEH | ( | const WCPositionEvent & | ev | ) | [virtual] |
Position event handler, called by the WorldCanvasHolder.
Reimplemented from casa::DisplayData.
virtual void casa::NBody::refreshEH | ( | const WCRefreshEvent & | ev | ) | [virtual] |
Refresh event handler, called by the WorldCanvasHolder.
Implements casa::DisplayData.
virtual void casa::NBody::removeElementRestriction | ( | const uInt | itemNum, |
const String & | name | ||
) | [virtual] |
Remove a restriction from item itemNum
.
Reimplemented from casa::DisplayData.
virtual void casa::NBody::setActiveImage | ( | uInt | zindex | ) | [inline, virtual] |
virtual void casa::NBody::setElementRestriction | ( | const uInt | itemNum, |
Attribute & | newRestriction | ||
) | [virtual] |
Reimplemented from casa::DisplayData.
virtual void casa::NBody::setElementRestrictions | ( | const uInt | itemNum, |
AttributeBuffer & | other | ||
) | [virtual] |
Set a restriction for item itemNum
of this DisplayData.
Reimplemented from casa::DisplayData.
void casa::NBody::setScale | ( | ) | [private] |
void casa::NBody::setupStars | ( | ) | [private] |
virtual String casa::NBody::showPosition | ( | const Vector< Double > & | , |
const Bool & | |||
) | [inline, virtual] |
required functions with null implementations
Implements casa::DisplayData.
Definition at line 158 of file NBody.h.
References String.
virtual String casa::NBody::showValue | ( | const Vector< Double > & | world | ) | [inline, virtual] |
Format a string containing value information at the given world coordinate.
Implements casa::DisplayData.
Definition at line 160 of file NBody.h.
References String.
virtual Bool casa::NBody::sizeControl | ( | WorldCanvasHolder & | wcHolder, |
AttributeBuffer & | holderBuf | ||
) | [virtual] |
sizeControlFunction, called by the WorldCanvasHolder.
Implements casa::DisplayData.
virtual Vector<String> casa::NBody::worldAxisNames | ( | ) | const [virtual] |
Routines which yield information on the axis names and units, and some miscellaneous information.
Implements casa::DisplayData.
virtual Vector<String> casa::NBody::worldAxisUnits | ( | ) | const [virtual] |
Implements casa::DisplayData.
virtual Bool casa::NBody::worldToLin | ( | Vector< Double > & | lin, |
const Vector< Double > & | world | ||
) | [virtual] |
Implements casa::DisplayData.
Double casa::NBody::dataMax [private] |
Double casa::NBody::dataMin [private] |
Double casa::NBody::itsDampingFactor [private] |
List<void *> casa::NBody::itsGalaxyList [private] |
ListIter<void *>* casa::NBody::itsGalaxyListIter [private] |
Int casa::NBody::itsNumSteps [private] |
Double casa::NBody::itsTimeStep [private] |
Int casa::NBody::itsXSize [private] |
Int casa::NBody::itsYSize [private] |
Record casa::NBody::miscInfoDummy [private] |
AttributeBuffer casa::NBody::sizeControlBuf [private] |
Bool casa::NBody::turnedOff [private] |
General restrictions (already declared in DisplayData.h) AttributeBuffer restrictions; True if nothing should be drawn by the NBody.