Skip to content

Commit

Permalink
Merge pull request #1466 from SamFlt/cmake_system_include_dirs
Browse files Browse the repository at this point in the history
CMake system include dirs to ignore 3rd party warnings
  • Loading branch information
fspindle authored Sep 21, 2024
2 parents b2d0ca3 + 4ffa1ba commit 3981a8d
Show file tree
Hide file tree
Showing 39 changed files with 175 additions and 660 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/clapack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(NOT BUILD_SHARED_LIBS)
vp_install_target(${LAPACK_LIBRARY} EXPORT VISPModules ARCHIVE DESTINATION ${VISP_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()

if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))
if(MSVC AND NOT ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))
# Disable Visual C++ warnings
foreach(f ${lib_srcs})
vp_set_source_file_compile_flag(${f} /wd4244 /wd4267 /wd4273 /wd4554 /wd4723 /wd4996)
Expand Down
8 changes: 4 additions & 4 deletions 3rdparty/simdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if(X86 OR X86_64)
set(AVX_FLAG "")
set(AVX2_FLAG "")

if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))
if(MSVC AND NOT ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))
if(NOT MSVC64)
vp_check_compiler_flag(CXX "/arch:SSE2" HAVE_SSE2_FLAG "${VISP_SOURCE_DIR}/cmake/checks/cpu_sse2.cpp")
endif()
Expand Down Expand Up @@ -137,7 +137,7 @@ if(X86 OR X86_64)
set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Wno-missing-field-initializers")
endif()

if(MSVC AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))
if(MSVC AND ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))
# Clang under windows needs AVX flags
set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG} ${AVX2_FLAG}")
endif()
Expand Down Expand Up @@ -175,7 +175,7 @@ elseif(ARM OR AARCH64)
vp_check_compiler_flag(CXX "-Wno-switch" HAVE_NO_SWITCH_FLAG "${VISP_SOURCE_DIR}/cmake/checks/cpu_warning.cpp")

if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
if( NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER MATCHES "clang")))
if( NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")))
set(CXX_NEON_FLAG "-mfpu=neon -mfpu=neon-fp16")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
Expand All @@ -195,7 +195,7 @@ elseif(ARM OR AARCH64)
set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Wno-unused-command-line-argument")
endif()

if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER MATCHES "clang"))
if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
add_definitions(-DSIMD_NEON_FP16_DISABLE)
endif()

Expand Down
57 changes: 1 addition & 56 deletions cmake/AddExtraCompilationFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ if(BUILD_COVERAGE)
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
#if(NOT (WIN32 AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))))
add_extra_compiler_option(-fvisibility=hidden)
#endif()
add_extra_compiler_option(-fvisibility=hidden)

if(ENABLE_AVX AND X86_64)
add_extra_compiler_option(-mavx)
Expand Down Expand Up @@ -191,59 +189,6 @@ if(MSVC)
# Avoid build error C1128
list(APPEND VISP_EXTRA_CXX_FLAGS "/bigobj")
endif()
#if((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
# add_extra_compiler_option("-Wno-c++98-compat") # turn off warning due to json
# add_extra_compiler_option("-Wno-c++98-compat-pedantic")
# add_extra_compiler_option("-Wno-c11-extensions")
# add_extra_compiler_option("-Wno-covered-switch-default")
# add_extra_compiler_option("-Wno-unused-template") # turn off warning due to eigen
# add_extra_compiler_option("-Wno-deprecated-copy-with-dtor")
# add_extra_compiler_option("-Wno-anon-enum-enum-conversion") # turn off warning due to opencv
# add_extra_compiler_option("-Wno-cast-align")
# add_extra_compiler_option("-Wno-cast-qual")
# add_extra_compiler_option("-Wno-covered-switch-default")
# add_extra_compiler_option("-Wno-deprecated-copy-with-user-provided-dtor")
# add_extra_compiler_option("-Wno-documentation")
# add_extra_compiler_option("-Wno-documentation-deprecated-sync")
# add_extra_compiler_option("-Wno-documentation-unknown-command")
# add_extra_compiler_option("-Wno-double-promotion")
# add_extra_compiler_option("-Wno-enum-enum-conversion")
# add_extra_compiler_option("-Wno-exit-time-destructors")
# add_extra_compiler_option("-Wno-extra-semi")
# add_extra_compiler_option("-Wno-extra-semi-stmt")
# add_extra_compiler_option("-Wno-float-equal")
# add_extra_compiler_option("-Wno-implicit-int-float-conversion")
# add_extra_compiler_option("-Wno-implicit-float-conversion")
# add_extra_compiler_option("-Wno-inconsistent-missing-destructor-override")
# add_extra_compiler_option("-Wno-language-extension-token")
# add_extra_compiler_option("-Wno-microsoft-enum-value")
# add_extra_compiler_option("-Wno-newline-eof")
# add_extra_compiler_option("-Wno-old-style-cast")
# add_extra_compiler_option("-Wno-reserved-identifier")
# add_extra_compiler_option("-Wno-shift-sign-overflow")
# add_extra_compiler_option("-Wno-sign-conversion")
# add_extra_compiler_option("-Wno-undefined-reinterpret-cast")
# add_extra_compiler_option("-Wno-zero-as-null-pointer-constant")
# add_extra_compiler_option("-Wno-cast-function-type") # ViSP
# add_extra_compiler_option("-Wno-comma")
# add_extra_compiler_option("-Wno-deprecated-copy-dtor")
# add_extra_compiler_option("-Wno-deprecated-dynamic-exception-spec")
# add_extra_compiler_option("-Wno-format-nonliteral")
# add_extra_compiler_option("-Wno-global-constructors")
# add_extra_compiler_option("-Wno-implicit-int-conversion")
# add_extra_compiler_option("-Wno-implicit-fallthrough")
# add_extra_compiler_option("-Wno-missing-noreturn")
# add_extra_compiler_option("-Wno-missing-variable-declarations")
# add_extra_compiler_option("-Wno-missing-prototypes")
# add_extra_compiler_option("-Wno-nonportable-system-include-path")
# add_extra_compiler_option("-Wno-shadow")
# add_extra_compiler_option("-Wno-suggest-destructor-override")
# add_extra_compiler_option("-Wno-suggest-override")
# add_extra_compiler_option("-Wno-switch-enum")
# add_extra_compiler_option("-Wno-unreachable-code")
# add_extra_compiler_option("-Wno-unused-macros")
# add_extra_compiler_option("-Wno-unused-member-function")
#endif()
endif()

