casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::NBody Class Reference

Simple class which provides brute force n-body simulation and display. More...

#include <NBody.h>

Inheritance diagram for casa::NBody:
casa::DisplayData casa::DisplayOptions casa::DisplayEH casa::DlTarget

List of all members.

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< StringworldAxisNames () const
 Routines which yield information on the axis names and units, and some miscellaneous information.
virtual Vector< StringworldAxisUnits () const
virtual const Unit dataUnit ()
virtual const RecordInterfacemiscInfo ()
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 AttributeBufferelementRestrictionBuffer (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

Detailed Description

Simple class which provides brute force n-body simulation and display.

Review Status

Date Reviewed:
yyyy/mm/dd

Synopsis

This class provides a simple object which can (by brute force) calculated the internal gravitational forces acting on a self-gravitating set of bodies.

Definition at line 66 of file NBody.h.


Constructor & Destructor Documentation

Constructor.

virtual casa::NBody::~NBody ( ) [virtual]

Destructor.


Member Function Documentation

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.

Definition at line 162 of file NBody.h.

virtual void casa::NBody::cleanup ( ) [virtual]

Clean up, ie.

remove cached images etc.

Implements casa::DisplayData.

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]

irrelevant in this part of the tree

Definition at line 83 of file NBody.h.

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.


Member Data Documentation

Definition at line 179 of file NBody.h.

The min and max to use for drawing.

Definition at line 178 of file NBody.h.

Definition at line 182 of file NBody.h.

List<void *> casa::NBody::itsGalaxyList [private]

Definition at line 200 of file NBody.h.

Definition at line 201 of file NBody.h.

Definition at line 183 of file NBody.h.

Definition at line 181 of file NBody.h.

Definition at line 184 of file NBody.h.

Definition at line 185 of file NBody.h.

Definition at line 198 of file NBody.h.

internal bookkeeping: buffer for stroing sizecontrol done by this NBody

Definition at line 189 of file NBody.h.

General restrictions (already declared in DisplayData.h) AttributeBuffer restrictions; True if nothing should be drawn by the NBody.

Definition at line 175 of file NBody.h.


The documentation for this class was generated from the following file: