Skip to content

Commit eee36a4

Browse files
committed
partial fix after the latest commits
1 parent c629ef5 commit eee36a4

File tree

7 files changed

+66
-5
lines changed

7 files changed

+66
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ include(cmakemodules/script_wxwidgets.cmake REQUIRED) # Check for wxWidgets +
254254
include(cmakemodules/script_libdc1394.cmake REQUIRED) # Check for libdc1394-2
255255
include(cmakemodules/script_assimp.cmake REQUIRED) # Check for system assimp lib (3D models)
256256
include(cmakemodules/script_lib3ds.cmake REQUIRED) # Check for system lib3ds
257+
include(cmakemodules/script_liblas.cmake REQUIRED) # Check for the LAS LiDAR format library
257258
include(cmakemodules/script_libtclap.cmake REQUIRED) # Check for system libtclap
258259
include(cmakemodules/script_zlib.cmake REQUIRED) # Check for zlib
259260
include(cmakemodules/script_jpeg.cmake REQUIRED) # Check for jpeg

apps/SceneViewer3D/_DSceneViewerMain.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
#include <mrpt/opengl/CAngularObservationMesh.h> // It's in lib mrpt-maps
6565

6666
#include <mrpt/maps/CColouredPointsMap.h>
67+
#if MRPT_HAS_LIBLAS
68+
# include <mrpt/maps/CPointsMap_liblas.h>
69+
#endif
6770

6871
// A custom Art provider for customizing the icons:
6972
class MyArtProvider : public wxArtProvider

cmakemodules/script_liblas.cmake

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Check for the LAS (LiDAR format) library
2+
# ===================================================
3+
IF(UNIX)
4+
FIND_FILE(LAS_CONFIG_FILE liblas-config)
5+
IF(LAS_CONFIG_FILE)
6+
MARK_AS_ADVANCED(LAS_CONFIG_FILE)
7+
8+
SET(CMAKE_MRPT_HAS_LIBLAS 1)
9+
SET(CMAKE_MRPT_HAS_LIBLAS_SYSTEM 1)
10+
11+
# Get the config params:
12+
EXECUTE_PROCESS(COMMAND ${LAS_CONFIG_FILE} --libs
13+
RESULT_VARIABLE CMAKE_LAS_CONFIG_RES
14+
OUTPUT_VARIABLE CMAKE_LAS_LIBS
15+
OUTPUT_STRIP_TRAILING_WHITESPACE
16+
)
17+
IF(${CMAKE_LAS_CONFIG_RES})
18+
MESSAGE("Error invoking LAS config file:\n ${LAS_CONFIG_FILE} --libs")
19+
ENDIF(${CMAKE_LAS_CONFIG_RES})
20+
21+
EXECUTE_PROCESS(COMMAND ${LAS_CONFIG_FILE} --includes
22+
RESULT_VARIABLE CMAKE_LAS_CONFIG_RES
23+
OUTPUT_VARIABLE CMAKE_LAS_INCLUDES
24+
OUTPUT_STRIP_TRAILING_WHITESPACE
25+
)
26+
IF(${CMAKE_LAS_CONFIG_RES})
27+
MESSAGE("Error invoking LAS config file:\n ${LAS_CONFIG_FILE} --includes")
28+
ENDIF(${CMAKE_LAS_CONFIG_RES})
29+
30+
# Join all flags and parse to separate them:
31+
SET(CMAKE_LAS_CFGS "${CMAKE_LAS_LIBS} ${CMAKE_LAS_INCLUDES}")
32+
33+
pkgconfig_parse(${CMAKE_LAS_CFGS} "LAS")
34+
35+
# For some reason, "liblas-config --libs" return all other libs, except liblas itself:
36+
LIST(APPEND LAS_LIBS "las")
37+
38+
IF($ENV{VERBOSE})
39+
MESSAGE(STATUS "liblas configuration:")
40+
MESSAGE(STATUS " LAS_INCLUDE_DIRS: ${LAS_INCLUDE_DIRS}")
41+
MESSAGE(STATUS " LAS_LINK_DIRS: ${LAS_LINK_DIRS}")
42+
MESSAGE(STATUS " LAS_LIBS: ${LAS_LIBS}")
43+
ENDIF($ENV{VERBOSE})
44+
45+
ELSE(LAS_CONFIG_FILE)
46+
SET(CMAKE_MRPT_HAS_LIBLAS 0)
47+
ENDIF(LAS_CONFIG_FILE)
48+
ELSE(UNIX)
49+
# Windows: (Not supported for now)
50+
SET(CMAKE_MRPT_HAS_LIBLAS 0)
51+
ENDIF(UNIX)
52+

