Changeset 657 for cpp/frams/model


Ignore:
Timestamp:
04/24/17 03:10:51 (8 years ago)
Author:
Maciej Komosinski
Message:

A comment on potential optimization in ModelGeometryInfo?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/geometry/modelgeometryinfo.h

    r286 r657  
    1010#include <frams/util/list.h>
    1111
     12
     13/**
     14Currently, the three functions area(), volume() and findSizesAndAxes() are independent and self-sufficient.
     15Each of them converts the input model to SolidsShapeTypeModel if necessary.
     16Were these functions to be called multiple times for the same model, this would be inefficient
     17(the potential conversion of the same model would take place multiple times).
     18
     19To improve efficiency, these functions should not have the Model argument.
     20Instead, another function should be introduced to set the model, the conversion to SolidsShapeTypeModel
     21should take place in this function once, and these three functions would then always use the converted model.
     22A similar optimization is already implemented in the ModelGeometry class that provides FramScript access to ModelGeometryInfo.
     23*/
    1224namespace ModelGeometryInfo
    1325{
    14         void findSizesAndAxesOfModel(const Model &model, const double density, Pt3D &sizes,
    15                 Orient &axes);
    16         bool boundingBox(const Model &model, Pt3D &lowerBoundary, Pt3D &upperBoundary);
     26        double area(const Model &model, const double density);
     27        double volume(const Model &model, const double density);
     28        void findSizesAndAxes(const Model &model, const double density, Pt3D &sizes, Orient &axes);
     29
     30        void boundingBox(const Model &model, Pt3D &lowerBoundary, Pt3D &upperBoundary);
    1731        void boundingBox(const Part *part, Pt3D &lowerBoundary, Pt3D &upperBoundary);
    18         double volume(const Model &model, const double density);
    19         double area(const Model &model, const double density);
    2032        double externalAreaOfPart(const Model &model, const int partIndex, const double density);
    2133        double externalAreaOfEllipsoid(const Model &model, const int partIndex, const double density);
Note: See TracChangeset for help on using the changeset viewer.