casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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

Public Member Functions

 NBody ()
 Constructor. More...
 
virtual ~NBody ()
 Destructor. More...
 
virtual casacore::Bool linToWorld (casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &lin)
 casacore::Coordinate transformations, called by the WorldCanvasHolder. More...
 
virtual casacore::Bool worldToLin (casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &world)
 
virtual void setActiveImage (casacore::uInt)
 irrelevant in this part of the tree More...
 
virtual casacore::Vector
< casacore::String
worldAxisNames () const
 Routines which yield information on the axis names and units, and some miscellaneous information. More...
 
virtual casacore::Vector
< casacore::String
worldAxisUnits () const
 
virtual const casacore::Unit dataUnit ()
 
virtual const
casacore::RecordInterface
miscInfo ()
 
virtual casacore::uInt nelements (const WorldCanvasHolder &wcHolder) const
 Return the number of elements in this DisplayData. More...
 
virtual casacore::uInt nelements () const
 and non-specific More...
 
virtual void addElementRestrictions (const casacore::uInt itemNum, AttributeBuffer &other)
 Add a restriction for item itemNum of this DisplayData. More...
 
virtual void addElementRestriction (const casacore::uInt itemNum, Attribute &newRestriction, casacore::Bool permanent)
 
virtual void setElementRestrictions (const casacore::uInt itemNum, AttributeBuffer &other)
 Set a restriction for item itemNum of this DisplayData. More...
 
virtual void setElementRestriction (const casacore::uInt itemNum, Attribute &newRestriction)
 
virtual void removeElementRestriction (const casacore::uInt itemNum, const casacore::String &name)
 Remove a restriction from item itemNum. More...
 
virtual void clearElementRestrictions (const casacore::uInt itemNum)
 Clear all restrictions of item itemNum (except the ones that are permanent of course). More...
 
virtual casacore::Bool existElementRestriction (const casacore::uInt itemNum, const casacore::String &name)
 Check if a restriction for item itemNum with name name exists. More...
 
virtual AttributeBufferelementRestrictionBuffer (const casacore::uInt itemNum)
 Get a handle to the buffer of restrictions for item itemNum. More...
 
virtual casacore::Double getDataMin ()
 Report the minimum and maximum data values for this DisplayData. More...
 
virtual casacore::Double getDataMax ()
 
virtual casacore::Bool sizeControl (WorldCanvasHolder &wcHolder, AttributeBuffer &holderBuf)
 sizeControlFunction, called by the WorldCanvasHolder. More...
 
virtual void positionEH (const WCPositionEvent &ev)
 Position event handler, called by the WorldCanvasHolder. More...
 
virtual void motionEH (const WCMotionEvent &ev)
 Motion event handler, called by the WorldCanvasHolder. More...
 
virtual void refreshEH (const WCRefreshEvent &ev)
 Refresh event handler, called by the WorldCanvasHolder. More...
 
virtual void cleanup ()
 Clean up, ie. More...
 
virtual casacore::String showPosition (const casacore::Vector< casacore::Double > &, const casacore::Bool &)
 required functions with null implementations More...
 
virtual casacore::String showValue (const casacore::Vector< casacore::Double > &)
 casacore::Format a string containing value information at the given world coordinate More...
 
virtual Display::DisplayDataType classType ()
 Return the DisplayData type; used by the WorldCanvasHolder to determine the order of drawing. More...
 
- Public Member Functions inherited from casa::DisplayData
 DisplayData ()
 (Required) default constructor. More...
 
virtual ~DisplayData ()
 required destructor More...
 
virtual std::string errorMessage () const =0
 
virtual void setDisplayState (DisplayState s)
 
virtual DisplayState getDisplayState () const
 
virtual bool isDisplayable () const
 
virtual void addRestrictions (AttributeBuffer &otherBuf)
 Add general restrictions or a restriction for item itemNum of this DisplayData. More...
 
virtual void addRestriction (Attribute &newRestriction, casacore::Bool permanent)
 
virtual void setRestrictions (AttributeBuffer &otherBuf)
 Set general restrictions or a restriction for item itemNum of this DisplayData. More...
 
virtual void setRestriction (Attribute &newRestriction)
 
virtual void removeRestriction (const casacore::String &name)
 Remove a general restriction or a restriction from item itemNum More...
 
virtual void clearRestrictions ()
 Clear all general restrictions or all restrictions of item itemNum (except the ones that are permanent of course...) More...
 