# adjust -Wl,-rpath-link
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindMyPanda3D.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ foreach(lib_name ${PANDA3D_LIBS})
endforeach()

find_path(Panda3D_INCLUDE_DIRS panda.h PATHS ${PANDA3D_INCLUDE_SEARCH_PATHS})
message(${Panda3D_INCLUDE_DIRS})

include(FindPackageHandleStandardArgs)
# Handle the QUIETLY and REQUIRED arguments and set the Panda3D_FOUND to TRUE
# if all listed variables are TRUE
Expand Down
4 changes: 4 additions & 0 deletions cmake/VISPGenerateConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ foreach(m ${VISP_MODULES_BUILD})
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_MODULE_${m}_LOCATION}/include")
endif()
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS})
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS})

endforeach()
vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE)

Expand Down Expand Up @@ -142,6 +144,7 @@ if(UNIX)
set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_INSTALL_PATH}/${VISP_INC_INSTALL_PATH}")
foreach(m ${VISP_MODULES_BUILD})
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS})
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS})
endforeach()
vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE)
endif()
Expand All @@ -162,6 +165,7 @@ if(WIN32)
set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_CONFIG_PATH}/${VISP_INC_INSTALL_PATH}")
foreach(m ${VISP_MODULES_BUILD})
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS})
list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS})
endforeach()
vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE)

Expand Down
36 changes: 29 additions & 7 deletions cmake/VISPModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ foreach(mod ${VISP_MODULES_BUILD} ${VISP_MODULES_DISABLED_USER} ${VISP_MODULES_D
unset(VISP_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE)
unset(VISP_MODULE_${mod}_LINK_DEPS CACHE)
unset(VISP_MODULE_${mod}_INC_DEPS CACHE)
unset(VISP_MODULE_${mod}_SYSTEM_INC_DEPS CACHE)
unset(VISP_MODULE_${mod}_WRAPPERS CACHE)
endforeach()

Expand Down Expand Up @@ -179,6 +180,7 @@ macro(vp_add_module _name)

set(VISP_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "")
set(VISP_MODULE_${the_module}_INC_DEPS "" CACHE INTERNAL "")
set(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS "" CACHE INTERNAL "")

# parse list of dependencies
if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS")
Expand Down Expand Up @@ -586,18 +588,26 @@ endfunction()

# setup include paths for the list of passed modules
macro(vp_target_include_modules target)
set(is_system "")
foreach(d ${ARGN})
if(d MATCHES "^visp_" AND HAVE_${d})
if("${d}" STREQUAL "SYSTEM")
set(is_system "SYSTEM")
elseif(d MATCHES "^visp_" AND HAVE_${d})
if (EXISTS "${VISP_MODULE_${d}_LOCATION}/include")
vp_target_include_directories(${target} "${VISP_MODULE_${d}_LOCATION}/include")
endif()
elseif(EXISTS "${d}")
# FS keep external deps inc
set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "")
vp_target_include_directories(${target} "${d}")
if(is_system)
set(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS "${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS};${d}" CACHE INTERNAL "")
else()
set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "")
endif()
vp_target_include_directories(${target} "${is_system}" "${d}")
endif()
endforeach()
vp_list_unique(VISP_MODULE_${the_module}_INC_DEPS)
vp_list_unique(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS)
endmacro()

