Changeset 274 for cpp/frams/model


Ignore:
Timestamp:
12/18/14 12:49:55 (5 years ago)
Author:
Maciej Komosinski
Message:

Added Model::move() and Model::rotate()

Location:
cpp/frams/model
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/model.cpp

    r269 r274  
    12831283}
    12841284
     1285void Model::move(const Pt3D& shift)
     1286{
     1287FOREACH(Part*,p,parts)
     1288        p->p+=shift;
     1289}
     1290
     1291void Model::rotate(const Orient& rotation)
     1292{
     1293FOREACH(Part*,p,parts)
     1294        {
     1295        p->p=rotation.transform(p->p);
     1296        p->setOrient(rotation.transform(p->o));
     1297        }
     1298}
     1299
    12851300void Model::buildUsingNewShapes(const Model& old, Part::Shape default_shape, float thickness)
    12861301{
  • cpp/frams/model/model.h

    r273 r274  
    393393
    394394void disturb(double amount);
     395void move(const Pt3D& shift);
     396/// rotate around the origin (move-rotate-move to rotate around arbitrary point)
     397void rotate(const Orient& rotation);
     398/// rotate around the origin (move-rotate-move to rotate around arbitrary point)
     399void rotate(const Pt3D& angles) {Orient o=Orient_1; o.rotate(angles); rotate(o);}
    395400
    396401/// build this model using new shapes, based on the provided model that uses old shapes. See also shapeconvert.cpp.
Note: See TracChangeset for help on using the changeset viewer.