Skip to content

Commit

Permalink
Sync with 4094d77 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdumas authored Mar 7, 2024
1 parent ef5bfcf commit f55620c
Show file tree
Hide file tree
Showing 72 changed files with 3,630 additions and 827 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func_*.json
/_build
/_skbuild
/data
/docs/build
/docs/cpp/build

# Lagrange specifics
LagrangeOptions.cmake
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.19.0
6.20.0
2 changes: 1 addition & 1 deletion cmake/lagrange/lagrange_download_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function(lagrange_download_data)
PREFIX "${FETCHCONTENT_BASE_DIR}/lagrange-test-data"
SOURCE_DIR ${LAGRANGE_DATA_FOLDER}
GIT_REPOSITORY https://github.com/adobe/lagrange-test-data.git
GIT_TAG 4e5ed5c7bcbcae17d983d84c3e0c3ad9a95df6a4
GIT_TAG ff35c4eead91edc958b0baac165dff7f16c3ccc7
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion cmake/lagrange/lagrange_tbb_sanitizer.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023 Adobe. All rights reserved.
# Copyright 2024 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
9 changes: 5 additions & 4 deletions cmake/lagrange/lagrange_xcode_check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
return()
endif()

# Disabled for now, we need to fix the detection logic
return()

# Xcode 15's new linker will crash. We suggest either using the classical linker, or upgrading to Xcode 15.1.
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.1)
# AppleClang Compiler ID for Xcode 15.0 is 15.0.0.15000040
# AppleClang Compiler ID for Xcode 15.1 and 15.2 is 15.0.0.15000100
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0.0.15000040 AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0.15000100
)
# First let's check if we are using the classical linker
set(is_using_classical_linker FALSE)
foreach(type IN ITEMS EXE SHARED MODULE)
Expand Down
3 changes: 2 additions & 1 deletion docs/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ endforeach()
unset(DOXYGEN_INCLUDE_PATHS)
foreach(name IN ITEMS ${module_names})
list(APPEND DOXYGEN_INCLUDE_PATHS "modules/${name}/include")
list(APPEND DOXYGEN_INCLUDE_PATHS "modules/${name}/src")
endforeach()
list(JOIN DOXYGEN_INCLUDE_PATHS " " DOXYGEN_INCLUDE_PATHS)

Expand All @@ -60,7 +61,7 @@ set(DOXYGEN_WORKING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(DOXYGEN_INPUT_DIR modules)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR} CACHE PATH "Output base dir for doxygen documentation")
set(DOXYGEN_OUTPUT_HTML html CACHE STRING "Output subdir for doxygen html")
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
set(DOXYFILE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/header.html)

Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/Doxyfile.in → docs/cpp/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ MAX_INITIALIZER_LINES = 30
# list will mention the files that were used to generate the documentation.
# The default value is: YES.

SHOW_USED_FILES = NO
SHOW_USED_FILES = YES

# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
Expand Down
37 changes: 37 additions & 0 deletions modules/core/include/lagrange/Attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,34 @@ class Attribute : public AttributeBase
///
Attribute& operator=(const Attribute& other);

///
/// Cast copy operator. Creates an attribute by copying and casting values from another
/// attribute with a different ValueType. Will print a warning if the source and target value
/// types are identical.
///
/// @param[in] other The other attribute to copy & cast from.
///
/// @tparam OtherValue Value type for the other attribute.
///
/// @return A new attribute object whose values have been cast to the desired type.
///
template <typename OtherValue>
static Attribute cast_copy(const Attribute<OtherValue>& other);

///
/// Cast assignment operator. Replace the current attribute by copying and casting values from
/// another attribute with a different ValueType. Will print a warning if the source and target
/// value types are identical.
///
/// @param[in] other The other attribute to copy & cast from.
///
/// @tparam OtherValue Value type for the other attribute.
///
/// @return A reference to the assignment result.
///
template <typename OtherValue>
Attribute& cast_assign(const Attribute<OtherValue>& other);

///
/// Gets the attribute value type.
///
Expand Down Expand Up @@ -577,6 +605,13 @@ class Attribute : public AttributeBase

/// @}
protected:
protected:
/// @cond LA_INTERNAL_DOCS

/// It's ok to be friend with attributes of different types.
template <typename>
friend class Attribute;

///
/// Check whether the buffer can be grown to the new capacity. This check only applies to
/// external buffers. Depending on the attribute growth policy, an internal copy of the data may
Expand All @@ -602,6 +637,8 @@ class Attribute : public AttributeBase
///
void clear_views();

/// @endcond

protected:
/// Internal buffer storing the data (when the attribute is not external).
std::vector<ValueType> m_data;
Expand Down
27 changes: 14 additions & 13 deletions modules/core/include/lagrange/AttributeFwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <cstdint>
#include <limits>
#include <array>

namespace lagrange {

Expand Down Expand Up @@ -50,19 +51,19 @@ enum AttributeElement : int {
///
/// @todo Add skinning weights + others?
///
enum class AttributeUsage {
Vector, ///< Mesh attribute can have any number of channels (including 1 channel).
Scalar, ///< Mesh attribute must have exactly 1 channel.
Position, ///< Mesh attribute must have exactly dim channels.
Normal, ///< Mesh attribute can have dim or dim + 1 channels.
Tangent, ///< Mesh attribute can have dim or dim + 1 channels.
Bitangent, ///< Mesh attribute can have dim or dim + 1 channels.
Color, ///< Mesh attribute can have 1, 2, 3 or 4 channels.
UV, ///< Mesh attribute must have exactly 2 channels.
VertexIndex, ///< Single channel integer attribute indexing a mesh vertex.
FacetIndex, ///< Single channel integer attribute indexing a mesh facet.
CornerIndex, ///< Single channel integer attribute indexing a mesh corner.
EdgeIndex, ///< Single channel integer attribute indexing a mesh edge.
enum class AttributeUsage : uint16_t {
Vector = (1 << 0), ///< Mesh attribute can have any number of channels (including 1 channel).
Scalar = (1 << 1), ///< Mesh attribute must have exactly 1 channel.
Position = (1 << 2), ///< Mesh attribute must have exactly dim channels.
Normal = (1 << 3), ///< Mesh attribute can have dim or dim + 1 channels.
Tangent = (1 << 4), ///< Mesh attribute can have dim or dim + 1 channels.
Bitangent = (1 << 5), ///< Mesh attribute can have dim or dim + 1 channels.
Color = (1 << 6), ///< Mesh attribute can have 1, 2, 3 or 4 channels.
UV = (1 << 7), ///< Mesh attribute must have exactly 2 channels.
VertexIndex = (1 << 8), ///< Single channel integer attribute indexing a mesh vertex.
FacetIndex = (1 << 9), ///< Single channel integer attribute indexing a mesh facet.
CornerIndex = (1 << 10), ///< Single channel integer attribute indexing a mesh corner.
EdgeIndex = (1 << 11), ///< Single channel integer attribute indexing a mesh edge.
};

/// Identified to be used to access an attribute. Attribute names are mapped to a unique identified
Expand Down
Loading

0 comments on commit f55620c

Please sign in to comment.