# setup include paths for the list of passed modules and recursively add dependent modules
Expand Down Expand Up @@ -827,10 +837,22 @@ macro(_vp_create_module)
target_compile_definitions(${the_module} PRIVATE visp_EXPORTS)
endif()


set_property(TARGET ${the_module} APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS}
)
#set_property(TARGET ${the_module} APPEND PROPERTY
# # Here we need also to add system include dirs, otherwise they are missing
# INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS}
#)
#set_property(TARGET ${the_module} APPEND PROPERTY
# INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS}
#)
set(inc "${VISP_MODULE_${the_module}_INC_DEPS};${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS}")
if(NOT (CMAKE_VERSION VERSION_LESS "3.11.0")) # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1264 : eliminates "Cannot specify compile definitions for imported target" error message
target_include_directories(${the_module} SYSTEM INTERFACE "$<BUILD_INTERFACE:${inc}>")
else()
set_target_properties(${the_module} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${inc}>"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${inc}>"
)
endif()

# For dynamic link numbering convenions
if(NOT ANDROID)
Expand Down
40 changes: 32 additions & 8 deletions cmake/VISPUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,26 @@ endfunction()
# adds include directories in such way that directories from the ViSP source tree go first
function(vp_target_include_directories target)
set(__params "")
set(__system_params "")
set(__var_name __params)

foreach(dir ${ARGN})
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR})
# if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") # not compatible with cmake 2.8.12.2
if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}")
list(APPEND __params "${__abs_dir}")
elseif("${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}")
list(APPEND __params "${__abs_dir}")
if("${dir}" STREQUAL "SYSTEM")
set(__var_name __system_params)
else()
list(APPEND __params "${dir}")
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR})
# if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") # not compatible with cmake 2.8.12.2
if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}")
list(APPEND ${__var_name} "${__abs_dir}")
elseif("${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}")
list(APPEND ${__var_name} "${__abs_dir}")
else()
list(APPEND ${__var_name} "${dir}")
endif()
endif()
endforeach()

if(__params)
if(TARGET ${target})
target_include_directories(${target} PRIVATE ${__params})
Expand All @@ -202,6 +210,14 @@ function(vp_target_include_directories target)
set(VP_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "")
endif()
endif()
if(__system_params)
if(TARGET ${target})
target_include_directories(${target} SYSTEM PRIVATE ${__system_params})
else()
set(__new_inc "${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}};${__system_params}")
set(VP_TARGET_INCLUDE_SYSTEM_DIRS_${target} "${__new_inc}" CACHE INTERNAL "")
endif()
endif()
endfunction()

# clears all passed variables
Expand Down Expand Up @@ -776,10 +792,16 @@ function(vp_target_link_libraries target)
endfunction()

function(_vp_append_target_includes target)
# Only defined for visp_<module> targets
if(DEFINED VP_TARGET_INCLUDE_DIRS_${target})
target_include_directories(${target} PRIVATE ${VP_TARGET_INCLUDE_DIRS_${target}})
unset(VP_TARGET_INCLUDE_DIRS_${target} CACHE)
endif()
# Only defined for visp_<module> targets
if(DEFINED VP_TARGET_INCLUDE_SYSTEM_DIRS_${target})
target_include_directories(${target} SYSTEM PRIVATE ${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}})
unset(VP_TARGET_INCLUDE_SYSTEM_DIRS_${target} CACHE)
endif()
endfunction()

