Ignore:
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
    18/*
    29 * ShapeOps.cpp
     
    3239}
    3340
     41std::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
    3450Shape resize(const Shape &arg,double size){
    3551  Shape::impl_ptr impl = Shape::impl_ptr(new Resize_impl(getShapeImpl(arg),size));
     
    4763bool Translate_impl::isInside(const Vector& point){
    4864  return arg->isInside(point-offset);
     65}
     66
     67std::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;
    4973}
    5074
     
    7599}
    76100
     101std::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
    77109Shape stretch(const Shape &arg, const Vector &factors){
    78110  Shape::impl_ptr impl = Shape::impl_ptr(new Stretch_impl(getShapeImpl(arg),factors));
     
    94126}
    95127
     128std::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
    96136Shape transform(const Shape &arg, const Matrix &transformation){
    97137  Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation));
Note: See TracChangeset for help on using the changeset viewer.