Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
merge develop into master

See merge request Scientific-IT-Systems/gr!941
  • Loading branch information
jheinen committed Nov 9, 2022
2 parents 5d7f4fd + 25cf336 commit 2ffade8
Show file tree
Hide file tree
Showing 129 changed files with 2,498 additions and 1,561 deletions.
394 changes: 192 additions & 202 deletions .gitlab-ci.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 3rdparty/bzip2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ endif

CFLAGS = -O -I. -fPIC -fno-common $(ARCHS)
ifeq ($(shell uname),Darwin)
CFLAGS += -mmacosx-version-min=10.11
CFLAGS += -mmacosx-version-min=10.14
endif
OBJS = blocksort.o \
huffman.o \
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/cairo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
VERSION = 1.16.0
CAIRO_EXTRA_CONFIGURE_FLAGS ?=
ifeq ($(shell uname),Darwin)
CAIRO_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.11
CAIRO_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/ffmpeg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
VERSION = 4.2.1
FFMPEG_EXTRA_CONFIGURE_FLAGS ?=
ifeq ($(shell uname),Darwin)
FFMPEG_EXTRA_CONFIGURE_FLAGS += --extra-cflags=-mmacosx-version-min=10.11
FFMPEG_EXTRA_CONFIGURE_FLAGS += --extra-cflags=-mmacosx-version-min=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/freetype/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FTINCLUDES = -Isrc -Iinclude
FTCFLAGS = -O -fPIC -fno-common $(FTINCLUDES) $(FTDEFINES) $(ARCHS)

ifeq ($(shell uname -s),Darwin)
FTCFLAGS += -mmacosx-version-min=10.11
FTCFLAGS += -mmacosx-version-min=10.14
endif

OBJS = \
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/glfw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
VERSION = 3.3.3
GLFW_EXTRA_CMAKE_FLAGS ?=
ifeq ($(shell uname),Darwin)
GLFW_EXTRA_CMAKE_FLAGS += -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11
GLFW_EXTRA_CMAKE_FLAGS += -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/jpeg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
CFLAGS = -O -I. -fPIC -fno-common $(ARCHS)
ifeq ($(shell uname),Darwin)
ifneq ($(notdir $(CC)),emcc)
CFLAGS += -mmacosx-version-min=10.11
CFLAGS += -mmacosx-version-min=10.14
endif
endif
OBJS = \
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libpng16/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
PNGCFLAGS = -O -I. -I../zlib/ -fPIC -fno-common $(PNG_EXTRA_CFLAGS) $(ARCHS)
ifeq ($(shell uname),Darwin)
ifneq ($(notdir $(CC)),emcc)
PNGCFLAGS += -mmacosx-version-min=10.11
PNGCFLAGS += -mmacosx-version-min=10.14
ifeq ($(shell arch),arm64)
PNGCFLAGS += -DPNG_ARM_NEON_OPT=0
endif
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/ogg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
VERSION = 1.3.2
OGG_EXTRA_CONFIGURE_FLAGS ?=
ifeq ($(shell uname),Darwin)
OGG_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.11
OGG_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/openh264/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
VERSION = 2.0.0
OPENH264_EXTRA_MAKE_FLAGS ?=
ifeq ($(shell uname),Darwin)
OPENH264_EXTRA_MAKE_FLAGS += CFLAGS=-mmacosx-version-min=10.11
OPENH264_EXTRA_MAKE_FLAGS += CFLAGS=-mmacosx-version-min=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/pixman/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
VERSION = 0.40.0
PIXMAN_EXTRA_CONFIGURE_FLAGS ?=
ifeq ($(shell uname),Darwin)
PIXMAN_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.11
PIXMAN_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/qhull/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
CFLAGS = -O -fPIC -fno-common $(ARCHS)
ifeq ($(shell uname),Darwin)
ifneq ($(notdir $(CC)),emcc)
CFLAGS += -mmacosx-version-min=10.11
CFLAGS += -mmacosx-version-min=10.14
endif
endif
LIBS = libqhull.a
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/theora/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION = 1.1.1
THEORA_CONFIGURE ?= ./configure
THEORA_EXTRA_CONFIGURE_FLAGS ?=
ifeq ($(shell uname),Darwin)
THEORA_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.11
THEORA_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/tiff/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
VERSION = 4.0.10
TIFF_EXTRA_CONFIGURE_FLAGS ?=
ifeq ($(shell uname),Darwin)
TIFF_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.11
TIFF_EXTRA_CONFIGURE_FLAGS += CFLAGS=-mmacosx-version-min=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/vpx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
VERSION = 1.4.0
VPX_EXTRA_CONFIGURE_FLAGS ?=
ifeq ($(shell uname),Darwin)
VPX_EXTRA_CONFIGURE_FLAGS += --extra-cflags=-mmacosx-version-min=10.11
VPX_EXTRA_CONFIGURE_FLAGS += --extra-cflags=-mmacosx-version-min=10.14
endif

