casa
$Rev:20696$
|
Simple class to represent a Galaxy as a collection of Stars. More...
#include <Galaxy.h>
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< Double > | itsPosition |
The position of the Galaxy. | |
Vector< Double > | itsVelocity |
The velocity of the Galaxy. | |
Vector< Double > | newPosition |
The new computed position of the Galaxy. | |
Vector< Double > | newVelocity |
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< Int > | oldPosition |
Vector< Int > | itsOffset |
Last offset applied to itsPosition. | |
Vector< Int > | itsPlotPosition |
Last offset applied to itsPosition. | |
Int | itsXSize |
Int | itsYSize |
uInt | itsDrawList |
Number of the draw list for the current PixelCanvas. | |
PixelCanvas * | itsPixelCanvas |
Galaxy::PLOT_MODE | plotMode |
Bool | changedPlotMode |
Simple class to represent a Galaxy as a collection of Stars.
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.
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.
Double casa::Galaxy::force | ( | Double | distance | ) |
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.
void casa::Galaxy::setPlotMode | ( | Galaxy::PLOT_MODE | plotMode | ) |
Set the plot mode.
void casa::Galaxy::setScale | ( | Int | xSize, |
Int | ySize | ||
) |
void casa::Galaxy::update | ( | ) |
update position and velocity to new value
Bool casa::Galaxy::changedPlotMode [private] |
uInt casa::Galaxy::itsDrawList [private] |
Number of the draw list for the current PixelCanvas.
Double casa::Galaxy::itsMass [private] |
Vector<Int> casa::Galaxy::itsOffset [private] |
PixelCanvas* casa::Galaxy::itsPixelCanvas [private] |
Vector<Int> casa::Galaxy::itsPlotPosition [private] |
Vector<Double> casa::Galaxy::itsPosition [private] |
Double casa::Galaxy::itsSize [private] |
List<void *> casa::Galaxy::itsStarList [private] |
ListIter<void *>* casa::Galaxy::itsStarListIter [private] |
Vector<Double> casa::Galaxy::itsVelocity [private] |
Int casa::Galaxy::itsXSize [private] |
Int casa::Galaxy::itsYSize [private] |
Vector<Double> casa::Galaxy::newPosition [private] |
Vector<Double> casa::Galaxy::newVelocity [private] |
Vector<Int> casa::Galaxy::oldPosition [private] |
Galaxy::PLOT_MODE casa::Galaxy::plotMode [private] |