Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed supported code for clang. fix build options for macos system #62

Merged
merged 2 commits into from
Jul 13, 2022
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 include/interaction/Simulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <glm/glm.hpp>

#include "PointOfInterests.h"
#include <list>

enum ANIMATION_STATE
{
Expand Down
12 changes: 8 additions & 4 deletions libs/Texture/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ int Texture::Load2DTexture()

int Texture::Load3DTexture(const std::vector<std::string> &paths)
{
#if (!defined(__APPLE__))
if (paths.size() == 0)
{
assert(false && "no paths to load from");
Expand All @@ -63,7 +64,7 @@ int Texture::Load3DTexture(const std::vector<std::string> &paths)
// load and format each image
for (int i = 0; i < paths.size(); ++i)
{
BYTE *bits(0);
unsigned char *bits(0);
int bbp = 0;
if (!LoadTexture(paths[i], width, height, &bits, bbp))
{
Expand Down Expand Up @@ -104,6 +105,11 @@ int Texture::Load3DTexture(const std::vector<std::string> &paths)
glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
// Return the ID of the texture we just created
return textureID;
#endif

assert("3D textures no supported on this System");

return 0;
}

int Texture::LoadTexture(const std::string &fileName,
Expand All @@ -127,15 +133,13 @@ int Texture::LoadTexture(const std::string &fileName,
if (data)
{
if (bbp == 3)
{
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, *data);
}
else if (bbp == 4)
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, *data);
}


}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/interaction/LabelsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void LabelsManager::add(std::string &texture_path, float x, float y, float z, fl
glm::vec3 line_end(x, y, textPosZ + 200);
unsigned int line_vba = create_line_vba(line_start, line_end);

LabelBillboard billboard = {line_vba, m_texture_cache[texture_path], m_plane_model, glm::vec3(x, y, textPosZ + offset), volume};
LabelBillboard billboard = {line_vba, m_texture_cache[texture_path], m_plane_model, glm::vec3(x, y, textPosZ + offset), (unsigned int)volume};
m_billboard_labels.push_back(billboard);

m_position.push_back(glm::vec3(x, y, z));
Expand Down
2 changes: 2 additions & 0 deletions src/interaction/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ void Simulation::update_simulation()
animation_button_label = "Animate";
m_controller_app.set_app_mode(MANUAL);
m_timeline.resetTime();
#if (!defined(__APPLE__))
if (m_controller_app.get_movie_state() == MOVIE_RECORD)
{
m_controller_app.stop_movie();
}
#endif
Comment on lines +66 to +71
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you essentially turning off some features that don't work on Mac? I would indicate any OS differences in the README

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. I'll add this to the readme.

}
}

Expand Down
2 changes: 1 addition & 1 deletion src/vrapp/VRVolumeApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void VRVolumeApp::set_description(int descriptionHeight, std::string &descriptio

void VRVolumeApp::set_mesh(int volume_id, std::string &mesh_file_path, std::string &texture_file_path)
{
MeshData mesh_data = {volume_id - 1, mesh_file_path, texture_file_path};
MeshData mesh_data = {(unsigned int)volume_id - 1, mesh_file_path, texture_file_path};
m_mesh_models_data.push_back(mesh_data);
m_models_MV.push_back(glm::mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1));
}
Expand Down
35 changes: 19 additions & 16 deletions superbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ if (UNIX)
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++17 -pthread")
endif (UNIX)

#add_definitions(-D_CRT_SECURE_NO_WARNINGS)

set(DEFAULT_BUILD_COMMAND cmake -G "${CMAKE_GENERATOR}" . )

if(NOT CMAKE_BUILD_TYPE )
Expand Down Expand Up @@ -163,6 +161,14 @@ execute_process( COMMAND ${CMAKE_COMMAND}

ENDIF()

find_package(MinVR REQUIRED)
if(MinVR_FOUND)
message(STATUS "MinVR found")
message(STATUS "MinVR_INCLUDE_DIR ${MinVR_INCLUDE_DIR}")
else()
message(STATUS "MINNVR NOT found" )
endif()

find_package(GLEW REQUIRED)
if(GLEW_FOUND)
message(STATUS "glew found")
Expand Down Expand Up @@ -315,7 +321,7 @@ execute_process(

#CCPFS
# Configure external project
IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/CPPFSD/CPPFSD)
#IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/CPPFSD/CPPFSD)
execute_process(
COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
Expand All @@ -332,7 +338,7 @@ execute_process(
)


ENDIF()
#ENDIF()


#opencv
Expand Down Expand Up @@ -364,13 +370,7 @@ if(ZLIB_FOUND)
message(STATUS "ZLIB NOT found" )
endif()

find_package(MinVR REQUIRED)
if(MinVR_FOUND)
message(STATUS "MinVR found")
message(STATUS "MinVR_INCLUDE_DIR ${MinVR_INCLUDE_DIR}")
else()
message(STATUS "MINNVR NOT found" )
endif()


find_package(ImguiVR REQUIRED)
if(IMGUIVR_FOUND)
Expand Down Expand Up @@ -422,19 +422,22 @@ if(OpenCV_FOUND)
message(STATUS "OpenCV found ${_OpenCV_LIB_PATH}")
message(STATUS "OpenCV found ${OpenCV_INSTALL_PATH}")
if(WIN32)
message(STATUS "OpenCV for Windows")
set(OPENCV_PATH ${_OpenCV_LIB_PATH} )
set(OPENCV_SUFIX "460" )
set(DEBUG_SUFFIX ${CMAKE_DEBUG_SUFFIX})
elseif(APPLE)
message(STATUS "OpenCV for APPLE")
set(OPENCV_PATH "${CMAKE_BINARY_DIR}/install_${CMAKE_SYSTEM_NAME}/lib")
set(OPENCV_PREFIX "lib" )
unset(DEBUG_SUFFIX)
set(DEBUG_SUFFIX "")
#set(OPENCV_SUFIX "4.5.3" )
endif()

file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_videoio${OPENCV_SUFIX}${CMAKE_DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" )
file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_imgcodecs${OPENCV_SUFIX}${CMAKE_DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" )
file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_imgproc${OPENCV_SUFIX}${CMAKE_DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" )
file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_core${OPENCV_SUFIX}${CMAKE_DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" )
file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_videoio${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" )
file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_imgcodecs${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" )
file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_imgproc${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" )
file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_core${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" )

endif()

Expand Down
1 change: 1 addition & 0 deletions superbuild/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ macro(build_CPPFSD_subproject)
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DBUILD_SHARED_LIBS=OFF
-DOPTION_BUILD_TESTS=OFF
${BUILD_SUBPROJECT_BUILD_ARGS}
BUILD_COMMAND ${DEFAULT_BUILD_COMMAND}
BUILD_ALWAYS OFF
Expand Down