SpherePackingScenarioGenerator
|
00001 /* 00002 * AbstractSpherePacking.h 00003 * 00004 * Created on: 2011-4-4 00005 * Author: asu 00006 */ 00007 00008 #ifndef ABSTRACTSPHEREPACKING_H_ 00009 #define ABSTRACTSPHEREPACKING_H_ 00010 00011 #include <vector> 00012 #include <algorithms/geometries/SphereGeometry.h> 00013 00014 namespace algorithms { 00015 class AbstractSpherePacking; 00016 } 00017 00018 class algorithms::AbstractSpherePacking { 00019 public: 00020 AbstractSpherePacking(); 00021 AbstractSpherePacking( 00022 unsigned int numberOfSpheres, 00023 double radius 00024 ); 00025 virtual ~AbstractSpherePacking(); 00026 virtual void generate()=0; 00027 void getSpherePositionsAsDoubleArray(double* array, unsigned int size) const; 00028 void getSpherePositionsAsSTDVector(std::vector<double>& sphereAttributeVector) const; 00029 const std::vector<algorithms::geometries::SphereGeometry>& getSpheres(); 00030 void plotListOfSpheres() const; 00035 unsigned int getNumberOfSpheres() const; 00036 void setNumberOfSpheres(unsigned int number); 00037 unsigned int getMaxSphereScaling() const; 00038 void setMaxSphereScaling(double number); 00039 double getRadius() const; 00040 virtual bool isValid() const; 00041 void appendSpheres(std::vector<algorithms::geometries::SphereGeometry>& additionalSpheres) { 00042 _spheres.insert(_spheres.end(), additionalSpheres.begin(), additionalSpheres.end()); 00043 } 00044 00045 public: 00046 unsigned int _numberOfSpheres; 00047 double _radius; 00048 std::vector<algorithms::geometries::SphereGeometry> _spheres; 00049 }; 00050 00051 #endif /* ABSTRACTSPHEREPACKING_H_ */