Changeset View
Changeset View
Standalone View
Standalone View
source/blender/alembic/intern/abc_customdata.cc
| Show All 20 Lines | |||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| * | * | ||||
| */ | */ | ||||
| #include "abc_customdata.h" | #include "abc_customdata.h" | ||||
| #include <Alembic/AbcGeom/All.h> | #include <Alembic/AbcGeom/All.h> | ||||
| #include <algorithm> | #include <algorithm> | ||||
| #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1900) | |||||
| #include <unordered_map> | #include <unordered_map> | ||||
| typedef std::unordered_map<uint64_t, int> uv_index_map; | |||||
| #else | |||||
| #include <map> | |||||
| typedef std::map<uint64_t, int> uv_index_map; | |||||
| #endif | |||||
sergey: I would keep `uv_index_map` as a typedef, otherwise it's ridiculous to type `std… | |||||
| extern "C" { | extern "C" { | ||||
| #include "DNA_customdata_types.h" | #include "DNA_customdata_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "BLI_math_base.h" | #include "BLI_math_base.h" | ||||
| #include "BKE_customdata.h" | #include "BKE_customdata.h" | ||||
| } | } | ||||
| Show All 9 Lines | |||||
| using Alembic::Abc::C4fArraySample; | using Alembic::Abc::C4fArraySample; | ||||
| using Alembic::Abc::UInt32ArraySample; | using Alembic::Abc::UInt32ArraySample; | ||||
| using Alembic::Abc::V2fArraySample; | using Alembic::Abc::V2fArraySample; | ||||
| using Alembic::AbcGeom::OV2fGeomParam; | using Alembic::AbcGeom::OV2fGeomParam; | ||||
| using Alembic::AbcGeom::OC4fGeomParam; | using Alembic::AbcGeom::OC4fGeomParam; | ||||
| typedef std::unordered_map<uint64_t, int> uv_index_map; | |||||
| static inline uint64_t uv_to_hash_key(Imath::V2f v) | static inline uint64_t uv_to_hash_key(Imath::V2f v) | ||||
| { | { | ||||
| /* Convert -0.0f to 0.0f, so bitwise comparison works. */ | /* Convert -0.0f to 0.0f, so bitwise comparison works. */ | ||||
| if (v.x == 0.0f) { | if (v.x == 0.0f) { | ||||
| v.x = 0.0f; | v.x = 0.0f; | ||||
| } | } | ||||
| if (v.y == 0.0f) { | if (v.y == 0.0f) { | ||||
| v.y = 0.0f; | v.y = 0.0f; | ||||
| ▲ Show 20 Lines • Show All 411 Lines • Show Last 20 Lines | |||||
I would keep uv_index_map as a typedef, otherwise it's ridiculous to type std::unordered_map<uint64_t, int>every time.