Area &area = areas[areaId];
area.nodeIds.push_back(nodeId);
size_t nbNodes = area.nodeIds.size();
- area.k1 = ((nbNodes - 1) * area.k1 + nodes->getK1(nodeId)) / nbNodes;
- area.k2 = ((nbNodes - 1) * area.k2 + nodes->getK2(nodeId)) / nbNodes;
- area.kdiff0 = ((nbNodes - 1) * area.kdiff0 + nodes->getKdiff0(nodeId)) / nbNodes;
+ area.k1 = ((double)(nbNodes - 1) * area.k1 + nodes->getK1(nodeId)) / (double)nbNodes;
+ area.k2 = ((double)(nbNodes - 1) * area.k2 + nodes->getK2(nodeId)) / (double)nbNodes;
+ area.kdiff0 = ((double)(nbNodes - 1) * area.kdiff0 + nodes->getKdiff0(nodeId)) / (double)nbNodes;
}
void Areas::cleanInvalidNodeAreas()
area.normal[i] += normals[3 * nodeId + i];
}
for (size_t i = 0; i < 3; ++i)
- area.normal[i] /= nbNodes;
+ area.normal[i] /= (double)nbNodes;
}
void Areas::computeSphereProperties(mcIdType areaId)
center[i] += nodeCoords[i] - area.radius * normals[3 * nodeId + i];
}
for (size_t i = 0; i < 3; ++i)
- center[i] /= nbNodes;
+ center[i] /= (double)nbNodes;
}
area.center = center;
area.radius = fabs(area.radius);
}
// Axis point is the mean of the projected nodes
for (size_t i = 0; i < 3; ++i)
- area.axisPoint[i] /= nbNodes;
+ area.axisPoint[i] /= (double)nbNodes;
// Radius of the cylinder is the mean of the approximate radius of each node
- area.radius = fabs(area.radius / nbNodes);
+ area.radius = fabs(area.radius / (double)nbNodes);
// Compute the axis of the cylinder
area.axis = MathOps::computePCAFirstAxis(projectedNodes);
}
}
// Axis point is the mean of the projected nodes
for (size_t i = 0; i < 3; ++i)
- area.axisPoint[i] /= nbNodes;
+ area.axisPoint[i] /= (double)nbNodes;
// Compute the axis of the cone
area.axis = MathOps::computePCAFirstAxis(projectedNodes);
double normAxis = MathOps::computeNorm(area.axis);
}
}
for (size_t j = 0; j < 3; ++j)
- area.apex[j] /= q1_indices.size();
+ area.apex[j] /= (double)q1_indices.size();
}
void Areas::computeTorusProperties(mcIdType areaId)