VoronoiCell.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef VORONOICELL_HPP_
00031 #define VORONOICELL_HPP_
00032
00033 #include "UblasCustomFunctions.hpp"
00034 #include "Face.hpp"
00035 #include <cmath>
00036
00037
00041 class VoronoiCell
00042 {
00043 private:
00044
00048 std::vector< Face<3>* > mFaces;
00049
00060 std::vector<bool> mOrientations;
00061
00065 c_vector<double, 3> mCellCentre;
00066
00075 bool EqualFaces(Face<3>& face1, bool orientation1, Face<3>& face2, bool orientation2);
00076
00077 public:
00078
00087 bool operator==(VoronoiCell& rOtherCell);
00088
00092 c_vector<double, 3>& rGetVoronoiCellCentre();
00093
00097 unsigned GetNumFaces() const;
00098
00104 const Face<3>& rGetFace(unsigned index) const;
00105
00111 bool FaceIsOrientatedClockwise(unsigned index) const;
00112
00118 void AddFace(Face<3>* pFace);
00119
00125 void AddOrientation(bool isOrientedClockwise);
00126
00132 void SetCellCentre(c_vector<double, 3> cellCentre);
00133 };
00134
00135 #endif