virtual casacore::Bool existRestriction (const casacore::String &name)
 Check if a general restriction or a restriction for item itemNum with name name exists. More...
 
virtual AttributeBufferrestrictionBuffer ()
 Get a handle to the buffer of general restrictions or of the buffer of restrictions for item itemNum More...
 
virtual casacore::Bool conformsTo (const WorldCanvas *wCanvas)
 Check whether the DD is is compatible with all WC[H] state, including its coordinate state, restrictions, and zIndex (if any). More...
 
virtual casacore::Bool conformsTo (const WorldCanvas &wc)
 
virtual casacore::Bool conformsToRstrs (const WorldCanvas &wc)
 Determine whether DD restrictions are in conformance with restrictions on the given WCH. More...
 
virtual casacore::Bool conformsToCS (const WorldCanvas &)
 Determine whether DD is compatible with the WC[H]'s current world coordinates. More...
 
virtual casacore::Bool conformsToZIndex (const WorldCanvas &wc)
 Determine whether DD is compatible with the current canvas animation (zIndex) position. More...
 
virtual casacore::Int activeZIndex (const WorldCanvas *wc=0)
 Retrieve 'Active' zIndex. More...
 
virtual casacore::Bool getFirstZIndex (int &firstZIndex, casacore::Int axZrng=-1) const
 Set firstZIndex to minimum zIndex setting from all canvases where this DD is registered. More...
 
virtual void addPositionEventHandler (WCPositionEH *positionHandler)
 Add event handlers on the DisplayData. More...
 
virtual void addMotionEventHandler (WCMotionEH *motionHandler)
 
virtual void addRefreshEventHandler (WCRefreshEH *refreshHandler)
 
virtual void addDisplayEventHandler (DisplayEH *displayHandler)
 
virtual void removePositionEventHandler (WCPositionEH &positionHandler)
 Remove eventhandlers. More...
 
virtual void removeMotionEventHandler (WCMotionEH &motionHandler)
 
virtual void removeRefreshEventHandler (WCRefreshEH &refreshHandler)
 
virtual void removeDisplayEventHandler (DisplayEH &displayHandler)
 
virtual void setColormap (Colormap *cmap, casacore::Float weight)
 Set/remove/get a ColourMap (sorry, ColorMap) for this DisplayData setColormap() throw an casacore::AipsError is a null pointer is passed. More...
 
virtual void removeColormap ()
 
virtual Colormapcolormap () const
 
void setAttribute (Attribute &at)
 set an Attribute or Attributes More...
 
void setAttributes (AttributeBuffer &at)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::uInt &newValue)
 User interface to get value from the attribute buffer. More...
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Int &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Float &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Double &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Bool &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::String &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::uInt > &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Int > &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Float > &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Double > &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Bool > &newValue)
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::String > &newValue)
 
casacore::Bool existsAttribute (casacore::String &name)
 Check if a certain Attribute exists. More...
 
void removeAttribute (casacore::String &name)
 Remove an Attribute. More...
 
AttValue::ValueType attributeType (casacore::String &name)
 Get the type of the Attribute. More...
 
void setAttributeOnPrimaryWCHs (Attribute &at)
 Set an attribute on any WorldCanvas for which this DD is CS master. More...
 
virtual void notifyRegister (WorldCanvasHolder *wcHolder)
 
virtual void notifyUnregister (WorldCanvasHolder &wcHolder, casacore::Bool ignoreRefresh=false)
 ignoreRefresh tells the DD not to refresh just to clean up DMs More...
 
virtual void removeFromAllWCHs ()
 remove this DD everywhere–will stop any more refresh handling by the DD. More...
 
virtual void setDefaultOptions ()
 install the default options for this DisplayData More...
 
virtual casacore::Bool setOptions (casacore::Record &rec, casacore::Record &recOut)
 apply options stored in val to the DisplayData; return value true means a refresh is needed... More...
 
virtual casacore::Record getOptions (bool scrub=false) const
 retrieve the current and default options and parameter types. More...
 
virtual void refresh (casacore::Bool clean=false)
 an explicit refresh: should be called if the DisplayData is changed such that drawing is required. More...
 
virtual casacore::Bool labelAxes (const WCRefreshEvent &ev)
 an explicit request to draw the axes and/or labels. More...
 
virtual casacore::Bool canLabelAxes () const
 
virtual casacore::String className () const
 Return the class name of this DisplayData; useful mostly for debugging purposes, and perhaps future use in the glish widget interface. More...
 
