19 |
|
* publication of scientific results based in part on use of the |
20 |
|
* program. An acceptable form of acknowledgement is citation of |
21 |
|
* the article in which the program was described (Matthew |
22 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
23 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
22 |
> |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
23 |
> |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
24 |
|
* Parallel Simulation Engine for Molecular Dynamics," |
25 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
25 |
> |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
26 |
|
* |
27 |
|
* 2. Redistributions of source code must retain the above copyright |
28 |
|
* notice, this list of conditions and the following disclaimer. |
95 |
|
// A modifier creating a triangle with the incremental builder. |
96 |
|
template <class HDS> |
97 |
|
class Build_nanorod : public CGAL::Modifier_base<HDS> { |
98 |
< |
public: |
98 |
> |
public: |
99 |
|
Vertex_handle end1; |
100 |
|
Vertex_handle neight1; |
101 |
< |
Vertex_handle end2; |
101 |
> |
Vertex_handle end2; |
102 |
|
Vertex_handle neight2; |
103 |
|
|
104 |
|
Build_nanorod() {} |
243 |
|
|
244 |
|
bool GeometryBuilder::isInsidePolyhedron(double x, double y, double z) { |
245 |
|
|
246 |
< |
Point_3 point(x,y,z); |
246 |
> |
Point_3 point(x,y,z); |
247 |
|
Plane_iterator i; |
248 |
|
Facet_iterator j; |
249 |
|
for ( i =nanoRodPolyhedron.planes_begin(), j = nanoRodPolyhedron.facets_begin(); i != nanoRodPolyhedron.planes_end() && j !=nanoRodPolyhedron.facets_end(); ++i, ++j) { |
263 |
|
|
264 |
|
|
265 |
|
GeometryBuilder::GeometryBuilder(double length,double width) { |
266 |
< |
// Create the geometry for nanorod |
266 |
> |
// Create the geometry for nanorod |
267 |
|
Build_nanorod<HalfedgeDS> nanorod; |
268 |
|
|
269 |
|
nanoRodPolyhedron.delegate( nanorod); |
270 |
|
|
271 |
< |
double y1 = nanorod.end1->point().y() - nanorod.neight1->point().y(); |
272 |
< |
double y2 = nanorod.end2->point().y() - nanorod.neight2->point().y(); |
273 |
< |
|
274 |
< |
CGAL::Aff_transformation_3<Kernel> aff_tranformation( width, |
275 |
< |
0.0, |
276 |
< |
0.0, |
277 |
< |
0.0, |
278 |
< |
0.0, |
279 |
< |
length, |
280 |
< |
0.0, |
281 |
< |
0.0, |
282 |
< |
0.0, |
283 |
< |
0.0, |
284 |
< |
width, |
285 |
< |
0.0); |
286 |
< |
std::transform( nanoRodPolyhedron.points_begin(), nanoRodPolyhedron.points_end(), nanoRodPolyhedron.points_begin(), aff_tranformation); |
271 |
> |
double y1 = nanorod.end1->point().y() - nanorod.neight1->point().y(); |
272 |
> |
double y2 = nanorod.end2->point().y() - nanorod.neight2->point().y(); |
273 |
|
|
274 |
< |
Point_3 point1(nanorod.end1->point().x(), y1 + nanorod.neight1->point().y(), nanorod.end1->point().z()); |
275 |
< |
Point_3 point2(nanorod.end2->point().x(), y2+ nanorod.neight2->point().y(), nanorod.end2->point().z()); |
276 |
< |
nanorod.end1->point() = point1; |
277 |
< |
nanorod.end2->point() = point2; |
274 |
> |
CGAL::Aff_transformation_3<Kernel> aff_tranformation( width, |
275 |
> |
0.0, |
276 |
> |
0.0, |
277 |
> |
0.0, |
278 |
> |
0.0, |
279 |
> |
length, |
280 |
> |
0.0, |
281 |
> |
0.0, |
282 |
> |
0.0, |
283 |
> |
0.0, |
284 |
> |
width, |
285 |
> |
0.0); |
286 |
> |
std::transform( nanoRodPolyhedron.points_begin(), nanoRodPolyhedron.points_end(), nanoRodPolyhedron.points_begin(), aff_tranformation); |
287 |
|
|
288 |
< |
// Construct normal vector for each face. |
289 |
< |
std::transform( nanoRodPolyhedron.facets_begin(), nanoRodPolyhedron.facets_end(), nanoRodPolyhedron.planes_begin(), |
290 |
< |
Normal_vector()); |
288 |
> |
Point_3 point1(nanorod.end1->point().x(), y1 + nanorod.neight1->point().y(), nanorod.end1->point().z()); |
289 |
> |
Point_3 point2(nanorod.end2->point().x(), y2+ nanorod.neight2->point().y(), nanorod.end2->point().z()); |
290 |
> |
nanorod.end1->point() = point1; |
291 |
> |
nanorod.end2->point() = point2; |
292 |
> |
|
293 |
> |
// Construct normal vector for each face. |
294 |
> |
std::transform( nanoRodPolyhedron.facets_begin(), nanoRodPolyhedron.facets_end(), nanoRodPolyhedron.planes_begin(), |
295 |
> |
Normal_vector()); |
296 |
|
|
297 |
|
|
298 |
|
|