00001
00011 #ifndef SPATIALOBJECTPOPULATION_H_
00012 #define SPATIALOBJECTPOPULATION_H_
00013
00014 #include "SimObjectPopulation.h"
00015 #include "Point3D.h"
00016
00018
00021 class SpatialObjectPopulation : public SimObjectPopulation {
00022 public:
00023 typedef enum { X = 0, Y = 1, Z = 2 } CoordinateIndex;
00024
00025 SpatialObjectPopulation(SimNetwork &net, SimObjectFactory &objFactory, size_t n)
00026 : SimObjectPopulation(net, objFactory, n) {
00027 coordinates.resize(n);
00028 };
00029
00030 SpatialObjectPopulation(SimNetwork &net, SimObjectFactory &objFactory, size_t n, vector< Point3Dd > & spatialCoordinates)
00031 : SimObjectPopulation(net, objFactory, n), coordinates(spatialCoordinates) {}
00032 ;
00033
00034 void setLocation(int idx, Point3Dd p) {
00035 if ( coordinates.size() < (size_t)(idx + 1) )
00036 coordinates.resize(idx + 1);
00037 }
00038
00039 void setOrigin(Point3Dd c) {
00040 origin = c;
00041 };
00042
00043 Point3Dd &getOrigin() {
00044 return origin;
00045 };
00046
00047 Point3Dd & getLocation(int idx) {
00048 return coordinates[idx];
00049 };
00050
00051 protected:
00052 vector< Point3Dd > coordinates;
00053 Point3Dd origin;
00054 };
00055
00056 #endif