virtual casacore::String description () const
 
virtual casacore::String dataType () const =0
 
virtual const casacore::IPosition dataShape () const =0
 
virtual casacore::uInt dataDim () const =0
 
virtual const casacore::Unit dataUnit () const =0
 
virtual std::vector< int > displayAxes () const =0
 
virtual ImageAnalysis * imageanalysis () const
 Get image analyis about images... More...
 
virtual std::shared_ptr
< casacore::ImageInterface
< casacore::Float > > 
imageinterface ()
 Returns a pointer that should not be deleted... More...
 
virtual void setSubstituteTitleText (const casacore::String)
 
const WorldCanvasHolderfindHolder (const WorldCanvas *wCanvas) const
 Identify the WorldCanvasHolder for the given WorldCanvas. More...
 
WorldCanvasHolderfindHolder (const WorldCanvas *wCanvas)
 
virtual casacore::Block
< casacore::Int
allZIndices (casacore::Int axZrng=-1) const
 Return a sorted casacore::Block of all animation frame numbers currently set onto all WCHs where this DD is registered. More...
 
virtual casacore::Bool zIndexHint (casacore::Int &) const
 Will be called just before registering the [GTk]DD on a [GTk]PanelDisplay which has none registered on it yet. More...
 
virtual void handleEvent (DisplayEvent &ev)
 Overide DisplayEH::handleEvent. More...
 
virtual casacore::Bool isCSmaster (const WorldCanvasHolder *wch=0) const
 Is this DD the CS master of the passed WCH? Defaulting wch to 0 asks whether this DD is CS master of some WCH on which it is registered. More...
 
virtual casacore::Int uiBase () const
 DD 'Absolute Pixel Coordinates', e.g. More...
 
virtual void setUIBase (casacore::Int uibase)
 
virtual casacore::Bool getDelTmpData ()
 Get and set method for the flag. More...
 
virtual void setDelTmpData (casacore::Bool delTmpData)
 
virtual void setDisplayDataRed (DisplayData *)
 
virtual void setDisplayDataBlue (DisplayData *)
 
virtual void setDisplayDataGreen (DisplayData *)
 
- Public Member Functions inherited from casa::DisplayOptions
 DisplayOptions ()
 Constructor. More...
 
virtual ~DisplayOptions ()
 Destructor. More...
 