cmakemodules/script_show_final_summary.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ SHOW_CONFIG_LINE("Intel threading lib (TBB) " CMAKE_MRPT_HAS_TBB)
125125
SHOW_CONFIG_LINE_SYSTEM("lib3ds (3DStudio scenes) " CMAKE_MRPT_HAS_LIB3DS)
126126
SHOW_CONFIG_LINE_SYSTEM("libclang (for ConvertUTF) " CMAKE_MRPT_HAS_CLANG)
127127
SHOW_CONFIG_LINE_SYSTEM("libjpeg (jpeg) " CMAKE_MRPT_HAS_JPEG)
128+
SHOW_CONFIG_LINE_SYSTEM("liblas (ASPRS LAS LiDAR format) " CMAKE_MRPT_HAS_LIBLAS)
128129
SHOW_CONFIG_LINE("mexplus " CMAKE_MRPT_HAS_MATLAB)
129130
SHOW_CONFIG_LINE_SYSTEM("OpenCV (Image manipulation) " CMAKE_MRPT_HAS_OPENCV "[Version: ${MRPT_OPENCV_VERSION}]")
130131
SHOW_CONFIG_LINE_SYSTEM("OpenGL " CMAKE_MRPT_HAS_OPENGL_GLUT)

libs/maps/src/opengl/CAngularObservationMesh.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,13 @@ class FAddUntracedLines {
294294
CSetOfLinesPtr &lins;
295295
const CPoint3D &pDist;
296296
std::vector<double> pitchs;
297-
FAddUntracedLines(CSetOfLinesPtr &l,const CPoint3D &p,const vector<double> &pi):lins(l),pDist(p),pitchs() {
297+
FAddUntracedLines(CSetOfLinesPtr &l,const CPoint3D &p,const std::vector<double> &pi):lins(l),pDist(p),pitchs() {
298298
pitchs.reserve(pi.size());
299-
for (vector<double>::const_reverse_iterator it=pi.rbegin();it!=pi.rend();++it) pitchs.push_back(*it);
299+
for (std::vector<double>::const_reverse_iterator it=pi.rbegin();it!=pi.rend();++it) pitchs.push_back(*it);
300300
}
301301
void operator()(const CObservation2DRangeScan& obs) {
302302
size_t hm=obs.scan.size();
303-
for (vector<char>::const_iterator it=obs.validRange.begin();it!=obs.validRange.end();++it) if (*it) hm--;
303+
for (std::vector<char>::const_iterator it=obs.validRange.begin();it!=obs.validRange.end();++it) if (*it) hm--;
304304
lins->reserve(hm);
305305
for (size_t i=0;i<obs.scan.size();i++) if (!obs.validRange[i]) {
306306
double yaw=obs.aperture*((static_cast<double>(i)/static_cast<double>(obs.scan.size()-1))-0.5);

libs/opengl/src/COpenGLStandardObject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void COpenGLStandardObject::render_dl() const {
5959
for_each(vertices.begin(),vertices.end(),renderFunc);
6060
glEnd();
6161
} else {
62-
vector<TPoint3D>::const_iterator it=vertices.begin();
62+
std::vector<TPoint3D>::const_iterator it=vertices.begin();
6363
do {
6464
glBegin(type);
6565
for_each(it,it+chunkSize,renderFunc);
@@ -132,4 +132,4 @@ void COpenGLStandardObject::disable(_GLENUM flag)
132132
else ++it;
133133
}
134134
CRenderizableDisplayList::notifyChange();
135-
}
135+
}

parse-files/config.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ ${CMAKE_MRPT_BUILD_SHARED_LIB}
8383
#define MRPT_HAS_FTDI ${CMAKE_MRPT_HAS_FTDI}
8484
#define MRPT_FTDI_VERSION 0x${LIBFTDI_VERSION_MAJOR}${LIBFTDI_VERSION_MINOR}0
8585

86+
87+
/** Support for the liblas library (A standard for LiDAR data format) */
88+
#define MRPT_HAS_LIBLAS ${CMAKE_MRPT_HAS_LIBLAS}
89+
8690
/** wxWidgets is present in the system (required for UTILS::CDisplayWindow, etc.) */
8791
#define MRPT_HAS_WXWIDGETS ${CMAKE_MRPT_HAS_WXWIDGETS}
8892

0 commit comments

Comments
 (0)