Strip extra spaces from code.
[voro++.git] / branches / 2d / src / wall_2d.hh
blob0badae8f8d34c041b6ef21674ecf3a5fd5b2054e
1 // Voro++, a 3D cell-based Voronoi library
2 //
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : August 30th 2011
7 /** \file wall_2d.hh
8 * \brief Header file for the 2D derived wall classes. */
10 #ifndef VOROPP_WALL_2D_HH
11 #define VOROPP_WALL_2D_HH
13 #include "cell_2d.hh"
14 #include "container_2d.hh"
16 namespace voro {
18 /** \brief A class representing a circular wall object.
20 * This class represents a circular wall object. */
21 struct wall_circle_2d : public wall_2d {
22 public:
23 /** Constructs a spherical wall object.
24 * \param[in] w_id_ an ID number to associate with the wall for
25 * neighbor tracking.
26 * \param[in] (xc_,yc_) a position vector for the circle's
27 * center.
28 * \param[in] rc_ the radius of the circle. */
29 wall_circle_2d(double xc_,double yc_,double rc_,int w_id_=-99)
30 : w_id(w_id_), xc(xc_), yc(yc_), rc(rc_) {}
31 bool point_inside(double x,double y);
32 template<class v_cell_2d>
33 bool cut_cell_base(v_cell_2d &c,double x,double y);
34 bool cut_cell(voronoicell_2d &c,double x,double y) {return cut_cell_base(c,x,y);}
35 bool cut_cell(voronoicell_neighbor_2d &c,double x,double y) {return cut_cell_base(c,x,y);}
36 private:
37 const int w_id;
38 const double xc,yc,rc;
41 /** \brief A class representing a plane wall object.
43 * This class represents a single plane wall object. */
44 struct wall_plane_2d : public wall_2d {
45 public:
46 /** Constructs a plane wall object
47 * \param[in] (xc_,yc_) a normal vector to the plane.
48 * \param[in] ac_ a displacement along the normal vector.
49 * \param[in] w_id_ an ID number to associate with the wall for
50 * neighbor tracking. */
51 wall_plane_2d(double xc_,double yc_,double ac_,int w_id_=-99)
52 : w_id(w_id_), xc(xc_), yc(yc_), ac(ac_) {}
53 bool point_inside(double x,double y);
54 template<class v_cell_2d>
55 bool cut_cell_base(v_cell_2d &c,double x,double y);
56 bool cut_cell(voronoicell_2d &c,double x,double y) {return cut_cell_base(c,x,y);}
57 bool cut_cell(voronoicell_neighbor_2d &c,double x,double y) {return cut_cell_base(c,x,y);}
58 private:
59 const int w_id;
60 const double xc,yc,ac;
65 #endif