Changeset 658 for cpp/frams/model


Ignore:
Timestamp:
04/24/17 03:14:21 (3 years ago)
Author:
Maciej Komosinski
Message:
  • One function name made shorter
  • Fixed some typos
  • Predictable behavior for empty (zero-Part) Models (that should never happen)
Location:
cpp/frams/model/geometry
Files:
3 edited

Legend:

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

    r375 r658  
    99double GeometryUtils::pointPosition(const int pointIndex, const int numberOfPoints)
    1010{
    11         return pointIndex / (numberOfPoints-1.0);
     11        if (numberOfPoints == 1)
     12                return 0;
     13        else
     14                return pointIndex / (numberOfPoints-1.0);
    1215}
    1316
  • cpp/frams/model/geometry/modelgeoclass.cpp

    r548 r658  
    102102        onDensityChanged();
    103103        if (cached_sizes.x < 0) //calculate if invalid
    104                 ModelGeometryInfo::findSizesAndAxesOfModel(*model, density, cached_sizes, cached_axes);
     104                ModelGeometryInfo::findSizesAndAxes(*model, density, cached_sizes, cached_axes);
    105105
    106106        VectorObject* n = new VectorObject;
  • cpp/frams/model/geometry/modelgeometryinfo.cpp

    r546 r658  
    77#include <frams/model/geometry/meshbuilder.h>
    88
    9 void ModelGeometryInfo::findSizesAndAxesOfModel(const Model &input_model, const double density,
     9void ModelGeometryInfo::findSizesAndAxes(const Model &input_model, const double density,
    1010        Pt3D &sizes, Orient &axes)
    1111{
     
    2525}
    2626
    27 bool ModelGeometryInfo::boundingBox(const Model &model, Pt3D &lowerBoundary, Pt3D &upperBoundary)
     27void ModelGeometryInfo::boundingBox(const Model &model, Pt3D &lowerBoundary, Pt3D &upperBoundary)
    2828{
    29         if (model.getPartCount() == 0)
     29        if (model.getPartCount() == 0) //should never happen. Invalid model provided?
    3030        {
    31                 return false;
     31                lowerBoundary = Pt3D_0;
     32                upperBoundary = Pt3D_0;
     33                return;
    3234        }
    3335       
     
    4244                upperBoundary.getMax(partUpperBoundary);
    4345        }
    44        
    45         return true;
    4646}
    4747
Note: See TracChangeset for help on using the changeset viewer.