Changes in src/Shapes/ShapeOps.cpp [5e588b5:bcf653]
- File:
-
- 1 edited
-
src/Shapes/ShapeOps.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Shapes/ShapeOps.cpp
r5e588b5 rbcf653 1 /* 2 * Project: MoleCuilder 3 * Description: creates and alters molecular systems 4 * Copyright (C) 2010 University of Bonn. All rights reserved. 5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. 6 */ 7 1 8 /* 2 9 * ShapeOps.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #include "Shapes/ShapeOps.hpp" … … 25 39 } 26 40 41 std::vector<Vector> Resize_impl::getHomogeneousPointsOnSurface(const int N) const { 42 std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N); 43 for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) { 44 *iter *= size; 45 } 46 return PointsOnSurface; 47 } 48 49 27 50 Shape resize(const Shape &arg,double size){ 28 51 Shape::impl_ptr impl = Shape::impl_ptr(new Resize_impl(getShapeImpl(arg),size)); … … 40 63 bool Translate_impl::isInside(const Vector& point){ 41 64 return arg->isInside(point-offset); 65 } 66 67 std::vector<Vector> Translate_impl::getHomogeneousPointsOnSurface(const int N) const { 68 std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N); 69 for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) { 70 *iter += offset; 71 } 72 return PointsOnSurface; 42 73 } 43 74 … … 68 99 } 69 100 101 std::vector<Vector> Stretch_impl::getHomogeneousPointsOnSurface(const int N) const { 102 std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N); 103 for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) { 104 (*iter).ScaleAll(reciFactors); 105 } 106 return PointsOnSurface; 107 } 108 70 109 Shape stretch(const Shape &arg, const Vector &factors){ 71 110 Shape::impl_ptr impl = Shape::impl_ptr(new Stretch_impl(getShapeImpl(arg),factors)); … … 87 126 } 88 127 128 std::vector<Vector> Transform_impl::getHomogeneousPointsOnSurface(const int N) const { 129 std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N); 130 for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) { 131 *iter = transformation * (*iter); 132 } 133 return PointsOnSurface; 134 } 135 89 136 Shape transform(const Shape &arg, const Matrix &transformation){ 90 137 Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation));
Note:
See TracChangeset
for help on using the changeset viewer.
