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

Simple class to represent a Galaxy as a collection of Stars. More...

#include <Galaxy.h>

List of all members.

Public Types

enum  PLOT_MODE {
  POSITION,
  VELOCITY
}

Public Member Functions

 Galaxy (Vector< Double > &position, Vector< Double > &velocity, Double mass, Double size, uInt numStars, uInt numRings, Double inclination, Double positionAngle, Int xSize, Int ySize)
 Constructor.
 ~Galaxy ()
 Destructor.
void computeStep (List< void * > &galaxyList, Double timeStep, Double dampingFactor=1.0)
 Compute a new position, applying the force of the Galaxies in the List but do not update current position and velocity.
void update ()
 update position and velocity to new value
void applyForceToStars (List< void * > &galaxyList, Double timeStep, Double dampingFactor)
 Compute a new position for the Stars in this Galaxy.
void rotate (Matrix< Double > &rotMatrix)
 Rotate position and velocity.
void draw (PixelCanvas *pixelCanvas)
 Draw the Galaxy on the PixelCanvas.
Double force (Double distance)
 magnitude of the force for this galaxy
Double getMass ()
 Return the Mass of the Galaxy.
Vector< Double > & getPosition ()
 Return the position of the Galaxy.
Vector< Double > & getVelocity ()
 Return the Velocity of the Galaxy.
void setPlotMode (Galaxy::PLOT_MODE plotMode)
 Set the plot mode.
void setScale (Int xSize, Int ySize)

Private Attributes

Double itsMass
 The mass of the Galaxy.
Double itsSize
 its size
Vector< DoubleitsPosition
 The position of the Galaxy.
Vector< DoubleitsVelocity
 The velocity of the Galaxy.
Vector< DoublenewPosition
 The new computed position of the Galaxy.
Vector< DoublenewVelocity
 The new computed velocity of the Galaxy.
List< void * > itsStarList
 The list of Stars in this Galaxy.
ListIter< void * > * itsStarListIter
 and an iterator for this List
Vector< IntoldPosition
Vector< IntitsOffset
 Last offset applied to itsPosition.
Vector< IntitsPlotPosition
 Last offset applied to itsPosition.
Int itsXSize
Int itsYSize
uInt itsDrawList
 Number of the draw list for the current PixelCanvas.
PixelCanvasitsPixelCanvas
Galaxy::PLOT_MODE plotMode
Bool changedPlotMode

Detailed Description

Simple class to represent a Galaxy as a collection of Stars.

Definition at line 44 of file Galaxy.h.


Member Enumeration Documentation

Enumerator:
POSITION 
VELOCITY 

Definition at line 48 of file Galaxy.h.


Constructor & Destructor Documentation

casa::Galaxy::Galaxy ( Vector< Double > &  position,
Vector< Double > &  velocity,
Double  mass,
Double  size,
uInt  numStars,
uInt  numRings,
Double  inclination,
Double  positionAngle,
Int  xSize,
Int  ySize 
)

Constructor.

Destructor.


Member Function Documentation

void casa::Galaxy::applyForceToStars ( List< void * > &  galaxyList,
Double  timeStep,
Double  dampingFactor 
)

Compute a new position for the Stars in this Galaxy.

void casa::Galaxy::computeStep ( List< void * > &  galaxyList,
Double  timeStep,
Double  dampingFactor = 1.0 
)

Compute a new position, applying the force of the Galaxies in the List but do not update current position and velocity.

void casa::Galaxy::draw ( PixelCanvas pixelCanvas)

Draw the Galaxy on the PixelCanvas.

magnitude of the force for this galaxy

Return the Mass of the Galaxy.

Return the position of the Galaxy.

Return the Velocity of the Galaxy.

void casa::Galaxy::rotate ( Matrix< Double > &  rotMatrix)

Rotate position and velocity.

Set the plot mode.

void casa::Galaxy::setScale ( Int  xSize,
Int  ySize 
)

update position and velocity to new value


Member Data Documentation

Definition at line 139 of file Galaxy.h.

Number of the draw list for the current PixelCanvas.

Definition at line 133 of file Galaxy.h.

The mass of the Galaxy.

Definition at line 99 of file Galaxy.h.

Last offset applied to itsPosition.

Definition at line 125 of file Galaxy.h.

Definition at line 135 of file Galaxy.h.

Last offset applied to itsPosition.

Definition at line 127 of file Galaxy.h.

The position of the Galaxy.

Definition at line 105 of file Galaxy.h.

its size

Definition at line 102 of file Galaxy.h.

List<void *> casa::Galaxy::itsStarList [private]

The list of Stars in this Galaxy.

Definition at line 118 of file Galaxy.h.

and an iterator for this List

Definition at line 121 of file Galaxy.h.

The velocity of the Galaxy.

Definition at line 108 of file Galaxy.h.

Definition at line 129 of file Galaxy.h.

Definition at line 130 of file Galaxy.h.

The new computed position of the Galaxy.

Definition at line 112 of file Galaxy.h.

The new computed velocity of the Galaxy.

Definition at line 115 of file Galaxy.h.

Definition at line 123 of file Galaxy.h.

Definition at line 137 of file Galaxy.h.


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