- Timestamp:
- 04/24/17 03:14:21 (8 years ago)
- Location:
- cpp/frams
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/geometry/info_test.cpp
r534 r658 30 30 Orient axes; 31 31 // Calculating approximate sizes and axes of model. These values are calculated together because 32 // they depend son each other. Sizes are distances between furthest points on model surface32 // they depend on each other. Sizes are distances between furthest points on model surface 33 33 // measured along corresponding axes. Fields sizes.x and axes.x describes the 'length' of 3D 34 34 // model. Fields sizes.y and axes.y desctibes 'width' of 2D model created by projecting original … … 37 37 // points created for each unit of length. It means, that for each square unit of surface area 38 38 // of parts of model, at least density^2 points will be created. 39 ModelGeometryInfo::findSizesAndAxes OfModel(model, density, sizes, axes);39 ModelGeometryInfo::findSizesAndAxes(model, density, sizes, axes); 40 40 41 41 42 42 // Creating output variables. 43 43 Pt3D lowerBoundary, upperBoundary; 44 // Calculati ong bounding box of model. Result is stored in variables lowerBoundary and44 // Calculating bounding box of model. Result is stored in variables lowerBoundary and 45 45 // upperBoundary. 46 46 ModelGeometryInfo::boundingBox(model, lowerBoundary, upperBoundary); -
cpp/frams/model/geometry/geometryutils.cpp
r375 r658 9 9 double GeometryUtils::pointPosition(const int pointIndex, const int numberOfPoints) 10 10 { 11 return pointIndex / (numberOfPoints-1.0); 11 if (numberOfPoints == 1) 12 return 0; 13 else 14 return pointIndex / (numberOfPoints-1.0); 12 15 } 13 16 -
cpp/frams/model/geometry/modelgeoclass.cpp
r548 r658 102 102 onDensityChanged(); 103 103 if (cached_sizes.x < 0) //calculate if invalid 104 ModelGeometryInfo::findSizesAndAxes OfModel(*model, density, cached_sizes, cached_axes);104 ModelGeometryInfo::findSizesAndAxes(*model, density, cached_sizes, cached_axes); 105 105 106 106 VectorObject* n = new VectorObject; -
cpp/frams/model/geometry/modelgeometryinfo.cpp
r546 r658 7 7 #include <frams/model/geometry/meshbuilder.h> 8 8 9 void ModelGeometryInfo::findSizesAndAxes OfModel(const Model &input_model, const double density,9 void ModelGeometryInfo::findSizesAndAxes(const Model &input_model, const double density, 10 10 Pt3D &sizes, Orient &axes) 11 11 { … … 25 25 } 26 26 27 boolModelGeometryInfo::boundingBox(const Model &model, Pt3D &lowerBoundary, Pt3D &upperBoundary)27 void ModelGeometryInfo::boundingBox(const Model &model, Pt3D &lowerBoundary, Pt3D &upperBoundary) 28 28 { 29 if (model.getPartCount() == 0) 29 if (model.getPartCount() == 0) //should never happen. Invalid model provided? 30 30 { 31 return false; 31 lowerBoundary = Pt3D_0; 32 upperBoundary = Pt3D_0; 33 return; 32 34 } 33 35 … … 42 44 upperBoundary.getMax(partUpperBoundary); 43 45 } 44 45 return true;46 46 } 47 47
Note: See TracChangeset
for help on using the changeset viewer.