1 // Voro++, a 3D cell-based Voronoi library
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : August 30th 2011
8 * \brief Header file for the 2D derived wall classes. */
10 #ifndef VOROPP_WALL_2D_HH
11 #define VOROPP_WALL_2D_HH
14 #include "container_2d.hh"
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
{
23 /** Constructs a spherical wall object.
24 * \param[in] w_id_ an ID number to associate with the wall for
26 * \param[in] (xc_,yc_) a position vector for the circle's
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
);}
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
{
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
);}
60 const double xc
,yc
,ac
;