template<class T >
casacore::Bool readOptionRecord (casacore::Vector< T > &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 Find the field fieldname in casacore::Record rec, containing the requested type (casacore::Bool, casacore::String, casacore::Float, casacore::Int) in itself or its "value" sub-field, and return the value in target. More...
 
template<class T >
casacore::Bool readOptionRecord (T &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 
virtual casacore::Bool readOptionRecord (casacore::String &target, casacore::Bool &unsetTarget, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 Find the field fieldname in casacore::Record rec, containing the requested type (casacore::String) in itself or its "value" sub-field, and return the value in target. More...
 
casacore::Record unset () const
 Return a casacore::Record which is an "unset" casacore::Record, ie. More...
 
casacore::Bool isUnset (const casacore::Record &rec) const
 Return true or false indicating if the provided casacore::Record is equal to an "unset" Record. More...
 
- Public Member Functions inherited from casa::DisplayEH
virtual ~DisplayEH ()
 
- Public Member Functions inherited from casa::DlTarget
 DlTarget ()
 
 DlTarget (const DlTarget &)
 
virtual ~DlTarget ()
 
void reg (DlHandleBase *p)
 
void unreg (DlHandleBase *p)
 

Private Member Functions

void setupStars ()
 
void cleanupStars ()
 
void drawImage (WorldCanvas &wCanvas)
 
void setScale ()
 
casacore::Bool iDidSizeControl (WorldCanvas &wCanvas)
 Check if this NBody did the sizeControl. More...
 
void drawMovie (WorldCanvas &wCanvas, casacore::Int numSteps, casacore::Double timeStep, casacore::Double dampingFactor)
 

Private Attributes

casacore::Bool turnedOff
 
General restrictions  (already declared in DisplayData.h)

AttributeBuffer restrictions; true if nothing should be drawn by the NBody More...

 
casacore::Double dataMin
 The min and max to use for drawing. More...
 
casacore::Double dataMax
 
casacore::Double itsTimeStep
 
casacore::Double itsDampingFactor
 
casacore::Int itsNumSteps
 
casacore::Int itsXSize
 
casacore::Int itsYSize
 
AttributeBuffer sizeControlBuf
 internal bookkeeping: buffer for stroing sizecontrol done by this NBody More...
 
casacore::Record miscInfoDummy
 
std::list< void * > itsGalaxyList
 

Additional Inherited Members

- Public Types inherited from casa::DisplayData
enum  DisplayState {
  DISPLAYED,
  UNDISPLAYED,
  LIMBO
}
 
- Static Public Attributes inherited from casa::DisplayData
static const casacore::String DATA_MIN
 
static const casacore::String DATA_MAX
 
- Protected Member Functions inherited from casa::DisplayData
virtual casacore::Bool setActiveZIndex_ (casacore::Int zindex)
 DDs may override to adjust the internal stored current animation index (activeZIndex_) if necessary, and to set return value false iff the passed zindex won't work for the DD. More...
 
casacore::Bool conformed ()
 Returns result of last call to conformsTo(WCH&). More...
 
casacore::Bool isCsAndZIndexConformed ()
 Added so that when two images are loaded with no velocity alignment, they can still show their position coordinates without having to be rstrsConformed. More...
 
virtual void delTmpData (casacore::String &tmpData)
 Delete temporary data. More...
 
virtual const std::list
< WCPositionEH * > * 
positionEventHandlerList ()
 Retrieve position, motion, refresh and display event handler lists. More...
 
virtual const std::list
< WCMotionEH * > * 
motionEventHandlerList ()
 
virtual const std::list
< WCRefreshEH * > * 
refreshEventHandlerList ()
 
virtual const std::list
< DisplayEH * > * 
displayEventHandlerList ()
 
 DisplayData (const DisplayData &other)
 (Required) copy constructor. More...
 
void operator= (const DisplayData &other)
 (Required) copy assignment. More...
 
- Protected Member Functions inherited from casa::DisplayOptions
 DisplayOptions (const DisplayOptions &other)
 (Required) copy constructor. More...
 
void operator= (const DisplayOptions &other)
 (Required) copy assignment. More...
 
- Protected Attributes inherited from casa::DisplayData
AttributeBuffer restrictions
 The Book says that we should not put data members in class that is supposed to only define an interface, but by putting these here, we can implement some of the restriction & eventhandling stuff so that people do not have to repeat it. More...
 
AttributeBuffer attributes
 buffer for storing Attributes More...
 
casacore::PtrBlock< void * > DDelement
 list of DisplayDataElements, which are of type DisplayMethod or derived More...
 
casacore::Int activeZIndex_
 Indicates the 'current' animation frame, i.e. More...
 
casacore::Bool delTmpData_
 Flag indicating that temporary data should be removed when deleting the object. More...
 
casacore::Bool rstrsConformed_
 Somewhat limited-use state, saved here for 'efficiency'. More...
 
casacore::Bool csConformed_
 
casacore::Bool zIndexConformed_
 

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 70 of file NBody.h.

Constructor & Destructor Documentation

casa::NBody::NBody ( )

Constructor.

virtual casa::NBody::~NBody ( )
virtual

Destructor.

Member Function Documentation

virtual void casa::NBody::addElementRestriction ( const casacore::uInt  itemNum,
Attribute newRestriction,
casacore::Bool  permanent 
)
virtual

Reimplemented from casa::DisplayData.

virtual void casa::NBody::addElementRestrictions ( const casacore::uInt  itemNum,
AttributeBuffer other 
)
virtual

Add a restriction for item itemNum of this DisplayData.

Reimplemented from casa::DisplayData.

virtual Display::DisplayDataType casa::NBody::classType ( )
inlinevirtual

Return the DisplayData type; used by the WorldCanvasHolder to determine the order of drawing.

Implements casa::DisplayData.

Definition at line 170 of file NBody.h.

References casa::Display::Vector.

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 casacore::uInt  itemNum)
virtual

Clear all restrictions of item itemNum (except the ones that are permanent of course).

Reimplemented from casa::DisplayData.

virtual const casacore::Unit casa::NBody::dataUnit ( )
virtual
void casa::NBody::drawImage ( WorldCanvas wCanvas)
private
void casa::NBody::drawMovie ( WorldCanvas wCanvas,
casacore::Int  numSteps,
casacore::Double  timeStep,
casacore::Double  dampingFactor 
)
private
virtual AttributeBuffer* casa::NBody::elementRestrictionBuffer ( const casacore::uInt  itemNum)
virtual

Get a handle to the buffer of restrictions for item itemNum.

Throws an exception of type casacore::AipsError if itemNum is out of range.

Reimplemented from casa::DisplayData.

virtual casacore::Bool casa::NBody::existElementRestriction ( const casacore::uInt  itemNum,
const casacore::String name 
)
virtual

Check if a restriction for item itemNum with name name exists.

Reimplemented from casa::DisplayData.

virtual casacore::Double casa::NBody::getDataMax ( )
virtual
virtual casacore::Double casa::NBody::getDataMin ( )
virtual

Report the minimum and maximum data values for this DisplayData.

casacore::Bool casa::NBody::iDidSizeControl ( WorldCanvas wCanvas)
private

Check if this NBody did the sizeControl.

virtual casacore::Bool casa::NBody::linToWorld ( casacore::Vector< casacore::Double > &  world,
const casacore::Vector< casacore::Double > &  lin 
)
virtual

casacore::Coordinate transformations, called by the WorldCanvasHolder.

Implements casa::DisplayData.

virtual const casacore::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 casacore::uInt casa::NBody::nelements ( const WorldCanvasHolder wcHolder) const
virtual

Return the number of elements in this DisplayData.

Implements casa::DisplayData.

virtual casacore::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 casacore::uInt  itemNum,
const casacore::String name 
)
virtual

Remove a restriction from item itemNum.

Reimplemented from casa::DisplayData.

virtual void casa::NBody::setActiveImage ( casacore::uInt  )
inlinevirtual

irrelevant in this part of the tree

Definition at line 87 of file NBody.h.

virtual void casa::NBody::setElementRestriction ( const casacore::uInt  itemNum,
Attribute newRestriction 
)
virtual

Reimplemented from casa::DisplayData.

virtual void casa::NBody::setElementRestrictions ( const casacore::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 casacore::String casa::NBody::showPosition ( const casacore::Vector< casacore::Double > &  ,
const casacore::Bool  
)
inlinevirtual

required functions with null implementations

Implements casa::DisplayData.

Definition at line 164 of file NBody.h.

virtual casacore::String casa::NBody::showValue ( const casacore::Vector< casacore::Double > &  world)
inlinevirtual

casacore::Format a string containing value information at the given world coordinate

Implements casa::DisplayData.

Definition at line 167 of file NBody.h.

virtual casacore::Bool casa::NBody::sizeControl ( WorldCanvasHolder wcHolder,
AttributeBuffer holderBuf 
)
virtual

sizeControlFunction, called by the WorldCanvasHolder.

Implements casa::DisplayData.

virtual casacore::Vector<casacore::String> casa::NBody::worldAxisNames ( ) const
virtual

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

Implements casa::DisplayData.

virtual casacore::Vector<casacore::String> casa::NBody::worldAxisUnits ( ) const
virtual

Implements casa::DisplayData.

virtual casacore::Bool casa::NBody::worldToLin ( casacore::Vector< casacore::Double > &  lin,
const casacore::Vector< casacore::Double > &  world 
)
virtual

Implements casa::DisplayData.

Member Data Documentation

casacore::Double casa::NBody::dataMax
private

Definition at line 188 of file NBody.h.

casacore::Double casa::NBody::dataMin
private

The min and max to use for drawing.

Definition at line 187 of file NBody.h.

casacore::Double casa::NBody::itsDampingFactor
private

Definition at line 191 of file NBody.h.

std::list<void *> casa::NBody::itsGalaxyList
private

Definition at line 209 of file NBody.h.

casacore::Int casa::NBody::itsNumSteps
private

Definition at line 192 of file NBody.h.

casacore::Double casa::NBody::itsTimeStep
private

Definition at line 190 of file NBody.h.

casacore::Int casa::NBody::itsXSize
private

Definition at line 193 of file NBody.h.

casacore::Int casa::NBody::itsYSize
private

Definition at line 194 of file NBody.h.

casacore::Record casa::NBody::miscInfoDummy
private

Definition at line 207 of file NBody.h.

AttributeBuffer casa::NBody::sizeControlBuf
private

internal bookkeeping: buffer for stroing sizecontrol done by this NBody

Definition at line 198 of file NBody.h.

casacore::Bool casa::NBody::turnedOff
private

General restrictions  (already declared in DisplayData.h)

AttributeBuffer restrictions; true if nothing should be drawn by the NBody

Definition at line 184 of file NBody.h.


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