NBody.h

Classes

NBody -- Simple class which provides brute force n-body simulation and display. (full description)

class NBody : public DisplayData

Interface

Public Members
NBody()
virtual ~NBody()
virtual Bool linToWorld(Vector<Double>& world, const Vector<Double>& lin)
virtual Bool worldToLin(Vector<Double>& lin, const Vector<Double>& world)
virtual void setActiveImage(uInt zindex)
virtual Vector<String> worldAxisNames()
virtual Vector<String> worldAxisUnits()
virtual const Unit dataUnit()
virtual const RecordInterface& miscInfo()
virtual const uInt nelements(const WorldCanvasHolder& wcHolder) const
virtual const uInt nelements() const
virtual void addElementRestrictions(const uInt itemNum, AttributeBuffer& other)
virtual void addElementRestriction(const uInt itemNum, Attribute& newRestriction, Bool permanent)
virtual void setElementRestrictions(const uInt itemNum, AttributeBuffer& other)
virtual void setElementRestriction(const uInt itemNum, Attribute& newRestriction)
virtual void removeElementRestriction(const uInt itemNum, const String& name)
virtual void clearElementRestrictions(const uInt itemNum)
virtual Bool existElementRestriction(const uInt itemNum, const String& name)
virtual AttributeBuffer *elementRestrictionBuffer(const uInt itemNum)
virtual Double getDataMin()
virtual Double getDataMax()
virtual Bool sizeControl(WorldCanvasHolder& wcHolder, AttributeBuffer& holderBuf)
virtual void positionEH(const WCPositionEvent& ev)
virtual void motionEH(const WCMotionEvent& ev)
virtual void refreshEH(const WCRefreshEvent& ev)
virtual void cleanup()
virtual String showPosition(const Vector<Double> &, const Bool &)
virtual String showValue(const Vector<Double> &)
virtual Display::DisplayDataType classType()
Private Members
void setupStars()
void cleanupStars()
void drawImage(WorldCanvas& wCanvas)
void setScale()
Bool iDidSizeControl(WorldCanvas& wCanvas)
void drawMovie(WorldCanvas& wCanvas, Int numSteps, Double timeStep, Double dampingFactor)

Description

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.

Member Description

NBody()

Constructor.

virtual ~NBody()

Destructor.

virtual Bool linToWorld(Vector<Double>& world, const Vector<Double>& lin)
virtual Bool worldToLin(Vector<Double>& lin, const Vector<Double>& world)

Coordinate transformations, called by the WorldCanvasHolder.

virtual void setActiveImage(uInt zindex)

irrelevant in this part of the tree

virtual Vector<String> worldAxisNames()
virtual Vector<String> worldAxisUnits()
virtual const Unit dataUnit()
virtual const RecordInterface& miscInfo()

Routines which yield information on the axis names and units, and some miscellaneous information.

virtual const uInt nelements(const WorldCanvasHolder& wcHolder) const

Return the number of elements in this DisplayData.

virtual const uInt nelements() const

virtual void addElementRestrictions(const uInt itemNum, AttributeBuffer& other)
virtual void addElementRestriction(const uInt itemNum, Attribute& newRestriction, Bool permanent)

Add a restriction for item itemNum of this DisplayData.

virtual void setElementRestrictions(const uInt itemNum, AttributeBuffer& other)
virtual void setElementRestriction(const uInt itemNum, Attribute& newRestriction)

Set a restriction for item itemNum of this DisplayData.

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. Throws an exception of type AipsError if itemNum is out of range.

virtual Double getDataMin()
virtual Double getDataMax()

Report the minimum and maximum data values for this DisplayData.

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. remove cached images etc.

virtual String showPosition(const Vector<Double> &, const Bool &)

required functions with null implementations

virtual String showValue(const Vector<Double> &)

virtual Display::DisplayDataType classType()

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)