Skip to content

Commit d8d4be9

Browse files
committed
[geogram] update to 1.3.10
1 parent a9a39cc commit d8d4be9

File tree

134 files changed

+32210
-4282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+32210
-4282
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ include(cmake/geogram.cmake)
3030

3131
set(VORPALINE_VERSION_MAJOR 1)
3232
set(VORPALINE_VERSION_MINOR 3)
33-
set(VORPALINE_VERSION_PATCH 9)
33+
set(VORPALINE_VERSION_PATCH 10)
3434
set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH})
3535

3636
set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})

cmake/platforms/Emscripten-clang.cmake

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ endif()
5151
#https://kripken.github.io/emscripten-site/docs/optimizing/Optimizing-Code.html
5252
# Note: they are added to CMAKE CXX and C flags later on, because the
5353
# way add_flags() works may remove the second "-s" argument.
54-
set(EM_FLAGS -O3 -s USE_GLFW=3 -s TOTAL_MEMORY=256000000 )
54+
set(EM_FLAGS_RELEASE -O3 -s USE_GLFW=3 -s TOTAL_MEMORY=256000000 )
55+
set(EM_FLAGS_DEBUG -O2 -g -s USE_GLFW=3 -s TOTAL_MEMORY=256000000 )
5556

5657

5758
# Profiler compilation flags
@@ -99,11 +100,11 @@ endif()
99100
# Thus we do that here, making sure that there is no
100101
# call to add_flags() after.
101102

102-
add_flags_no_remove_duplicates(CMAKE_CXX_FLAGS_RELEASE ${EM_FLAGS})
103-
add_flags_no_remove_duplicates(CMAKE_C_FLAGS_RELEASE ${EM_FLAGS})
103+
add_flags_no_remove_duplicates(CMAKE_CXX_FLAGS_RELEASE ${EM_FLAGS_RELEASE})
104+
add_flags_no_remove_duplicates(CMAKE_C_FLAGS_RELEASE ${EM_FLAGS_RELEASE})
104105

105-
add_flags_no_remove_duplicates(CMAKE_CXX_FLAGS_DEBUG ${EM_FLAGS})
106-
add_flags_no_remove_duplicates(CMAKE_C_FLAGS_DEBUG ${EM_FLAGS})
106+
add_flags_no_remove_duplicates(CMAKE_CXX_FLAGS_DEBUG ${EM_FLAGS_DEBUG})
107+
add_flags_no_remove_duplicates(CMAKE_C_FLAGS_DEBUG ${EM_FLAGS_DEBUG})
107108

108109
# Reset the warning level for third parties
109110
function(vor_reset_warning_level)

src/lib/geogram/basic/attributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace GEO {
6363

6464
AttributeStoreCreator::~AttributeStoreCreator() {
6565
}
66-
66+
6767
/******************************************************************/
6868

6969
std::map<std::string, AttributeStoreCreator_var>

src/lib/geogram/basic/attributes.h

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
#include <geogram/basic/memory.h>
5252
#include <geogram/basic/numeric.h>
5353
#include <geogram/basic/process.h>
54+
#include <geogram/basic/geofile.h>
55+
#include <geogram/basic/logger.h>
5456
#include <map>
5557
#include <typeinfo>
5658
#include <set>
@@ -152,7 +154,8 @@ namespace GEO {
152154
* \return a pointer to the newly created AttributeStore
153155
*/
154156
virtual AttributeStore* create_attribute_store(index_t dimension) = 0;
155-
157+
158+
156159
private:
157160
std::string element_type_name_;
158161
std::string element_typeid_name_;
@@ -405,7 +408,6 @@ namespace GEO {
405408
create_attribute_store(dimension);
406409
}
407410

408-
409411
/**
410412
* \brief Gets an element type name from its mangled name
411413
* \param[in] element_typeid_name a const reference to a
@@ -437,7 +439,8 @@ namespace GEO {
437439

438440
/**
439441
* \brief Registers a new element type
440-
* \note One should use geo_register_attribute_type instead
442+
* \note Internal use function, one should use
443+
* geo_register_attribute_type instead
441444
* \param[in] creator a pointer to the AttributeStoreCreator
442445
* \param[in] element_type_name a const reference to a string with the
443446
* C++ type name of the elements
@@ -449,13 +452,23 @@ namespace GEO {
449452
const std::string& element_type_name,
450453
const std::string& element_typeid_name
451454
) {
452-
geo_assert(!element_type_name_is_known(element_type_name));
453-
geo_assert(!element_typeid_name_is_known(element_typeid_name));
455+
if(element_type_name_is_known(element_type_name)) {
456+
Logger::warn("Attributes") << element_type_name
457+
<< " already registered"
458+
<< std::endl;
459+
if(element_typeid_name_is_known(element_typeid_name)) {
460+
bool already_registered_attribute_has_same_type = (
461+
type_name_to_typeid_name_[element_type_name] ==
462+
element_typeid_name
463+
);
464+
geo_assert(already_registered_attribute_has_same_type);
465+
}
466+
}
454467
type_name_to_creator_[element_type_name] = creator;
455468
typeid_name_to_type_name_[element_typeid_name] = element_type_name;
456469
type_name_to_typeid_name_[element_type_name] = element_typeid_name;
457470
}
458-
471+
459472
protected:
460473
/**
461474
* \brief If size or base address differ from the
@@ -628,11 +641,20 @@ namespace GEO {
628641
* \brief geo_register_attribute_type constructor
629642
* \param[in] type_name a const reference to a string with
630643
* the C++ type name.
644+
* \details If the attribute is already registered with the same
645+
* \p type_name and same \p T, then a warning message is issued.
646+
* If the attribute is already registered with the same \p type_name
647+
* but a different \p T, then an assertion failure is triggered.
631648
*/
632649
geo_register_attribute_type(const std::string& type_name) {
633650
AttributeStore::register_attribute_creator(
634651
new TypedAttributeStoreCreator<T>, type_name, typeid(T).name()
635652
);
653+
GeoFile::register_ascii_attribute_serializer(
654+
type_name,
655+
read_ascii_attribute<T>,
656+
write_ascii_attribute<T>
657+
);
636658
}
637659
};
638660

src/lib/geogram/basic/common.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
#include <sstream>
5858
#include <iomanip>
5959

60+
#ifdef GEO_OS_EMSCRIPTEN
61+
#include <emscripten.h>
62+
#endif
63+
6064
namespace GEO {
6165

6266
void initialize() {
@@ -99,7 +103,25 @@ namespace GEO {
99103
geo_register_attribute_type<double>("double");
100104

101105
geo_register_attribute_type<vec2>("vec2");
102-
geo_register_attribute_type<vec3>("vec3");
106+
geo_register_attribute_type<vec3>("vec3");
107+
108+
#ifdef GEO_OS_EMSCRIPTEN
109+
110+
// This mounts the local file system when an emscripten-compiled
111+
// program runs in node.js.
112+
// Current working directory is mounted in /working,
113+
// and root directory is mounted in /root
114+
115+
EM_ASM(
116+
if(typeof module !== 'undefined' && this.module !== module) {
117+
FS.mkdir('/working');
118+
FS.mkdir('/root');
119+
FS.mount(NODEFS, { root: '.' }, '/working');
120+
FS.mount(NODEFS, { root: '/' }, '/root');
121+
}
122+
);
123+
#endif
124+
103125
}
104126

105127
void terminate() {

0 commit comments

Comments
 (0)