function(vp_add_executable target)
Expand Down Expand Up @@ -1621,6 +1643,8 @@ macro(vp_get_all_includes _includes_modules _includes_extra _system_include_dirs

foreach(m ${VISP_MODULES_BUILD})
list(APPEND ${_includes_extra} ${VISP_MODULE_${m}_INC_DEPS})
list(APPEND ${_includes_extra} ${VISP_MODULE_${m}_SYSTEM_INC_DEPS})

if(EXISTS "${VISP_MODULE_${m}_LOCATION}/include")
list(INSERT ${_includes_modules} 0 "${VISP_MODULE_${m}_LOCATION}/include")
endif()
Expand Down
29 changes: 8 additions & 21 deletions modules/ar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

# Add optional 3rd parties
set(opt_incs "")
set(opt_system_incs "")

set(opt_libs "")

if(USE_OGRE)
Expand All @@ -45,14 +47,14 @@ if(USE_OGRE)
mark_as_advanced(OGRE_SAMPLES_INCLUDEPATH)
#message("OGRE_SAMPLES_INCLUDEPATH: ${OGRE_SAMPLES_INCLUDEPATH}")
if(OGRE_SAMPLES_INCLUDEPATH)
list(APPEND opt_incs ${OGRE_SAMPLES_INCLUDEPATH})
list(APPEND opt_system_incs ${OGRE_SAMPLES_INCLUDEPATH})
endif()

# hack to fix possible presence of NOTFOUND in OGRE_INCLUDE_DIRS
#message("OGRE_INCLUDE_DIRS: ${OGRE_INCLUDE_DIRS}")
foreach(inc_ ${OGRE_INCLUDE_DIRS})
if(NOT ${inc_} MATCHES "NOTFOUND")
list(APPEND opt_incs ${inc_})
list(APPEND opt_system_incs ${inc_})
endif()
endforeach()
if(WIN32)
Expand All @@ -69,7 +71,7 @@ if(USE_OGRE)
endif(USE_OGRE)

if(USE_OIS AND USE_OGRE)
list(APPEND opt_incs ${OIS_INCLUDE_DIR})
list(APPEND opt_system_incs ${OIS_INCLUDE_DIR})
list(APPEND opt_libs ${OIS_LIBRARIES})
if(APPLE)
# With Ogre 1.7.4 and 1.8.1 to be able to link with libOIS.a, Cocoa framework is requested.
Expand Down Expand Up @@ -175,7 +177,8 @@ endif()

if(USE_PANDA3D)
if(Panda3D_INCLUDE_DIRS)
list(APPEND opt_incs ${Panda3D_INCLUDE_DIRS})
# Add Panda3D include dirs as system to avoid warnings due to Panda3D headers
list(APPEND opt_system_incs ${Panda3D_INCLUDE_DIRS})
endif()
if(Panda3D_LIBRARIES)
list(APPEND opt_libs ${Panda3D_LIBRARIES})
Expand All @@ -185,22 +188,6 @@ endif()
vp_add_module(ar visp_core)
vp_glob_module_sources()

if(USE_OGRE)
# Add specific build flag to turn off warnings coming from libogre and libois 3rd party
vp_set_source_file_compile_flag(src/ogre-simulator/vpAROgre.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register)
endif()

if(USE_PANDA3D)
set(PANDA3D_CXX_FLAGS -Wno-unused-parameter -Wno-unused-variable -Wno-extra -Wno-reorder-ctor)
set(PANDA3D_MODULE_SOURCES
vpPanda3DBaseRenderer.cpp vpPanda3DGeometryRenderer.cpp
vpPanda3DRGBRenderer.cpp vpPanda3DRenderParameters.cpp
vpPanda3DRendererSet.cpp vpPanda3DPostProcessFilter.cpp vpPanda3DCommonFilters.cpp
)
foreach(panda_src_name ${PANDA3D_MODULE_SOURCES})
vp_set_source_file_compile_flag(src/panda3d-simulator/${panda_src_name} ${PANDA3D_CXX_FLAGS})
endforeach()
endif()

vp_module_include_directories(${opt_incs})
vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs})
vp_create_module(${opt_libs})
1 change: 0 additions & 1 deletion modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ void vpPanda3DBaseRenderer::computeNearAndFarPlanesFromNode(const std::string &n
}
if (!fast) {
LPoint3 minP, maxP;
double t1 = vpTime::measureTimeMs();
object.calc_tight_bounds(minP, maxP);
const BoundingBox box(minP, maxP);
float minZ = std::numeric_limits<float>::max(), maxZ = 0.f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ void vpPanda3DGeometryRenderer::getRender(vpImage<vpRGBf> &normals, vpImage<floa

const unsigned top = static_cast<unsigned int>(std::max(0.0, bb.getTop()));
const unsigned left = static_cast<unsigned int>(std::max(0.0, bb.getLeft()));
const unsigned bottom = static_cast<unsigned int>(std::min(static_cast<double>(h), bb.getBottom()));
const unsigned right = static_cast<unsigned int>(std::min(static_cast<double>(w), bb.getRight()));
const unsigned numComponents = m_normalDepthTexture->get_num_components();
const unsigned rowIncrement = m_renderParameters.getImageWidth() * numComponents; // we ask for only 8 bits image, but we may get an rgb image
const float *data = (float *)(&(m_normalDepthTexture->get_ram_image().front()));
Expand Down
Loading

0 comments on commit 3981a8d

Please sign in to comment.