From aa5016a2acef2888501dca584beef67bb1860071 Mon Sep 17 00:00:00 2001 From: Lionel Untereiner Date: Wed, 23 Mar 2016 22:43:27 +0100 Subject: [PATCH] float/double to float32/float64 to be more consistant --- .../multithreading/bench_multithreading.cpp | 2 +- cgogn/core/container/chunk_array.cpp | 4 +- cgogn/core/container/chunk_array.h | 4 +- cgogn/core/container/chunk_array_container.h | 4 +- cgogn/core/container/chunk_array_factory.h | 8 +-- .../chunk_array/bench_chunk_array.cpp | 16 ++--- .../core/examples/chunk_array/chunk_array.cpp | 18 ++--- .../examples/chunk_array/chunk_array2.cpp | 10 +-- cgogn/core/examples/map/map.cpp | 26 +++---- cgogn/core/utils/definitions.h | 3 + cgogn/core/utils/endian.h | 12 ++-- cgogn/geometry/types/bounding_box.cpp | 4 +- cgogn/geometry/types/bounding_box.h | 4 +- cgogn/geometry/types/geometry_traits.h | 8 +-- cgogn/geometry/types/plane_3d.cpp | 4 +- cgogn/geometry/types/plane_3d.h | 4 +- cgogn/geometry/types/vec.cpp | 4 +- cgogn/geometry/types/vec.h | 4 +- cgogn/io/data_io.h | 16 ++--- cgogn/io/examples/cmap2_import.cpp | 4 +- cgogn/io/examples/cmap3_import.cpp | 4 +- cgogn/io/import_ply_data.h | 6 +- cgogn/io/io_utils.cpp | 4 +- cgogn/io/lm6_io.h | 2 +- cgogn/io/map_export.h | 24 +++---- .../examples/map3_from_surface.cpp | 2 +- cgogn/io/mesh_generation/tetgen_io.h | 4 +- cgogn/io/obj_io.h | 2 +- cgogn/io/off_io.h | 14 ++-- cgogn/io/vtk_io.h | 4 +- cgogn/rendering/drawer.cpp | 6 +- cgogn/rendering/drawer.h | 34 ++++----- cgogn/rendering/examples/picking_viewer.cpp | 2 +- cgogn/rendering/examples/viewer_per_face.cpp | 14 ++-- cgogn/rendering/examples/viewer_topo.cpp | 2 +- cgogn/rendering/examples/viewer_topo3.cpp | 4 +- cgogn/rendering/shaders/shader_bold_line.cpp | 4 +- cgogn/rendering/shaders/shader_bold_line.h | 2 +- .../shaders/shader_explode_volumes.cpp | 2 +- .../shaders/shader_explode_volumes.h | 2 +- .../shaders/shader_explode_volumes_line.cpp | 2 +- .../shaders/shader_explode_volumes_line.h | 2 +- cgogn/rendering/shaders/shader_phong.cpp | 2 +- cgogn/rendering/shaders/shader_phong.h | 2 +- .../rendering/shaders/shader_point_sprite.cpp | 2 +- cgogn/rendering/shaders/shader_point_sprite.h | 2 +- .../rendering/shaders/shader_round_point.cpp | 4 +- cgogn/rendering/shaders/shader_round_point.h | 2 +- .../shaders/shader_vector_per_vertex.cpp | 2 +- .../shaders/shader_vector_per_vertex.h | 2 +- cgogn/rendering/shaders/vbo.h | 52 +++++++------- cgogn/rendering/topo_render.h | 44 ++++++------ cgogn/rendering/volume_render.h | 72 +++++++++---------- 53 files changed, 245 insertions(+), 242 deletions(-) diff --git a/benchmarks/multithreading/bench_multithreading.cpp b/benchmarks/multithreading/bench_multithreading.cpp index 515788f1..b7ece59b 100644 --- a/benchmarks/multithreading/bench_multithreading.cpp +++ b/benchmarks/multithreading/bench_multithreading.cpp @@ -47,7 +47,7 @@ const cgogn::Orbit FACE = Face::ORBIT; const uint32 ITERATIONS = 1u; //using Vec3 = Eigen::Vector3d; -using Vec3 = cgogn::geometry::Vec_T>; +using Vec3 = cgogn::geometry::Vec_T>; template using VertexAttributeHandler = Map2::VertexAttributeHandler; diff --git a/cgogn/core/container/chunk_array.cpp b/cgogn/core/container/chunk_array.cpp index 68b5a5db..13926ef2 100644 --- a/cgogn/core/container/chunk_array.cpp +++ b/cgogn/core/container/chunk_array.cpp @@ -33,7 +33,7 @@ namespace cgogn template class CGOGN_CORE_API ChunkArray; template class CGOGN_CORE_API ChunkArray; template class CGOGN_CORE_API ChunkArray; -template class CGOGN_CORE_API ChunkArray>; -template class CGOGN_CORE_API ChunkArray>; +template class CGOGN_CORE_API ChunkArray>; +template class CGOGN_CORE_API ChunkArray>; } // namespace cgogn diff --git a/cgogn/core/container/chunk_array.h b/cgogn/core/container/chunk_array.h index e4f3cc8d..98229109 100644 --- a/cgogn/core/container/chunk_array.h +++ b/cgogn/core/container/chunk_array.h @@ -712,8 +712,8 @@ class ChunkArray : public ChunkArrayGen extern template class CGOGN_CORE_API ChunkArray; extern template class CGOGN_CORE_API ChunkArray; extern template class CGOGN_CORE_API ChunkArray; -extern template class CGOGN_CORE_API ChunkArray>; -extern template class CGOGN_CORE_API ChunkArray>; +extern template class CGOGN_CORE_API ChunkArray>; +extern template class CGOGN_CORE_API ChunkArray>; #endif // defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(CORE_CONTAINER_CHUNK_ARRAY_CPP_)) } // namespace cgogn diff --git a/cgogn/core/container/chunk_array_container.h b/cgogn/core/container/chunk_array_container.h index 32724bbe..608dd308 100644 --- a/cgogn/core/container/chunk_array_container.h +++ b/cgogn/core/container/chunk_array_container.h @@ -511,9 +511,9 @@ class ChunkArrayContainer * @brief fragmentation of container (size/index of last lines): 100% = no holes * @return 1 is full filled - 0 is lots of holes */ - float fragmentation() const + float32 fragmentation() const { - return float(size()) / float(end()); + return float32(size()) / float32(end()); } /** diff --git a/cgogn/core/container/chunk_array_factory.h b/cgogn/core/container/chunk_array_factory.h index 2022dc14..0fd9baa4 100644 --- a/cgogn/core/container/chunk_array_factory.h +++ b/cgogn/core/container/chunk_array_factory.h @@ -92,11 +92,11 @@ class ChunkArrayFactory // register_CA(); // register_CA(); // register_CA(); - register_CA(); - register_CA(); + register_CA(); + register_CA(); register_CA(); - register_CA>(); - register_CA>(); + register_CA>(); + register_CA>(); // NOT TODO : add Eigen. known_types_initialized_ = true; diff --git a/cgogn/core/examples/chunk_array/bench_chunk_array.cpp b/cgogn/core/examples/chunk_array/bench_chunk_array.cpp index 2d89b213..23730719 100644 --- a/cgogn/core/examples/chunk_array/bench_chunk_array.cpp +++ b/cgogn/core/examples/chunk_array/bench_chunk_array.cpp @@ -16,14 +16,14 @@ int test5(); */ class Vec3f { - float data_[3]; + float32 data_[3]; public: Vec3f() {} - Vec3f(float x,float y, float z) + Vec3f(float32 x,float32 y, float32 z) { data_[0] = x; data_[1] = y; @@ -44,7 +44,7 @@ int test1() ChunkArrayContainer container; ChunkArray* att1 = container.add_attribute("entier"); - ChunkArray* att2 = container.add_attribute("reel"); + ChunkArray* att2 = container.add_attribute("reel"); ChunkArray* att3 = container.add_attribute("Vec3f"); for (uint32 i = 0; i < NB_LINES; ++i) @@ -53,8 +53,8 @@ int test1() for(uint32 i = container.begin(); i != container.end(); container.next(i)) { (*att1)[i] = 1+int32(i); - (*att2)[i] = 3.0f + 0.1f*float(i); - (*att3)[i] = Vec3f(float(i), float(i), float(i)); + (*att2)[i] = 3.0f + 0.1f*float32(i); + (*att3)[i] = Vec3f(float32(i), float32(i), float32(i)); } for (uint32 j = 0; j < 100; ++j) @@ -80,7 +80,7 @@ int test2() ChunkArrayContainer container; ChunkArray* att1 = container.add_attribute("entier"); - ChunkArray* att2 = container.add_attribute("reel"); + ChunkArray* att2 = container.add_attribute("reel"); ChunkArray* att3 = container.add_attribute("Vec3f"); for (uint32 i = 0; i < NB_LINES; ++i) @@ -89,8 +89,8 @@ int test2() for(uint32 i = container.begin(); i != container.end(); container.next(i)) { (*att1)[i] = 1+int32(i); - (*att2)[i] = 3.0f + 0.1f*float(i); - (*att3)[i] = Vec3f(float(i), float(i), float(i)); + (*att2)[i] = 3.0f + 0.1f*float32(i); + (*att3)[i] = Vec3f(float32(i), float32(i), float32(i)); } for (uint32 j = 0; j < 100; ++j) diff --git a/cgogn/core/examples/chunk_array/chunk_array.cpp b/cgogn/core/examples/chunk_array/chunk_array.cpp index 8ae8dac3..258852e9 100644 --- a/cgogn/core/examples/chunk_array/chunk_array.cpp +++ b/cgogn/core/examples/chunk_array/chunk_array.cpp @@ -23,7 +23,7 @@ int test1() ChunkArrayContainer container; ChunkArray* att1 = container.add_attribute("entier"); - ChunkArray* att2 = container.add_attribute("reel"); + ChunkArray* att2 = container.add_attribute("reel"); for (uint32 i = 0; i < 41; ++i) container.insert_lines<1>(); @@ -31,7 +31,7 @@ int test1() for(uint32 i = container.begin(); i != container.end(); container.next(i)) { (*att1)[i] = 1+int32(i); - (*att2)[i] = 3.0f + 0.1f*float(i); + (*att2)[i] = 3.0f + 0.1f*float32(i); } container.remove_lines<1>(3); @@ -212,11 +212,11 @@ int test3() int test4() { std::cout << "############### TEST 4 ###############" << std::endl; - using vecvecdouble = std::vector< std::vector< double > >; - using veclistdouble = std::vector< std::list< double > >; + using vecvecdouble = std::vector< std::vector< float64 > >; + using veclistdouble = std::vector< std::list< float64 > >; ChunkArrayContainer container; ChunkArray* att1 = container.add_attribute("entier"); - ChunkArray* att2 = container.add_attribute("reel"); + ChunkArray* att2 = container.add_attribute("reel"); ChunkArray* att3 = container.add_attribute("bools"); ChunkArray* att4 = container.add_attribute("vecvecdouble"); ChunkArray* att5 = container.add_attribute("veclistdouble"); @@ -227,10 +227,10 @@ int test4() for(uint32 i = container.begin(); i != container.end(); container.next(i)) { (*att1)[i] = 1+int32(i); - (*att2)[i] = 3.0f + 0.1f*float(i); + (*att2)[i] = 3.0f + 0.1f*float32(i); (*att3).set_value(i, static_cast(i%2 != 0)); - (*att4)[i] = {{3.0 + 0.1*double(i),15.0 + 0.1*double(i)}, {103.0 + 0.1*double(i), 203.0 + 0.1*double(i), 303.0 + 0.1*double(i)}}; - (*att5)[i] = {{3.0 + 0.1*double(i),15.0 + 0.1*double(i)}, {103.0 + 0.1*double(i), 203.0 + 0.1*double(i), 303.0 + 0.1*double(i)}}; + (*att4)[i] = {{3.0 + 0.1*float64(i),15.0 + 0.1*float64(i)}, {103.0 + 0.1*float64(i), 203.0 + 0.1*float64(i), 303.0 + 0.1*float64(i)}}; + (*att5)[i] = {{3.0 + 0.1*float64(i),15.0 + 0.1*float64(i)}, {103.0 + 0.1*float64(i), 203.0 + 0.1*float64(i), 303.0 + 0.1*float64(i)}}; } container.remove_lines<3>(3); @@ -246,7 +246,7 @@ int test4() ifi.close(); ChunkArray* load_att1 = cont2.get_attribute("entier"); - ChunkArray* load_att2 = cont2.get_attribute("reel"); + ChunkArray* load_att2 = cont2.get_attribute("reel"); ChunkArray* load_att3 = cont2.get_attribute("bools"); ChunkArray* load_att4 = cont2.get_attribute("vecvecdouble"); ChunkArray* load_att5 = cont2.get_attribute("veclistdouble"); diff --git a/cgogn/core/examples/chunk_array/chunk_array2.cpp b/cgogn/core/examples/chunk_array/chunk_array2.cpp index cfc2646e..d8ace780 100644 --- a/cgogn/core/examples/chunk_array/chunk_array2.cpp +++ b/cgogn/core/examples/chunk_array/chunk_array2.cpp @@ -13,7 +13,7 @@ using ChunkArray = cgogn::ChunkArray; using ChunkArrayContainer = cgogn::ChunkArrayContainer; using ChunkArrayFactory = cgogn::ChunkArrayFactory; -using DoubleVecList = std::list< std::vector< double > >; +using DoubleVecList = std::list< std::vector< float64 > >; using StringListVec = std::vector< std::list < std::string > >; using StringArray = std::array< std::string, 2>; @@ -27,7 +27,7 @@ int test_save() ChunkArrayContainer container; - ChunkArray* att1 = container.add_attribute("float"); + ChunkArray* att1 = container.add_attribute("float32"); ChunkArray* att4 = container.add_attribute("std::string"); ChunkArray* att2 = container.add_attribute("ListVecDouble"); ChunkArray* att3 = container.add_attribute("VecListString"); @@ -38,10 +38,10 @@ int test_save() for(uint32 i = container.begin(); i != container.end(); container.next(i)) { - (*att1)[i] = 0.1f*float(i); + (*att1)[i] = 0.1f*float32(i); (*att4)[i] = std::string(3,char('Z'-i)); - (*att2)[i] = {{3.0 + 0.1*double(i),15.0 + 0.1*double(i)}, {103.0 + 0.1*double(i), 203.0 + 0.1*double(i), 303.0 + 0.1*double(i)}}; + (*att2)[i] = {{3.0 + 0.1*float64(i),15.0 + 0.1*float64(i)}, {103.0 + 0.1*float64(i), 203.0 + 0.1*float64(i), 303.0 + 0.1*float64(i)}}; (*att3)[i] = {{"riri","riri"},{"fifi","fifi"},{"loulou","loulou"}}; @@ -127,7 +127,7 @@ int test_load(bool with_register) cont2.load(ifi); ifi.close(); - ChunkArray* att1 = cont2.get_attribute("float"); + ChunkArray* att1 = cont2.get_attribute("float32"); ChunkArray* att4 = cont2.get_attribute("std::string"); ChunkArray* att2 = cont2.get_attribute("ListVecDouble"); ChunkArray* att3 = cont2.get_attribute("VecListString"); diff --git a/cgogn/core/examples/map/map.cpp b/cgogn/core/examples/map/map.cpp index 05035398..98828350 100644 --- a/cgogn/core/examples/map/map.cpp +++ b/cgogn/core/examples/map/map.cpp @@ -15,39 +15,39 @@ using Map3 = CMap3; template -void fonc_const(const typename MAP::template VertexAttributeHandler& ah); +void fonc_const(const typename MAP::template VertexAttributeHandler& ah); template -void fonc_non_const(typename MAP::template VertexAttributeHandler& ah); +void fonc_non_const(typename MAP::template VertexAttributeHandler& ah); template int test1(MAP& map); template -void fonc_const(const typename MAP::template VertexAttributeHandler& ah) +void fonc_const(const typename MAP::template VertexAttributeHandler& ah) { - for (const float& f : ah) + for (const float32& f : ah) { std::cout << f << std::endl; } // equivalent to - for (typename MAP::template VertexAttributeHandler::const_iterator it = ah.begin(); it != ah.end(); ++it) + for (typename MAP::template VertexAttributeHandler::const_iterator it = ah.begin(); it != ah.end(); ++it) std::cout << *it << std::endl; } template -void fonc_non_const(typename MAP::template VertexAttributeHandler& ah) +void fonc_non_const(typename MAP::template VertexAttributeHandler& ah) { - for (float& f : ah) + for (float32& f : ah) { f *= 2.0f; std::cout << f << std::endl; } // equivalent to - for (typename MAP::template VertexAttributeHandler::iterator it = ah.begin(); it != ah.end(); ++it) + for (typename MAP::template VertexAttributeHandler::iterator it = ah.begin(); it != ah.end(); ++it) { *it /= 2.0f; } @@ -60,12 +60,12 @@ int test1(MAP& map) using Face = typename MAP::Face; // add an attribute on vertex of map with - typename MAP::template VertexAttributeHandler ah = map.template add_attribute("floats"); + typename MAP::template VertexAttributeHandler ah = map.template add_attribute("floats"); - typename MAP::template FaceAttributeHandler ahf = map.template add_attribute("floats"); + typename MAP::template FaceAttributeHandler ahf = map.template add_attribute("floats"); // get attribute and change type (dangerous!) - typename MAP::template VertexAttributeHandler ahf2 = map.template get_attribute_force_type("floats"); + typename MAP::template VertexAttributeHandler ahf2 = map.template get_attribute_force_type("floats"); map.remove_attribute(ahf); std::cout << "ahf valid : " << std::boolalpha << ahf.is_valid() << std::endl; @@ -114,7 +114,7 @@ int test1(MAP& map) // get ChunkArrayContainer -> get ChunkArray -> fill // typename MAP::template ChunkArrayContainer& container = map.get_attribute_container(MAP::Vertex); -// typename MAP::template ChunkArray* att = container.template get_attribute("floats"); +// typename MAP::template ChunkArray* att = container.template get_attribute("floats"); // for (uint32 i = 0; i < 10; ++i) // container.template insert_lines<1>(); for (auto& v : ah) @@ -127,7 +127,7 @@ int test1(MAP& map) fonc_const(ah); // // traverse container with for range - // for (float f:ah) + // for (float32 f:ah) // std::cout << f << std::endl; return 0; diff --git a/cgogn/core/utils/definitions.h b/cgogn/core/utils/definitions.h index 146d9347..32648bc8 100644 --- a/cgogn/core/utils/definitions.h +++ b/cgogn/core/utils/definitions.h @@ -43,6 +43,9 @@ using uint16 = std::uint16_t; using uint32 = std::uint32_t; using uint64 = std::uint64_t; +using float32 = float; +using float64 = double; + } using namespace numerics; diff --git a/cgogn/core/utils/endian.h b/cgogn/core/utils/endian.h index 7ab308ee..2b4c4a81 100644 --- a/cgogn/core/utils/endian.h +++ b/cgogn/core/utils/endian.h @@ -93,24 +93,24 @@ inline std::int64_t swap_endianness64(std::int64_t x) (step16 & 0xFF00FF00FF00FF00ULL) >> 8); } -inline float swap_endianness_float(float x) +inline float32 swap_endianness_float(float32 x) { union U32F32 { std::uint32_t as_u32; - float as_f32; + float32 as_f32; } u; u.as_f32 = x; u.as_u32 = swap_endianness32u(u.as_u32); return u.as_f32; } -inline double swap_endianness_double(double x) +inline float64 swap_endianness_double(float64 x) { union U64F64 { std::uint64_t as_u64; - double as_f64; + float64 as_f64; } u; u.as_f64 = x; u.as_u64 = swap_endianness64u(u.as_u64); @@ -185,7 +185,7 @@ inline std::int64_t swap_endianness_if(std::int64_t x) } template< bool COND> -inline float swap_endianness_if(float x) +inline float32 swap_endianness_if(float32 x) { if (COND) return swap_endianness_float(x); @@ -193,7 +193,7 @@ inline float swap_endianness_if(float x) } template< bool COND> -inline double swap_endianness_if(double x) +inline float64 swap_endianness_if(float64 x) { if (COND) return swap_endianness_double(x); diff --git a/cgogn/geometry/types/bounding_box.cpp b/cgogn/geometry/types/bounding_box.cpp index e7392540..c7e19fb5 100644 --- a/cgogn/geometry/types/bounding_box.cpp +++ b/cgogn/geometry/types/bounding_box.cpp @@ -34,8 +34,8 @@ namespace geometry template class CGOGN_GEOMETRY_API BoundingBox; template class CGOGN_GEOMETRY_API BoundingBox; -template class CGOGN_GEOMETRY_API BoundingBox>>; -template class CGOGN_GEOMETRY_API BoundingBox>>; +template class CGOGN_GEOMETRY_API BoundingBox>>; +template class CGOGN_GEOMETRY_API BoundingBox>>; } // namespace geometry diff --git a/cgogn/geometry/types/bounding_box.h b/cgogn/geometry/types/bounding_box.h index 3acd0d2e..a5805214 100644 --- a/cgogn/geometry/types/bounding_box.h +++ b/cgogn/geometry/types/bounding_box.h @@ -313,8 +313,8 @@ std::istream& operator>>(std::istream& in, BoundingBox& bb) #if defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(GEOMETRY_BOUNDING_BOX_CPP_)) //extern template class CGOGN_GEOMETRY_API BoundingBox; //extern template class CGOGN_GEOMETRY_API BoundingBox; -extern template class CGOGN_GEOMETRY_API BoundingBox>>; -extern template class CGOGN_GEOMETRY_API BoundingBox>>; +extern template class CGOGN_GEOMETRY_API BoundingBox>>; +extern template class CGOGN_GEOMETRY_API BoundingBox>>; #endif // defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(GEOMETRY_BOUNDING_BOX_CPP_)) } // namespace geometry diff --git a/cgogn/geometry/types/geometry_traits.h b/cgogn/geometry/types/geometry_traits.h index fd4dee3f..0e3762f5 100644 --- a/cgogn/geometry/types/geometry_traits.h +++ b/cgogn/geometry/types/geometry_traits.h @@ -59,18 +59,18 @@ struct vector_traits> // specialization 3 & 4: is for uniform manip of vec & scalar (vbo) // specialization 3 : float template<> -struct vector_traits +struct vector_traits { static const std::size_t SIZE = 1; - using Scalar = float; + using Scalar = float32; }; // specialization 4 : double template<> -struct vector_traits +struct vector_traits { static const std::size_t SIZE = 1; - using Scalar = double; + using Scalar = float64; }; template diff --git a/cgogn/geometry/types/plane_3d.cpp b/cgogn/geometry/types/plane_3d.cpp index 173fb062..b7aecd53 100644 --- a/cgogn/geometry/types/plane_3d.cpp +++ b/cgogn/geometry/types/plane_3d.cpp @@ -34,8 +34,8 @@ namespace geometry template class CGOGN_GEOMETRY_API Plane3D; template class CGOGN_GEOMETRY_API Plane3D; -template class CGOGN_GEOMETRY_API Plane3D>>; -template class CGOGN_GEOMETRY_API Plane3D>>; +template class CGOGN_GEOMETRY_API Plane3D>>; +template class CGOGN_GEOMETRY_API Plane3D>>; } // namespace geometry diff --git a/cgogn/geometry/types/plane_3d.h b/cgogn/geometry/types/plane_3d.h index 10e7c873..1682b184 100644 --- a/cgogn/geometry/types/plane_3d.h +++ b/cgogn/geometry/types/plane_3d.h @@ -141,8 +141,8 @@ class Plane3D #if defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(GEOMETRY_TYPES_PLANE_3D_CPP_)) extern template class CGOGN_GEOMETRY_API Plane3D; extern template class CGOGN_GEOMETRY_API Plane3D; -extern template class CGOGN_GEOMETRY_API Plane3D>>; -extern template class CGOGN_GEOMETRY_API Plane3D>>; +extern template class CGOGN_GEOMETRY_API Plane3D>>; +extern template class CGOGN_GEOMETRY_API Plane3D>>; #endif // defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(GEOMETRY_TYPES_PLANE_3D_CPP_)) } // namespace geometry diff --git a/cgogn/geometry/types/vec.cpp b/cgogn/geometry/types/vec.cpp index feabe26d..b0c36a13 100644 --- a/cgogn/geometry/types/vec.cpp +++ b/cgogn/geometry/types/vec.cpp @@ -32,8 +32,8 @@ namespace cgogn namespace geometry { -template class CGOGN_GEOMETRY_API Vec_T>; -template class CGOGN_GEOMETRY_API Vec_T>; +template class CGOGN_GEOMETRY_API Vec_T>; +template class CGOGN_GEOMETRY_API Vec_T>; } // namespace geometry diff --git a/cgogn/geometry/types/vec.h b/cgogn/geometry/types/vec.h index 1e474a32..1dee8481 100644 --- a/cgogn/geometry/types/vec.h +++ b/cgogn/geometry/types/vec.h @@ -266,8 +266,8 @@ class Vec_T }; #if defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(GEOMETRY_TYPES_VEC_CPP_)) -extern template class CGOGN_GEOMETRY_API Vec_T>; -extern template class CGOGN_GEOMETRY_API Vec_T>; +extern template class CGOGN_GEOMETRY_API Vec_T>; +extern template class CGOGN_GEOMETRY_API Vec_T>; #endif // defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(GEOMETRY_TYPES_VEC_CPP_)) } // namespace geometry diff --git a/cgogn/io/data_io.h b/cgogn/io/data_io.h index d5c45687..7971df67 100644 --- a/cgogn/io/data_io.h +++ b/cgogn/io/data_io.h @@ -273,8 +273,8 @@ std::unique_ptr> DataInputGen::newDataIO(co { const DataType type = get_data_type(type_name); switch (type) { - case DataType::FLOAT: return make_unique>(); - case DataType::DOUBLE: return make_unique>(); + case DataType::FLOAT: return make_unique>(); + case DataType::DOUBLE: return make_unique>(); case DataType::CHAR: return make_unique>(); case DataType::INT8: return make_unique>(); case DataType::UINT8: return make_unique>(); @@ -296,8 +296,8 @@ std::unique_ptr> DataInputGen::newDataIO(co { const DataType type = get_data_type(type_name); switch (type) { - case DataType::FLOAT: return make_unique>(); - case DataType::DOUBLE: return make_unique>(); + case DataType::FLOAT: return make_unique>(); + case DataType::DOUBLE: return make_unique>(); case DataType::CHAR: return make_unique>(); case DataType::INT8: return make_unique>(); case DataType::UINT8: return make_unique>(); @@ -331,7 +331,7 @@ std::unique_ptr> DataInputGen::newDataIO(co default:break; } } else { - if (type_name == name_of_type(float())) + if (type_name == name_of_type(float32())) { switch (nb_components) { @@ -341,7 +341,7 @@ std::unique_ptr> DataInputGen::newDataIO(co default:break; } } else { - if (type_name == name_of_type(double())) + if (type_name == name_of_type(float64())) { switch (nb_components) { @@ -376,7 +376,7 @@ std::unique_ptr> DataInputGen::newDataIO(co default:break; } } else { - if (type_name == name_of_type(float())) + if (type_name == name_of_type(float32())) { switch (nb_components) { @@ -386,7 +386,7 @@ std::unique_ptr> DataInputGen::newDataIO(co default:break; } } else { - if (type_name == name_of_type(double())) + if (type_name == name_of_type(float64())) { switch (nb_components) { diff --git a/cgogn/io/examples/cmap2_import.cpp b/cgogn/io/examples/cmap2_import.cpp index dcc3e817..af6e22ca 100644 --- a/cgogn/io/examples/cmap2_import.cpp +++ b/cgogn/io/examples/cmap2_import.cpp @@ -19,7 +19,7 @@ struct MyMapTraits : public cgogn::DefaultMapTraits using Map2 = cgogn::CMap2; using Vec3 = Eigen::Vector3d; -//using Vec3 = cgogn::geometry::Vec_T>; +//using Vec3 = cgogn::geometry::Vec_T>; template using VertexAttributeHandler = Map2::VertexAttributeHandler; @@ -133,7 +133,7 @@ int main(int argc, char** argv) } end = std::chrono::system_clock::now(); - std::chrono::duration elapsed_seconds = end - start; + std::chrono::duration elapsed_seconds = end - start; std::cout << "elapsed time: " << elapsed_seconds.count() << "s\n"; } diff --git a/cgogn/io/examples/cmap3_import.cpp b/cgogn/io/examples/cmap3_import.cpp index 4661f1a8..52da6758 100644 --- a/cgogn/io/examples/cmap3_import.cpp +++ b/cgogn/io/examples/cmap3_import.cpp @@ -13,7 +13,7 @@ using namespace cgogn::numerics; using Map3 = cgogn::CMap3; using Vec3 = Eigen::Vector3d; -//using Vec3 = cgogn::geometry::Vec_T>; +//using Vec3 = cgogn::geometry::Vec_T>; template using VertexAttributeHandler = Map3::VertexAttributeHandler; @@ -86,7 +86,7 @@ int main(int argc, char** argv) std::cout << "nb volumes -> " << nbw << std::endl; end = std::chrono::system_clock::now(); - std::chrono::duration elapsed_seconds = end - start; + std::chrono::duration elapsed_seconds = end - start; std::cout << "elapsed time: " << elapsed_seconds.count() << "s\n"; } diff --git a/cgogn/io/import_ply_data.h b/cgogn/io/import_ply_data.h index 3defe9bc..4454e73c 100644 --- a/cgogn/io/import_ply_data.h +++ b/cgogn/io/import_ply_data.h @@ -94,10 +94,10 @@ class CGOGN_IO_API PlyImportData /* vertex and face definitions for a polygonal object */ typedef struct VertexPly { - float x,y,z; - float r,g,b; + float32 x,y,z; + float32 r,g,b; unsigned char red,green,blue; - float nx,ny,nz; + float32 nx,ny,nz; void *other_props; /* other properties */ } VertexPly; diff --git a/cgogn/io/io_utils.cpp b/cgogn/io/io_utils.cpp index 6632d359..4775cff0 100644 --- a/cgogn/io/io_utils.cpp +++ b/cgogn/io/io_utils.cpp @@ -227,9 +227,9 @@ CGOGN_IO_API FileType get_file_type(const std::string& filename) CGOGN_IO_API DataType get_data_type(const std::string& type_name) { - if (type_name == name_of_type(float())) + if (type_name == name_of_type(float32())) return DataType::FLOAT; - else if (type_name == name_of_type(double())) + else if (type_name == name_of_type(float64())) return DataType::DOUBLE; else if (type_name == name_of_type(char())) return DataType::CHAR; diff --git a/cgogn/io/lm6_io.h b/cgogn/io/lm6_io.h index 464bf8ee..87830a70 100644 --- a/cgogn/io/lm6_io.h +++ b/cgogn/io/lm6_io.h @@ -86,7 +86,7 @@ class LM6VolumeImport : public VolumeImport for (int i = 0 ; i < number_of_vertices; ++i) { uint32 idx = this->vertex_attributes_.template insert_lines<1>(); - std::array v; + std::array v; (void) GmfGetLin(mesh_index, GmfVertices, &v[0],&v[1], &v[2], &ref); position->operator [](idx)[0] = v[0]; position->operator [](idx)[1] = v[1]; diff --git a/cgogn/io/map_export.h b/cgogn/io/map_export.h index 7eb2f2e0..38d3de1a 100644 --- a/cgogn/io/map_export.h +++ b/cgogn/io/map_export.h @@ -154,7 +154,7 @@ bool export_off_bin(MAP& map, const typename MAP::template VertexAttributeHandle static const uint32 BUFFER_SZ = 1024*1024; - std::vector buffer_pos; + std::vector buffer_pos; buffer_pos.reserve(BUFFER_SZ+3); map.template foreach_cell([&] (Face f) @@ -166,7 +166,7 @@ bool export_off_bin(MAP& map, const typename MAP::template VertexAttributeHandle ids[v] = count++; VEC3 P = position[v]; // VEC3 can be double ! - float Pf[3]={float(P[0]),float(P[1]),float(P[2])}; + float32 Pf[3]={float32(P[0]),float32(P[1]),float32(P[2])}; uint32* ui_vec = reinterpret_cast(Pf); ui_vec[0] = swap_endianness_native_big(ui_vec[0]); ui_vec[1] = swap_endianness_native_big(ui_vec[1]); @@ -178,7 +178,7 @@ bool export_off_bin(MAP& map, const typename MAP::template VertexAttributeHandle if (buffer_pos.size() >= BUFFER_SZ) { - fp.write(reinterpret_cast(&(buffer_pos[0])),buffer_pos.size()*sizeof(float)); + fp.write(reinterpret_cast(&(buffer_pos[0])),buffer_pos.size()*sizeof(float32)); buffer_pos.clear(); } } @@ -186,7 +186,7 @@ bool export_off_bin(MAP& map, const typename MAP::template VertexAttributeHandle }); if (!buffer_pos.empty()) { - fp.write(reinterpret_cast(&(buffer_pos[0])),buffer_pos.size()*sizeof(float)); + fp.write(reinterpret_cast(&(buffer_pos[0])),buffer_pos.size()*sizeof(float32)); buffer_pos.clear(); buffer_pos.shrink_to_fit(); } @@ -465,7 +465,7 @@ bool export_stl_bin(MAP& map, const typename MAP::template VertexAttributeHandle fp.write(reinterpret_cast(header),21*sizeof(uint32)); // buffer - std::array buffer_floats; // +1 for #@! ushort at end of each triangle + std::array buffer_floats; // +1 for #@! ushort at end of each triangle buffer_floats[12] = 0.0f; // local function for writing a triangle @@ -474,14 +474,14 @@ bool export_stl_bin(MAP& map, const typename MAP::template VertexAttributeHandle VEC3 N = geometry::triangle_normal(A,B,C); uint32 i=0; for (uint32 j=0; j<3; ++j) - buffer_floats[i++]= float(N[j]); + buffer_floats[i++]= float32(N[j]); for (uint32 j=0; j<3; ++j) - buffer_floats[i++]= float(A[j]); + buffer_floats[i++]= float32(A[j]); for (uint32 j=0; j<3; ++j) - buffer_floats[i++]= float(B[j]); + buffer_floats[i++]= float32(B[j]); for (uint32 j=0; j<3; ++j) - buffer_floats[i++]= float(C[j]); - fp.write(reinterpret_cast(buffer_floats.data()),12*sizeof(float)+2); // +2 for #@! ushort at end of each triangle + buffer_floats[i++]= float32(C[j]); + fp.write(reinterpret_cast(buffer_floats.data()),12*sizeof(float32)+2); // +2 for #@! ushort at end of each triangle }; // indices for ear triangulation @@ -543,8 +543,8 @@ template <> inline std::string nameOfTypePly(const int&) { return "int"; } template <> inline std::string nameOfTypePly(const uint32&) { return "uint"; } template <> inline std::string nameOfTypePly(const unsigned char&) { return "uint8"; } template <> inline std::string nameOfTypePly(const unsigned short int&) { return "uint16"; } -template <> inline std::string nameOfTypePly(const float&) { return "float"; } -template <> inline std::string nameOfTypePly(const double&) { return "float64"; } +template <> inline std::string nameOfTypePly(const float32&) { return "float32"; } +template <> inline std::string nameOfTypePly(const float64&) { return "float64"; } template bool export_ply(MAP& map, const typename MAP::template VertexAttributeHandler& position, const std::string& filename) diff --git a/cgogn/io/mesh_generation/examples/map3_from_surface.cpp b/cgogn/io/mesh_generation/examples/map3_from_surface.cpp index ffb0fd35..9e6d9779 100644 --- a/cgogn/io/mesh_generation/examples/map3_from_surface.cpp +++ b/cgogn/io/mesh_generation/examples/map3_from_surface.cpp @@ -117,7 +117,7 @@ int main(int argc, char** argv) std::cout << "nb volumes -> " << nbw << std::endl; end = std::chrono::system_clock::now(); - std::chrono::duration elapsed_seconds = end - start; + std::chrono::duration elapsed_seconds = end - start; std::cout << "elapsed time: " << elapsed_seconds.count() << "s\n"; diff --git a/cgogn/io/mesh_generation/tetgen_io.h b/cgogn/io/mesh_generation/tetgen_io.h index a3abd272..e70c4627 100644 --- a/cgogn/io/mesh_generation/tetgen_io.h +++ b/cgogn/io/mesh_generation/tetgen_io.h @@ -152,7 +152,7 @@ // // // //create vertices -// double* p = volume_->pointlist ; +// float64* p = volume_->pointlist ; // std::vector verticesID; // verticesID.reserve(volume_->numberofpoints); // AttributeContainer& container = map3.template getAttributeContainer() ; @@ -315,7 +315,7 @@ class TetgenVolumeImport : public VolumeImport //create vertices std::vector vertices_indices; - double* p = volume_->pointlist ; + float64* p = volume_->pointlist ; vertices_indices.reserve(this->nb_vertices_); for(uint32 i = 0u; i < this->nb_vertices_; ++i) diff --git a/cgogn/io/obj_io.h b/cgogn/io/obj_io.h index 973c3fc8..dd87ac4d 100644 --- a/cgogn/io/obj_io.h +++ b/cgogn/io/obj_io.h @@ -68,7 +68,7 @@ class ObjSurfaceImport : public SurfaceImport { { std::stringstream oss(line); - double x, y, z; + float64 x, y, z; oss >> x; oss >> y; oss >> z; diff --git a/cgogn/io/off_io.h b/cgogn/io/off_io.h index 25771319..2f251ab9 100644 --- a/cgogn/io/off_io.h +++ b/cgogn/io/off_io.h @@ -80,9 +80,9 @@ class OffSurfaceImport : public SurfaceImport { for (uint32 i = 0; i < this->nb_vertices_; ++i) { - double x = this->read_double(fp,line); - double y = this->read_double(fp,line); - double z = this->read_double(fp,line); + float64 x = this->read_double(fp,line); + float64 y = this->read_double(fp,line); + float64 z = this->read_double(fp,line); VEC3 pos{Scalar(x), Scalar(y), Scalar(z)}; @@ -124,7 +124,7 @@ class OffSurfaceImport : public SurfaceImport { static const uint32 BUFFER_SZ = 1024*1024; - float* buff_pos = new float[3*BUFFER_SZ]; + float32* buff_pos = new float32[3*BUFFER_SZ]; std::vector vertices_id; vertices_id.reserve(this->nb_vertices_); @@ -137,9 +137,9 @@ class OffSurfaceImport : public SurfaceImport { j = 0; // read from file into buffer if (i + BUFFER_SZ < this->nb_vertices_) - fp.read(reinterpret_cast(buff_pos), 3 * sizeof(float)*BUFFER_SZ); + fp.read(reinterpret_cast(buff_pos), 3 * sizeof(float32)*BUFFER_SZ); else - fp.read(reinterpret_cast(buff_pos), 3 * sizeof(float)*(this->nb_vertices_ - i)); + fp.read(reinterpret_cast(buff_pos), 3 * sizeof(float32)*(this->nb_vertices_ - i)); //endian uint32* ptr = reinterpret_cast(buff_pos); @@ -213,7 +213,7 @@ class OffSurfaceImport : public SurfaceImport { return true; } private: - static inline double read_double(std::istream& fp, std::string& line) + static inline float64 read_double(std::istream& fp, std::string& line) { fp >> line; while (line[0]=='#') diff --git a/cgogn/io/vtk_io.h b/cgogn/io/vtk_io.h index c26862e3..81d668ce 100644 --- a/cgogn/io/vtk_io.h +++ b/cgogn/io/vtk_io.h @@ -588,9 +588,9 @@ protected : if (data_type == "unsigned_long" || data_type == "uint64") return name_of_type(std::uint64_t()); if (data_type == "float" || data_type == "float32") - return name_of_type(float()); + return name_of_type(float32()); if (data_type == "double" || data_type == "float64") - return name_of_type(double()); + return name_of_type(float64()); std::cerr << "vtk_data_type_to_cgogn_name_of_type : unknown vtk type : " << vtk_type_str << std::endl; return std::string(); diff --git a/cgogn/rendering/drawer.cpp b/cgogn/rendering/drawer.cpp index 5ce0d2bd..8c0ce27c 100644 --- a/cgogn/rendering/drawer.cpp +++ b/cgogn/rendering/drawer.cpp @@ -160,7 +160,7 @@ void Drawer::end() } -void Drawer::vertex3f(float x, float y, float z) +void Drawer::vertex3f(float32 x, float32 y, float32 z) { if (data_pos_.size() == data_col_.size()) { @@ -173,7 +173,7 @@ void Drawer::vertex3f(float x, float y, float z) } -void Drawer::color3f(float r, float g, float b) +void Drawer::color3f(float32 r, float32 g, float32 b) { if (data_pos_.size() == data_col_.size()) data_col_.push_back(Vec3f{r,g,b}); @@ -190,7 +190,7 @@ void Drawer::end_list() return; vbo_pos_->allocate(nb_elts,3); - float* ptr = vbo_pos_->lock_pointer(); + float32* ptr = vbo_pos_->lock_pointer(); std::memcpy(ptr,data_pos_[0].data(),nb_elts*12); vbo_pos_->release_pointer(); diff --git a/cgogn/rendering/drawer.h b/cgogn/rendering/drawer.h index 50ddf2f3..99b57363 100644 --- a/cgogn/rendering/drawer.h +++ b/cgogn/rendering/drawer.h @@ -47,13 +47,13 @@ class CGOGN_RENDERING_API Drawer { uint32 begin; GLenum mode; - float width; + float32 width; uint32 nb; bool aa; - PrimParam(std::size_t b, GLenum m, float w, bool a) : begin(uint32(b)), mode(m), width(w), nb(0), aa(a){} + PrimParam(std::size_t b, GLenum m, float32 w, bool a) : begin(uint32(b)), mode(m), width(w), nb(0), aa(a){} }; - using Vec3f = std::array; + using Vec3f = std::array; protected: @@ -83,7 +83,7 @@ class CGOGN_RENDERING_API Drawer uint32 vao_rp_; uint32 vao_ps_; - float current_size_; + float32 current_size_; bool current_aa_; bool current_ball_; @@ -128,20 +128,20 @@ class CGOGN_RENDERING_API Drawer /** * use as glVertex3f */ - void vertex3f(float x, float y, float z); + void vertex3f(float32 x, float32 y, float32 z); /** * use as glColor3f */ - void color3f(float r, float g, float b); + void color3f(float32 r, float32 g, float32 b); - inline void vertex3fv(const std::array& xyz) + inline void vertex3fv(const std::array& xyz) { vertex3f(xyz[0],xyz[1],xyz[2]); } - inline void color3fv(const std::array& rgb) + inline void color3fv(const std::array& rgb) { color3f(rgb[0],rgb[1],rgb[2]); } @@ -149,25 +149,25 @@ class CGOGN_RENDERING_API Drawer template inline void vertex3fv(SCAL* xyz) { - vertex3f(float(xyz[0]),float(xyz[1]),float(xyz[2])); + vertex3f(float32(xyz[0]),float32(xyz[1]),float32(xyz[2])); } template inline void color3fv(SCAL* rgb) { - color3f(float(rgb[0]),float(rgb[1]),float(rgb[2])); + color3f(float32(rgb[0]),float32(rgb[1]),float32(rgb[2])); } template inline void vertex3fv(const VEC3& xyz) { - vertex3f(float(xyz[0]),float(xyz[1]),float(xyz[2])); + vertex3f(float32(xyz[0]),float32(xyz[1]),float32(xyz[2])); } template inline void color3fv(const VEC3& rgb) { - color3f(float(rgb[0]),float(rgb[1]),float(rgb[2])); + color3f(float32(rgb[0]),float32(rgb[1]),float32(rgb[2])); } @@ -181,21 +181,21 @@ class CGOGN_RENDERING_API Drawer /** * usr as glPointSize */ - inline void point_size(float ps) + inline void point_size(float32 ps) { current_aa_ = false; current_size_ = ps; current_ball_ = false; } - inline void point_size_aa(float ps) + inline void point_size_aa(float32 ps) { current_aa_ = true; current_size_ = ps; current_ball_ = false; } - inline void ball_size(float ps) + inline void ball_size(float32 ps) { current_ball_ = true; current_aa_ = false; @@ -206,13 +206,13 @@ class CGOGN_RENDERING_API Drawer /** * usr as glLineWidth */ - inline void line_width(float lw) + inline void line_width(float32 lw) { current_aa_ = false; current_size_ = lw; } - inline void line_width_aa(float lw) + inline void line_width_aa(float32 lw) { current_aa_ = true; current_size_ = 2.0*lw; diff --git a/cgogn/rendering/examples/picking_viewer.cpp b/cgogn/rendering/examples/picking_viewer.cpp index d6690ba2..f7e94b72 100644 --- a/cgogn/rendering/examples/picking_viewer.cpp +++ b/cgogn/rendering/examples/picking_viewer.cpp @@ -48,7 +48,7 @@ using namespace cgogn::numerics; using Map2 = cgogn::CMap2; //using Vec3 = Eigen::Vector3d; -using Vec3 = cgogn::geometry::Vec_T>; +using Vec3 = cgogn::geometry::Vec_T>; template using VertexAttributeHandler = Map2::VertexAttributeHandler; diff --git a/cgogn/rendering/examples/viewer_per_face.cpp b/cgogn/rendering/examples/viewer_per_face.cpp index 2702eda7..88579dd5 100644 --- a/cgogn/rendering/examples/viewer_per_face.cpp +++ b/cgogn/rendering/examples/viewer_per_face.cpp @@ -48,7 +48,7 @@ using namespace cgogn::numerics; using Map2 = cgogn::CMap2; using Vec3 = Eigen::Vector3d; -//using Vec3 = cgogn::geometry::Vec_T>; +//using Vec3 = cgogn::geometry::Vec_T>; template using VertexAttributeHandler = Map2::VertexAttributeHandler; @@ -205,21 +205,21 @@ void Viewer::init() cgogn::rendering::create_indices_vertices_faces(map_,vertex_position_,ind_v,ind_f); // generate VBO: positions - cgogn::rendering::generate_vbo(vertex_position_, ind_v, *vbo_pos_, [] (const Vec3& v) -> std::array + cgogn::rendering::generate_vbo(vertex_position_, ind_v, *vbo_pos_, [] (const Vec3& v) -> std::array { - return {float(v[0]), float(v[1]), float(v[2])}; + return {float32(v[0]), float32(v[1]), float32(v[2])}; }); // generate VBO: normals - cgogn::rendering::generate_vbo(face_normal_, ind_f, *vbo_norm_, [] (const Vec3& n) -> std::array + cgogn::rendering::generate_vbo(face_normal_, ind_f, *vbo_norm_, [] (const Vec3& n) -> std::array { - return {float(n[0]), float(n[1]), float(n[2])}; + return {float32(n[0]), float32(n[1]), float32(n[2])}; }); // generate VBO: colors (here abs of normals) - cgogn::rendering::generate_vbo(face_normal_, ind_f, *vbo_color_, [] (const Vec3& n) -> std::array + cgogn::rendering::generate_vbo(face_normal_, ind_f, *vbo_color_, [] (const Vec3& n) -> std::array { - return {float(std::abs(n[0])), float(std::abs(n[1])), float(std::abs(n[2]))}; + return {float32(std::abs(n[0])), float32(std::abs(n[1])), float32(std::abs(n[2]))}; }); diff --git a/cgogn/rendering/examples/viewer_topo.cpp b/cgogn/rendering/examples/viewer_topo.cpp index ab9078e0..219c63d8 100644 --- a/cgogn/rendering/examples/viewer_topo.cpp +++ b/cgogn/rendering/examples/viewer_topo.cpp @@ -45,7 +45,7 @@ using Map2 = cgogn::CMap2; using Vec3 = Eigen::Vector3d; -//using Vec3 = cgogn::geometry::Vec_T>; +//using Vec3 = cgogn::geometry::Vec_T>; template using VertexAttributeHandler = Map2::VertexAttributeHandler; diff --git a/cgogn/rendering/examples/viewer_topo3.cpp b/cgogn/rendering/examples/viewer_topo3.cpp index ccf0935a..eac8a960 100644 --- a/cgogn/rendering/examples/viewer_topo3.cpp +++ b/cgogn/rendering/examples/viewer_topo3.cpp @@ -44,7 +44,7 @@ using namespace cgogn::numerics; using Map3 = cgogn::CMap3; using Vec3 = Eigen::Vector3d; -//using Vec3 = cgogn::geometry::Vec_T>; +//using Vec3 = cgogn::geometry::Vec_T>; template using VertexAttributeHandler = Map3::VertexAttributeHandler; @@ -85,7 +85,7 @@ class Viewer : public QOGLViewer bool edge_rendering_; bool topo_rendering_; - float expl_; + float32 expl_; }; diff --git a/cgogn/rendering/shaders/shader_bold_line.cpp b/cgogn/rendering/shaders/shader_bold_line.cpp index a96f2d90..9cc9881b 100644 --- a/cgogn/rendering/shaders/shader_bold_line.cpp +++ b/cgogn/rendering/shaders/shader_bold_line.cpp @@ -215,12 +215,12 @@ void ShaderBoldLine::set_color(const QColor& rgb) prg_.setUniformValue(unif_color_, rgb); } -void ShaderBoldLine::set_width(float wpix) +void ShaderBoldLine::set_width(float32 wpix) { QOpenGLFunctions *ogl = QOpenGLContext::currentContext()->functions(); GLint viewport[4]; ogl->glGetIntegerv(GL_VIEWPORT, viewport); - QSizeF wd(wpix / float(viewport[2]), wpix / float(viewport[3])); + QSizeF wd(wpix / float32(viewport[2]), wpix / float32(viewport[3])); prg_.setUniformValue(unif_width_, wd); } diff --git a/cgogn/rendering/shaders/shader_bold_line.h b/cgogn/rendering/shaders/shader_bold_line.h index 72272756..6fc369b8 100644 --- a/cgogn/rendering/shaders/shader_bold_line.h +++ b/cgogn/rendering/shaders/shader_bold_line.h @@ -68,7 +68,7 @@ class CGOGN_RENDERING_API ShaderBoldLine : public ShaderProgram * @brief set the width of lines (call before each draw) * @param w width in pixel */ - void set_width(float w); + void set_width(float32 w); /** * @brief set a vao configuration diff --git a/cgogn/rendering/shaders/shader_explode_volumes.cpp b/cgogn/rendering/shaders/shader_explode_volumes.cpp index 9f5fe628..1abd49ed 100644 --- a/cgogn/rendering/shaders/shader_explode_volumes.cpp +++ b/cgogn/rendering/shaders/shader_explode_volumes.cpp @@ -183,7 +183,7 @@ void ShaderExplodeVolumes::set_light_position(const QVector3D& l) } -void ShaderExplodeVolumes::set_explode_volume(float x) +void ShaderExplodeVolumes::set_explode_volume(float32 x) { prg_.setUniformValue(unif_expl_v_, x); } diff --git a/cgogn/rendering/shaders/shader_explode_volumes.h b/cgogn/rendering/shaders/shader_explode_volumes.h index ccc42d49..cbb096cc 100644 --- a/cgogn/rendering/shaders/shader_explode_volumes.h +++ b/cgogn/rendering/shaders/shader_explode_volumes.h @@ -63,7 +63,7 @@ class CGOGN_RENDERING_API ShaderExplodeVolumes : public ShaderProgram ShaderExplodeVolumes(bool color_per_vertex = false); - void set_explode_volume(float x); + void set_explode_volume(float32 x); void set_light_position(const QVector3D& l); diff --git a/cgogn/rendering/shaders/shader_explode_volumes_line.cpp b/cgogn/rendering/shaders/shader_explode_volumes_line.cpp index d483ae09..460af741 100644 --- a/cgogn/rendering/shaders/shader_explode_volumes_line.cpp +++ b/cgogn/rendering/shaders/shader_explode_volumes_line.cpp @@ -101,7 +101,7 @@ void ShaderExplodeVolumesLine::set_color(const QColor& rgb) } -void ShaderExplodeVolumesLine::set_explode_volume(float x) +void ShaderExplodeVolumesLine::set_explode_volume(float32 x) { prg_.setUniformValue(unif_expl_v_, x); } diff --git a/cgogn/rendering/shaders/shader_explode_volumes_line.h b/cgogn/rendering/shaders/shader_explode_volumes_line.h index 3144c647..bc31708c 100644 --- a/cgogn/rendering/shaders/shader_explode_volumes_line.h +++ b/cgogn/rendering/shaders/shader_explode_volumes_line.h @@ -57,7 +57,7 @@ class CGOGN_RENDERING_API ShaderExplodeVolumesLine : public ShaderProgram ShaderExplodeVolumesLine(); - void set_explode_volume(float x); + void set_explode_volume(float32 x); void set_plane_clip(const QVector4D& plane); diff --git a/cgogn/rendering/shaders/shader_phong.cpp b/cgogn/rendering/shaders/shader_phong.cpp index 2e8e463d..5394d857 100644 --- a/cgogn/rendering/shaders/shader_phong.cpp +++ b/cgogn/rendering/shaders/shader_phong.cpp @@ -221,7 +221,7 @@ void ShaderPhong::set_specular_color(const QColor& rgb) prg_.setUniformValue(unif_spec_color_,rgb); } -void ShaderPhong::set_specular_coef(float coef) +void ShaderPhong::set_specular_coef(float32 coef) { prg_.setUniformValue(unif_spec_coef_,coef); } diff --git a/cgogn/rendering/shaders/shader_phong.h b/cgogn/rendering/shaders/shader_phong.h index bd934e48..363526ca 100644 --- a/cgogn/rendering/shaders/shader_phong.h +++ b/cgogn/rendering/shaders/shader_phong.h @@ -93,7 +93,7 @@ class CGOGN_RENDERING_API ShaderPhong : public ShaderProgram * @brief set current specular coefficient * @param rgb */ - void set_specular_coef(float coef); + void set_specular_coef(float32 coef); /** * @brief set double side option diff --git a/cgogn/rendering/shaders/shader_point_sprite.cpp b/cgogn/rendering/shaders/shader_point_sprite.cpp index 3d07f2dc..b6428d0a 100644 --- a/cgogn/rendering/shaders/shader_point_sprite.cpp +++ b/cgogn/rendering/shaders/shader_point_sprite.cpp @@ -335,7 +335,7 @@ void ShaderPointSprite::set_ambiant(const QColor& rgb) prg_.setUniformValue(unif_ambiant_, rgb); } -void ShaderPointSprite::set_size(float w) +void ShaderPointSprite::set_size(float32 w) { // if (unif_size_>=0) prg_.setUniformValue(unif_size_, w); diff --git a/cgogn/rendering/shaders/shader_point_sprite.h b/cgogn/rendering/shaders/shader_point_sprite.h index 560e53dc..84892539 100644 --- a/cgogn/rendering/shaders/shader_point_sprite.h +++ b/cgogn/rendering/shaders/shader_point_sprite.h @@ -92,7 +92,7 @@ class CGOGN_RENDERING_API ShaderPointSprite : public ShaderProgram * @brief set the size of sphere (call before each draw) * @param w size ofs phere */ - void set_size(float w); + void set_size(float32 w); /** * @brief set a vao configuration diff --git a/cgogn/rendering/shaders/shader_round_point.cpp b/cgogn/rendering/shaders/shader_round_point.cpp index 4140c110..4477f991 100644 --- a/cgogn/rendering/shaders/shader_round_point.cpp +++ b/cgogn/rendering/shaders/shader_round_point.cpp @@ -175,12 +175,12 @@ void ShaderRoundPoint::set_color(const QColor& rgb) prg_.setUniformValue(unif_color_, rgb); } -void ShaderRoundPoint::set_width(float wpix) +void ShaderRoundPoint::set_width(float32 wpix) { QOpenGLFunctions *ogl = QOpenGLContext::currentContext()->functions(); int viewport[4]; ogl->glGetIntegerv(GL_VIEWPORT, viewport); - QSizeF wd(wpix / float(viewport[2]), wpix / float(viewport[3])); + QSizeF wd(wpix / float32(viewport[2]), wpix / float32(viewport[3])); prg_.setUniformValue(unif_width_, wd); } diff --git a/cgogn/rendering/shaders/shader_round_point.h b/cgogn/rendering/shaders/shader_round_point.h index 2db4b0b3..73ed5f46 100644 --- a/cgogn/rendering/shaders/shader_round_point.h +++ b/cgogn/rendering/shaders/shader_round_point.h @@ -68,7 +68,7 @@ class CGOGN_RENDERING_API ShaderRoundPoint : public ShaderProgram * @brief set the width of lines (call before each draw) * @param w width in pixel */ - void set_width(float w); + void set_width(float32 w); /** * @brief set a vao configuration diff --git a/cgogn/rendering/shaders/shader_vector_per_vertex.cpp b/cgogn/rendering/shaders/shader_vector_per_vertex.cpp index eb190d5d..eaea209d 100644 --- a/cgogn/rendering/shaders/shader_vector_per_vertex.cpp +++ b/cgogn/rendering/shaders/shader_vector_per_vertex.cpp @@ -94,7 +94,7 @@ void ShaderVectorPerVertex::set_color(const QColor& rgb) prg_.setUniformValue(unif_color_, rgb); } -void ShaderVectorPerVertex::set_length(float l) +void ShaderVectorPerVertex::set_length(float32 l) { prg_.setUniformValue(unif_length_, l); } diff --git a/cgogn/rendering/shaders/shader_vector_per_vertex.h b/cgogn/rendering/shaders/shader_vector_per_vertex.h index 82dfd8c4..13dc0fdf 100644 --- a/cgogn/rendering/shaders/shader_vector_per_vertex.h +++ b/cgogn/rendering/shaders/shader_vector_per_vertex.h @@ -64,7 +64,7 @@ class CGOGN_RENDERING_API ShaderVectorPerVertex : public ShaderProgram * @brief set length of normal * @param l length */ - void set_length(float l); + void set_length(float32 l); /** * @brief set a vao configuration diff --git a/cgogn/rendering/shaders/vbo.h b/cgogn/rendering/shaders/vbo.h index c88bbdda..c63d343e 100644 --- a/cgogn/rendering/shaders/vbo.h +++ b/cgogn/rendering/shaders/vbo.h @@ -80,7 +80,7 @@ class VBO buffer_.bind(); uint32 total = nb_vectors * vector_dimension; if (total != nb_vectors_ * vector_dimension_) // only allocate when > ? - buffer_.allocate(total * sizeof(float)); + buffer_.allocate(total * sizeof(float32)); nb_vectors_ = nb_vectors; if (vector_dimension != vector_dimension_) { @@ -94,10 +94,10 @@ class VBO * @brief get and lock pointer on buffer memory * @return the pointer */ - inline float* lock_pointer() + inline float32* lock_pointer() { buffer_.bind(); - return reinterpret_cast(buffer_.map(QOpenGLBuffer::ReadWrite)); + return reinterpret_cast(buffer_.map(QOpenGLBuffer::ReadWrite)); } /** @@ -142,7 +142,7 @@ class VBO template void update_vbo(const ATTR& attr, VBO& vbo) { - static_assert(std::is_same::Scalar, float>::value || std::is_same::Scalar, double>::value, "only float or double allowed for vbo"); + static_assert(std::is_same::Scalar, float32>::value || std::is_same::Scalar, double>::value, "only float or double allowed for vbo"); const typename ATTR::TChunkArray* ca = attr.get_data(); @@ -153,9 +153,9 @@ void update_vbo(const ATTR& attr, VBO& vbo) vbo.allocate(nb_chunks * ATTR::CHUNKSIZE, vec_dim); - const uint32 vbo_blk_bytes = ATTR::CHUNKSIZE * vec_dim * sizeof(float); + const uint32 vbo_blk_bytes = ATTR::CHUNKSIZE * vec_dim * sizeof(float32); - if (std::is_same::Scalar, float>::value) + if (std::is_same::Scalar, float32>::value) { // copy vbo.bind(); @@ -163,19 +163,19 @@ void update_vbo(const ATTR& attr, VBO& vbo) vbo.copy_data(i* vbo_blk_bytes, vbo_blk_bytes, chunk_addr[i]); vbo.release(); } - else if (std::is_same::Scalar, double>::value) + else if (std::is_same::Scalar, float64>::value) { // copy (after conversion to float) - float* float_buffer = new float[ATTR::CHUNKSIZE * vec_dim]; + float32* float_buffer = new float32[ATTR::CHUNKSIZE * vec_dim]; for (uint32 i = 0; i < nb_chunks; ++i) { // transform double into float - float* fit = float_buffer; - double* src = reinterpret_cast(chunk_addr[i]); + float32* fit = float_buffer; + float64* src = reinterpret_cast(chunk_addr[i]); for (uint32 j = 0; j < ATTR::CHUNKSIZE * vec_dim; ++j) *fit++ = *src++; vbo.bind(); - vbo.copy_data(i* ATTR::CHUNKSIZE * vec_dim * sizeof(float), ATTR::CHUNKSIZE * vec_dim * sizeof(float),float_buffer); + vbo.copy_data(i* ATTR::CHUNKSIZE * vec_dim * sizeof(float32), ATTR::CHUNKSIZE * vec_dim * sizeof(float32),float_buffer); vbo.release(); } delete[] float_buffer; @@ -206,14 +206,14 @@ void update_vbo(const ATTR& attr, VBO& vbo, const FUNC& convert) uint32 nb_chunks = ca->get_chunks_pointers(chunk_addr, byte_chunk_size); // check that out of convert is float or std::array - using Vec2f = std::array; - using Vec3f = std::array; - using Vec4f = std::array; - static_assert(check_func_return_type(FUNC,float) || check_func_return_type(FUNC,Vec2f) || check_func_return_type(FUNC,Vec3f) ||check_func_return_type(FUNC,Vec4f), "convert output must be float or std::array" ); + using Vec2f = std::array; + using Vec3f = std::array; + using Vec4f = std::array; + static_assert(check_func_return_type(FUNC,float32) || check_func_return_type(FUNC,Vec2f) || check_func_return_type(FUNC,Vec3f) ||check_func_return_type(FUNC,Vec4f), "convert output must be float or std::array" ); // set vec dimension uint32 vec_dim = 0; - if (check_func_return_type(FUNC,float) ) + if (check_func_return_type(FUNC,float32) ) vec_dim = 1; else if (check_func_return_type(FUNC,Vec2f) ) vec_dim = 2; @@ -272,14 +272,14 @@ void update_vbo(const ATTR& attr, const ATTR2& attr2, VBO& vbo, const FUNC& conv ca2->get_chunks_pointers(chunk_addr2, byte_chunk_size); // check that out of convert is float or std::array - using Vec2f = std::array; - using Vec3f = std::array; - using Vec4f = std::array; - static_assert(check_func_return_type(FUNC,float) || check_func_return_type(FUNC,Vec2f) || check_func_return_type(FUNC,Vec3f) ||check_func_return_type(FUNC,Vec4f), "convert output must be float or std::array" ); + using Vec2f = std::array; + using Vec3f = std::array; + using Vec4f = std::array; + static_assert(check_func_return_type(FUNC,float32) || check_func_return_type(FUNC,Vec2f) || check_func_return_type(FUNC,Vec3f) ||check_func_return_type(FUNC,Vec4f), "convert output must be float or std::array" ); // set vec dimension uint32 vec_dim = 0; - if (check_func_return_type(FUNC,float) ) + if (check_func_return_type(FUNC,float32) ) vec_dim = 1; else if (check_func_return_type(FUNC,Vec2f) ) vec_dim = 2; @@ -325,14 +325,14 @@ void generate_vbo(const ATTR& attr, const std::vector& indices, VBO& vbo static_assert(std::is_same::value, "wrong parameter 1"); // check that out of convert is float or std::array - using Vec2f = std::array; - using Vec3f = std::array; - using Vec4f = std::array; - static_assert(check_func_return_type(FUNC,float) || check_func_return_type(FUNC,Vec2f) || check_func_return_type(FUNC,Vec3f) ||check_func_return_type(FUNC,Vec4f), "convert output must be float or std::array" ); + using Vec2f = std::array; + using Vec3f = std::array; + using Vec4f = std::array; + static_assert(check_func_return_type(FUNC,float32) || check_func_return_type(FUNC,Vec2f) || check_func_return_type(FUNC,Vec3f) ||check_func_return_type(FUNC,Vec4f), "convert output must be float or std::array" ); // set vec dimension uint32 vec_dim = 0; - if (check_func_return_type(FUNC,float) ) + if (check_func_return_type(FUNC,float32) ) vec_dim = 1; else if (check_func_return_type(FUNC,Vec2f) ) vec_dim = 2; diff --git a/cgogn/rendering/topo_render.h b/cgogn/rendering/topo_render.h index 6dd2be73..2c99ee18 100644 --- a/cgogn/rendering/topo_render.h +++ b/cgogn/rendering/topo_render.h @@ -43,7 +43,7 @@ namespace rendering class CGOGN_RENDERING_API TopoRender { - using Vec3f = std::array; + using Vec3f = std::array; protected: @@ -66,9 +66,9 @@ class CGOGN_RENDERING_API TopoRender QColor phi2_color_; QColor phi3_color_; - float shrink_v_; - float shrink_f_; - float shrink_e_; + float32 shrink_v_; + float32 shrink_f_; + float32 shrink_e_; public: @@ -83,9 +83,9 @@ class CGOGN_RENDERING_API TopoRender */ ~TopoRender(); - inline void set_explode_volume(float x) { shrink_v_ = x; } - inline void set_explode_face(float x) { shrink_f_ = x; } - inline void set_explode_edge(float x) { shrink_e_ = x; } + inline void set_explode_volume(float32 x) { shrink_v_ = x; } + inline void set_explode_face(float32 x) { shrink_f_ = x; } + inline void set_explode_edge(float32 x) { shrink_e_ = x; } template void update_map2(MAP& m, const typename MAP::template VertexAttributeHandler& position); @@ -107,10 +107,10 @@ void TopoRender::update_map2(MAP& m, const typename MAP::template VertexAttribut Scalar opp_shrink_e = 1.0 -shrink_e_; Scalar opp_shrink_f = 1.0 - shrink_f_; - std::vector> out_pos; + std::vector> out_pos; out_pos.reserve(1024*1024); - std::vector> out_pos2; + std::vector> out_pos2; out_pos2.reserve(1024*1024); @@ -150,13 +150,13 @@ void TopoRender::update_map2(MAP& m, const typename MAP::template VertexAttribut for (uint32 i=0; i> out_pos; + std::vector> out_pos; out_pos.reserve(1024*1024); - std::vector> out_pos2; + std::vector> out_pos2; out_pos2.reserve(1024*1024); - std::vector> out_pos3; + std::vector> out_pos3; out_pos3.reserve(1024*1024); @@ -241,17 +241,17 @@ void TopoRender::update_map3(MAP& m, const typename MAP::template VertexAttribut for (uint32 i=0; i; + using Vec3f = std::array; protected: @@ -64,8 +64,8 @@ class CGOGN_RENDERING_API VolumeRender QOpenGLFunctions_3_3_Core* ogl33_; - float shrink_v_; - float shrink_f_; + float32 shrink_v_; + float32 shrink_f_; void init_with_color(); @@ -86,9 +86,9 @@ class CGOGN_RENDERING_API VolumeRender */ ~VolumeRender(); - inline void set_explode_face(float x) { shrink_f_ = x; } + inline void set_explode_face(float32 x) { shrink_f_ = x; } - inline void set_explode_volume(float x) { shrink_v_ = x; } + inline void set_explode_volume(float32 x) { shrink_v_ = x; } inline void set_face_color(const QColor& rgb) { face_color_= rgb; } @@ -120,7 +120,7 @@ void VolumeRender::update_face(MAP& m, const typename MAP::template VertexAttrib using Volume = typename MAP::Volume; using Scalar = typename VEC3::Scalar; - std::vector> out_pos; + std::vector> out_pos; out_pos.reserve(1024*1024); std::vector ear_indices; @@ -136,10 +136,10 @@ void VolumeRender::update_face(MAP& m, const typename MAP::template VertexAttrib const VEC3& P1 = position[Vertex(f.dart)]; const VEC3& P2 = position[Vertex(m.phi1(f.dart))]; const VEC3& P3 = position[Vertex(m.phi1(m.phi1(f.dart)))]; - out_pos.push_back({float(CV[0]),float(CV[1]),float(CV[2])}); - out_pos.push_back({float(P1[0]),float(P1[1]),float(P1[2])}); - out_pos.push_back({float(P2[0]),float(P2[1]),float(P2[2])}); - out_pos.push_back({float(P3[0]),float(P3[1]),float(P3[2])}); + out_pos.push_back({float32(CV[0]),float32(CV[1]),float32(CV[2])}); + out_pos.push_back({float32(P1[0]),float32(P1[1]),float32(P1[2])}); + out_pos.push_back({float32(P2[0]),float32(P2[1]),float32(P2[2])}); + out_pos.push_back({float32(P3[0]),float32(P3[1]),float32(P3[2])}); } else { @@ -150,10 +150,10 @@ void VolumeRender::update_face(MAP& m, const typename MAP::template VertexAttrib const VEC3& P1 = position[ear_indices[i]]; const VEC3& P2 = position[ear_indices[i+1]]; const VEC3& P3 = position[ear_indices[i+2]]; - out_pos.push_back({float(CV[0]),float(CV[1]),float(CV[2])}); - out_pos.push_back({float(P1[0]),float(P1[1]),float(P1[2])}); - out_pos.push_back({float(P2[0]),float(P2[1]),float(P2[2])}); - out_pos.push_back({float(P3[0]),float(P3[1]),float(P3[2])}); + out_pos.push_back({float32(CV[0]),float32(CV[1]),float32(CV[2])}); + out_pos.push_back({float32(P1[0]),float32(P1[1]),float32(P1[2])}); + out_pos.push_back({float32(P2[0]),float32(P2[1]),float32(P2[2])}); + out_pos.push_back({float32(P3[0]),float32(P3[1]),float32(P3[2])}); } } }); @@ -178,10 +178,10 @@ void VolumeRender::update_face(MAP& m, const typename MAP::template VertexAttrib using Volume = typename MAP::Volume; using Scalar = typename VEC3::Scalar; - std::vector> out_pos; + std::vector> out_pos; out_pos.reserve(1024*1024); - std::vector> out_color; + std::vector> out_color; out_color.reserve(1024*1024); std::vector ear_indices; @@ -203,14 +203,14 @@ void VolumeRender::update_face(MAP& m, const typename MAP::template VertexAttrib d = m.phi1(d); const VEC3& P3 = position[Vertex(d)]; const VEC3& C3 = color[Vertex(d)]; - out_pos.push_back({float(CV[0]),float(CV[1]),float(CV[2])}); - out_pos.push_back({float(P1[0]),float(P1[1]),float(P1[2])}); - out_pos.push_back({float(P2[0]),float(P2[1]),float(P2[2])}); - out_pos.push_back({float(P3[0]),float(P3[1]),float(P3[2])}); - out_color.push_back({float(CV[0]),float(CV[1]),float(CV[2])}); - out_color.push_back({float(C1[0]),float(C1[1]),float(C1[2])}); - out_color.push_back({float(C2[0]),float(C2[1]),float(C2[2])}); - out_color.push_back({float(C3[0]),float(C3[1]),float(C3[2])}); + out_pos.push_back({float32(CV[0]),float32(CV[1]),float32(CV[2])}); + out_pos.push_back({float32(P1[0]),float32(P1[1]),float32(P1[2])}); + out_pos.push_back({float32(P2[0]),float32(P2[1]),float32(P2[2])}); + out_pos.push_back({float32(P3[0]),float32(P3[1]),float32(P3[2])}); + out_color.push_back({float32(CV[0]),float32(CV[1]),float32(CV[2])}); + out_color.push_back({float32(C1[0]),float32(C1[1]),float32(C1[2])}); + out_color.push_back({float32(C2[0]),float32(C2[1]),float32(C2[2])}); + out_color.push_back({float32(C3[0]),float32(C3[1]),float32(C3[2])}); } else { @@ -225,14 +225,14 @@ void VolumeRender::update_face(MAP& m, const typename MAP::template VertexAttrib const VEC3& C2 = color[ear_indices[i+1]]; const VEC3& P3 = position[ear_indices[i+2]]; const VEC3& C3 = color[ear_indices[i+2]]; - out_pos.push_back({float(CV[0]),float(CV[1]),float(CV[2])}); - out_pos.push_back({float(P1[0]),float(P1[1]),float(P1[2])}); - out_pos.push_back({float(P2[0]),float(P2[1]),float(P2[2])}); - out_pos.push_back({float(P3[0]),float(P3[1]),float(P3[2])}); - out_color.push_back({float(CV[0]),float(CV[1]),float(CV[2])}); - out_color.push_back({float(C1[0]),float(C1[1]),float(C1[2])}); - out_color.push_back({float(C2[0]),float(C2[1]),float(C2[2])}); - out_color.push_back({float(C3[0]),float(C3[1]),float(C3[2])}); + out_pos.push_back({float32(CV[0]),float32(CV[1]),float32(CV[2])}); + out_pos.push_back({float32(P1[0]),float32(P1[1]),float32(P1[2])}); + out_pos.push_back({float32(P2[0]),float32(P2[1]),float32(P2[2])}); + out_pos.push_back({float32(P3[0]),float32(P3[1]),float32(P3[2])}); + out_color.push_back({float32(CV[0]),float32(CV[1]),float32(CV[2])}); + out_color.push_back({float32(C1[0]),float32(C1[1]),float32(C1[2])}); + out_color.push_back({float32(C2[0]),float32(C2[1]),float32(C2[2])}); + out_color.push_back({float32(C3[0]),float32(C3[1]),float32(C3[2])}); } } }); @@ -263,7 +263,7 @@ void VolumeRender::update_edge(MAP& m, const typename MAP::template VertexAttrib using Volume = typename MAP::Volume; using Scalar = typename VEC3::Scalar; - std::vector> out_pos; + std::vector> out_pos; out_pos.reserve(1024*1024); std::vector ear_indices; @@ -276,9 +276,9 @@ void VolumeRender::update_edge(MAP& m, const typename MAP::template VertexAttrib { const VEC3& P1 = position[Vertex(e.dart)]; const VEC3& P2 = position[Vertex(m.phi1(e.dart))]; - out_pos.push_back({float(CV[0]),float(CV[1]),float(CV[2])}); - out_pos.push_back({float(P1[0]),float(P1[1]),float(P1[2])}); - out_pos.push_back({float(P2[0]),float(P2[1]),float(P2[2])}); + out_pos.push_back({float32(CV[0]),float32(CV[1]),float32(CV[2])}); + out_pos.push_back({float32(P1[0]),float32(P1[1]),float32(P1[2])}); + out_pos.push_back({float32(P2[0]),float32(P2[1]),float32(P2[2])}); }); });