ifeq ($(DOWNLOAD_CMD),)
Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/zeromq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ $(PREFIX)/src/zeromq-$(VERSION)/Makefile: $(PREFIX)/src/zeromq-$(VERSION)/config
$(ZEROMQ_EXTRA_CONFIGURE_FLAGS)

$(PREFIX)/lib/libzmq.a: $(PREFIX)/src/zeromq-$(VERSION)/Makefile
MACOSX_DEPLOYMENT_TARGET="10.11" $(MAKE) -C $(PREFIX)/src/zeromq-$(VERSION) -j4
MACOSX_DEPLOYMENT_TARGET="10.11" $(MAKE) -C $(PREFIX)/src/zeromq-$(VERSION) install
MACOSX_DEPLOYMENT_TARGET="10.14" $(MAKE) -C $(PREFIX)/src/zeromq-$(VERSION) -j4
MACOSX_DEPLOYMENT_TARGET="10.14" $(MAKE) -C $(PREFIX)/src/zeromq-$(VERSION) install

install: $(PREFIX)/lib/libzmq.a

Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/zlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
CFLAGS=-O -fPIC -DHAVE_HIDDEN $(ARCHS)
ifeq ($(shell uname),Darwin)
ifneq ($(notdir $(CC)),emcc)
CFLAGS += -mmacosx-version-min=10.11
CFLAGS += -mmacosx-version-min=10.14
endif
endif
LIBS=libz.a
Expand Down
64 changes: 30 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -455,34 +455,24 @@ elseif(NOT OpenGL_FOUND)
endif()

set(GRM_SOURCES
lib/grm/args.c
lib/grm/base64.c
lib/grm/dump.c
lib/grm/dynamic_args_array.c
lib/grm/error.c
lib/grm/event.c
lib/grm/interaction.c
lib/grm/json.c
lib/grm/logging.c
lib/grm/memwriter.c
lib/grm/net.c
lib/grm/plot.c
lib/grm/util.c
lib/grm/datatype/double_map.c
lib/grm/datatype/string_array_map.c
lib/grm/datatype/string_list.c
lib/grm/datatype/string_map.c
lib/grm/datatype/uint_map.c
)

set(GRM_SUBDIR_HEADERS
lib/grm/args.h
lib/grm/dump.h
lib/grm/event.h
lib/grm/interaction.h
lib/grm/net.h
lib/grm/plot.h
lib/grm/util.h
lib/grm/src/grm/args.c
lib/grm/src/grm/base64.c
lib/grm/src/grm/dump.c
lib/grm/src/grm/dynamic_args_array.c
lib/grm/src/grm/error.c
lib/grm/src/grm/event.c
lib/grm/src/grm/interaction.c
lib/grm/src/grm/json.c
lib/grm/src/grm/logging.c
lib/grm/src/grm/memwriter.c
lib/grm/src/grm/net.c
lib/grm/src/grm/plot.cxx
lib/grm/src/grm/util.c
lib/grm/src/grm/datatype/double_map.c
lib/grm/src/grm/datatype/string_array_map.c
lib/grm/src/grm/datatype/string_list.c
lib/grm/src/grm/datatype/string_map.c
lib/grm/src/grm/datatype/uint_map.c
)

