Changes in src/Shapes/ShapeOps.cpp [bf3817:bcf653]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Shapes/ShapeOps.cpp
rbf3817 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 … … 32 39 } 33 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 34 50 Shape resize(const Shape &arg,double size){ 35 51 Shape::impl_ptr impl = Shape::impl_ptr(new Resize_impl(getShapeImpl(arg),size)); … … 47 63 bool Translate_impl::isInside(const Vector& point){ 48 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; 49 73 } 50 74 … … 75 99 } 76 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 77 109 Shape stretch(const Shape &arg, const Vector &factors){ 78 110 Shape::impl_ptr impl = Shape::impl_ptr(new Stretch_impl(getShapeImpl(arg),factors)); … … 94 126 } 95 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 96 136 Shape transform(const Shape &arg, const Matrix &transformation){ 97 137 Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation));
Note:
See TracChangeset
for help on using the changeset viewer.