Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ java/*.so
java/*dll

*.log
.vs/
12 changes: 11 additions & 1 deletion native/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ if (APPLE)
set(CMAKE_INSTALL_RPATH "@rpath;/usr/local/lib;/opt/homebrew/lib;/opt/local/lib")
endif ()

if(MSVC)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
add_compile_options(/EHsc /utf-8)
add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR=1)
add_compile_options(/wd4996 /wd4530)
else()

if (NOT PDAL_BUILD)
set(CMAKE_CXX_FLAGS "-std=c++14")
endif()

endif()

# Setup JNI
find_package(JNI REQUIRED)
if (JNI_FOUND)
Expand Down Expand Up @@ -69,4 +79,4 @@ else ()
add_library(${LIB_NAME} SHARED ${LIB_SRC})
install(TARGETS ${LIB_NAME} LIBRARY DESTINATION . OPTIONAL)
target_link_libraries(${LIB_NAME} PRIVATE ${PDAL_LIB_NAME})
endif ()
endif ()
5 changes: 5 additions & 0 deletions native/src/include/JavaPipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
#undef tolower
#undef isspace

#ifndef PDAL_DLL
# define PDAL_DLL PDAL_EXPORT
#endif // !PDAL_DLL


using pdal::point_count_t;

namespace libpdaljava
Expand Down
8 changes: 4 additions & 4 deletions native/src/io_pdal_PointView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ JNIEXPORT jdoubleArray JNICALL Java_io_pdal_PointView_rasterizeTriangularMesh___

double determinant = (v2y - v3y) * (v1x - v3x) + (v3x - v2x) * (v1y - v3y);

double ymin = std::min(v1y, std::min(v2y, v3y));
double ymax = std::max(v1y, std::max(v2y, v3y));
double ymin = (std::min)(v1y, (std::min)(v2y, v3y));
double ymax = (std::max)(v1y, (std::max)(v2y, v3y));

double scanrow0 = std::max(std::ceil((ymin - eymin) / h - 0.5), 0.0);
double scanrow0 = (std::max)(std::ceil((ymin - eymin) / h - 0.5), 0.0);
double scany = eymin + scanrow0 * h + h / 2.0;

while (scany <= eymax && scany <= ymax)
Expand Down Expand Up @@ -370,7 +370,7 @@ JNIEXPORT jdoubleArray JNICALL Java_io_pdal_PointView_rasterizeTriangularMesh___
}
}

double scancol0 = std::max(std::ceil((xmin - exmin) / w - 0.5), 0.0);
double scancol0 = (std::max)(std::ceil((xmin - exmin) / w - 0.5), 0.0);
double scanx = exmin + scancol0 * w + w / 2;

while (scanx <= exmax && scanx <= xmax)
Expand Down
Loading