}
IfcVector3 vmin, vmax;
- ArrayBounds(resultpoly.data(), resultpoly.size(), vmin, vmax);
+ ArrayBounds(resultpoly.data(), static_cast<unsigned int>(resultpoly.size()), vmin, vmax);
// filter our IfcFloat points - those may happen if a point lies
// directly on the intersection line or directly on the clipping plane
if( resultpoly.size() > 2 )
{
result.verts.insert(result.verts.end(), resultpoly.begin(), resultpoly.end());
- result.vertcnt.push_back(resultpoly.size());
+ result.vertcnt.push_back(static_cast<unsigned int>(resultpoly.size()));
}
}
// to result mesh unchanged
if( !startedInside )
{
- outvertcnt.push_back(blackside.size());
+ outvertcnt.push_back(static_cast<unsigned int>(blackside.size()));
outvert.insert(outvert.end(), blackside.begin(), blackside.end());
continue;
}
++cnt;
}
- meshout.vertcnt.push_back(cnt);
+ meshout.vertcnt.push_back(static_cast<unsigned int>(cnt));
// zero- or one- vertex polyloops simply ignored
if (meshout.vertcnt.back() > 1) {
// fill a mesh with ONLY the main polygon
TempMesh temp;
temp.verts.reserve(outer_polygon_size);
- temp.vertcnt.push_back(outer_polygon_size);
+ temp.vertcnt.push_back(static_cast<unsigned int>(outer_polygon_size));
std::copy(outer_vit, outer_vit+outer_polygon_size,
std::back_inserter(temp.verts));
for(size_t i = 0; i < size; ++i ) {
out.push_back(out[i*4]);
}
- result.vertcnt.push_back(size);
- result.vertcnt.push_back(size);
+ result.vertcnt.push_back(static_cast<unsigned int>(size));
+ result.vertcnt.push_back(static_cast<unsigned int>(size));
}
IfcMatrix4 trafo;
out.push_back(in[i]);
}
- curmesh.vertcnt.push_back(in.size());
+ curmesh.vertcnt.push_back(static_cast<unsigned int>(in.size()));
if( openings && in.size() > 2 ) {
if( GenerateOpenings(*conv.apply_openings, nors, temp, true, true, dir) ) {
++sides_with_v_openings;
std::shared_ptr<TempMesh> profile2D = std::shared_ptr<TempMesh>(new TempMesh());
profile2D->verts.insert(profile2D->verts.end(), in.begin(), in.end());
- profile2D->vertcnt.push_back(in.size());
+ profile2D->vertcnt.push_back(static_cast<unsigned int>(in.size()));
conv.collect_openings->push_back(TempOpening(&solid, dir, profile, profile2D));
ai_assert(result.IsEmpty());
aiMesh* const mesh = meshtmp->ToMesh();
if(mesh) {
mesh->mMaterialIndex = matid;
- mesh_indices.push_back(conv.meshes.size());
+ mesh_indices.push_back(static_cast<unsigned int>(conv.meshes.size()));
conv.meshes.push_back(mesh);
return true;
}
std::sort(mesh_indices.begin(),mesh_indices.end());
std::vector<unsigned int>::iterator it_end = std::unique(mesh_indices.begin(),mesh_indices.end());
- const size_t size = std::distance(mesh_indices.begin(),it_end);
+ nd->mNumMeshes = static_cast<unsigned int>(std::distance(mesh_indices.begin(),it_end));
- nd->mNumMeshes = size;
nd->mMeshes = new unsigned int[nd->mNumMeshes];
for(unsigned int i = 0; i < nd->mNumMeshes; ++i) {
nd->mMeshes[i] = mesh_indices[i];
if (!properties.empty()) {
aiMetadata* data = new aiMetadata();
- data->mNumProperties = properties.size();
+ data->mNumProperties = static_cast<unsigned int>(properties.size());
data->mKeys = new aiString[data->mNumProperties]();
data->mValues = new aiMetadataEntry[data->mNumProperties]();
FillMaterial(mat.get(), surf, conv);
conv.materials.push_back(mat.release());
- unsigned int matindex = conv.materials.size() - 1;
+ unsigned int matindex = static_cast<unsigned int>(conv.materials.size() - 1);
conv.cached_materials[surf] = matindex;
return matindex;
}
}
if (const size_t d = curmesh.verts.size()-old) {
- curmesh.vertcnt.push_back(d);
+ curmesh.vertcnt.push_back(static_cast<unsigned int>(d));
std::reverse(curmesh.verts.rbegin(),curmesh.verts.rbegin()+d);
}
if (n == very_first_hit) {
clipper.Execute(ClipperLib::ctIntersection,clipped,ClipperLib::pftNonZero,ClipperLib::pftNonZero);
for(const ClipperLib::ExPolygon& ex : clipped) {
- iold.push_back(ex.outer.size());
+ iold.push_back(static_cast<unsigned int>(ex.outer.size()));
for(const ClipperLib::IntPoint& point : ex.outer) {
vold.push_back(IfcVector3(
from_int64(point.X),
ConvertCartesianPoint(t,cp);
meshout.verts.push_back(t);
}
- meshout.vertcnt.push_back(meshout.verts.size());
+ meshout.vertcnt.push_back(static_cast<unsigned int>(meshout.verts.size()));
}
// ------------------------------------------------------------------------------------------------
IFCImporter::LogError(cv.s+ " (error occurred while processing curve)");
return false;
}
- meshout.vertcnt.push_back(meshout.verts.size());
+ meshout.vertcnt.push_back(static_cast<unsigned int>(meshout.verts.size()));
return true;
}
}
IfcVector3 nor;
- NewellNormal<3, 3, 3>(nor, cnt, &temp[0], &temp[1], &temp[2]);
+ NewellNormal<3, 3, 3>(nor, static_cast<int>(cnt), &temp[0], &temp[1], &temp[2]);
return normalize ? nor.Normalize() : nor;
}
{
out = IfcVector3();
for(size_t i = 0; i < in.Coordinates.size(); ++i) {
- out[i] = in.Coordinates[i];
+ out[static_cast<unsigned int>(i)] = in.Coordinates[i];
}
}
{
out = IfcVector3();
for(size_t i = 0; i < in.DirectionRatios.size(); ++i) {
- out[i] = in.DirectionRatios[i];
+ out[static_cast<unsigned int>(i)] = in.DirectionRatios[i];
}
const IfcFloat len = out.Length();
if (len<1e-6) {