add_library(grm_static STATIC ${GRM_SOURCES})
Expand All @@ -506,15 +496,21 @@ foreach(LIBRARY grm_static grm_shared grm_shared_internal)
endif()
target_include_directories(
${LIBRARY}
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/grm/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/grm/include/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/grm/src/> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_options(${LIBRARY} PRIVATE ${COMPILER_OPTION_ERROR_IMPLICIT})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(${LIBRARY} PRIVATE /permissive-)
endif()
set_target_properties(
${LIBRARY}
PROPERTIES C_STANDARD 90
C_EXTENSIONS OFF
C_STANDARD_REQUIRED ON
CXX_STANDARD 17
CXX_EXTENSIONS OFF
CXX_STANDARD_REQUIRED ON
POSITION_INDEPENDENT_CODE ON
C_VISIBILITY_PRESET hidden
INSTALL_RPATH "${INSTALL_RPATH}"
Expand Down Expand Up @@ -1100,8 +1096,8 @@ if(GR_BUILD_DEMOS)
target_compile_options(grdemo PRIVATE ${COMPILER_OPTION_ERROR_IMPLICIT})
set_target_properties(grdemo PROPERTIES C_STANDARD 90 C_EXTENSIONS OFF C_STANDARD_REQUIRED ON)

add_subdirectory(lib/grm/test/public_api grm_test_public_api)
add_subdirectory(lib/grm/test/internal_api grm_test_internal_api)
add_subdirectory(lib/grm/test/public_api/grm grm_test_public_api)
add_subdirectory(lib/grm/test/internal_api/grm grm_test_internal_api)
endif()

if(GR_INSTALL)
Expand Down Expand Up @@ -1233,8 +1229,8 @@ if(GR_INSTALL)
BUNDLE DESTINATION Applications
)
endif()
install(FILES lib/gr/gr.h lib/gks/gks.h lib/gr3/gr3.h lib/grm/grm.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/)
install(FILES ${GRM_SUBDIR_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/grm/)
install(FILES lib/gr/gr.h lib/gks/gks.h lib/gr3/gr3.h lib/grm/include/grm.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/)
install(DIRECTORY lib/grm/include/grm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/)
if(TARGET qt4gr
OR TARGET qt5gr
OR TARGET qt6gr
Expand Down
48 changes: 48 additions & 0 deletions examples/isosurface.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <stdlib.h>
#include <math.h>
#include "gr3.h"
#include "gr.h"

static void ellipsoid_data(int nx, int ny, int nz, float rx, float ry, float rz, float *data, int stride_x,
int stride_y, int stride_z)
{
int ix, iy, iz;

for (ix = 0; ix < nx; ix += 1)
{
float x = (2.0 * ix / (nx - 1) - 1.0) / rx;
for (iy = 0; iy < nx; iy += 1)
{
float y = (2.0 * iy / (ny - 1) - 1.0) / ry;
for (iz = 0; iz < nx; iz += 1)
{
float z = (2.0 * iz / (nz - 1) - 1.0) / rz;
int index = stride_x * ix + stride_y * iy + stride_z * iz;
data[index] = sqrt(x * x + y * y + z * z);
}
}
}
}

int main(void)
{
int i;
int nx = 20;
int ny = 20;
int nz = 20;
int stride_x = nz * ny;
int stride_y = nz;
int stride_z = 1;
float *data = malloc(nx * ny * nz * sizeof(float));

gr_setviewport(0, 1, 0, 1);
for (i = 0; i < 150; i++)
{
ellipsoid_data(nx, ny, nz, 1.5, 1.0, sin(i * 0.05) * 0.5 + 1.0, data, stride_x, stride_y, stride_z);
gr_clearws();
gr_setspace3d(40, 60, 0, 2.5);
gr_axes3d(0.5, 0.5, 0.5, -1, -1, -1, 2, 2, 2, 0.007);
gr3_isosurface(nx, ny, nz, data, 0.5, NULL, NULL);
gr_updatews();
}
}
Loading

0 comments on commit 2ffade8

Please sign in to comment.