diff --git a/graf3d/g3d/src/X3DBuffer.c b/builtins/x3d/X3DBuffer.c similarity index 99% rename from graf3d/g3d/src/X3DBuffer.c rename to builtins/x3d/X3DBuffer.c index a90bcb309a9a1..886a61a25e8c5 100644 --- a/graf3d/g3d/src/X3DBuffer.c +++ b/builtins/x3d/X3DBuffer.c @@ -2,7 +2,7 @@ /* Author: Nenad Buncic 13/12/95*/ #include "X3DBuffer.h" -#include "../../x3d/src/X3DDefs.h" +#include "X3DDefs.h" #include #include diff --git a/builtins/x3d/X3DBuffer.h b/builtins/x3d/X3DBuffer.h new file mode 100644 index 0000000000000..879b2f5e96a8c --- /dev/null +++ b/builtins/x3d/X3DBuffer.h @@ -0,0 +1,41 @@ +/* Author: Nenad Buncic 13/12/95*/ + +/************************************************************************* + * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_X3DBuffer +#define ROOT_X3DBuffer + +typedef struct _x3d_data_ { + int numPoints; + int numSegs; + int numPolys; + float *points; /* x0, y0, z0, x1, y1, z1, ..... ..... .... */ + int *segs; /* c0, p0, q0, c1, p1, q1, ..... ..... .... */ + int *polys; /* c0, n0, s0, s1, ... sn, c1, n1, s0, ... sn */ +} X3DBuffer; + +typedef struct _x3d_sizeof_ { + int numPoints; + int numSegs; + int numPolys; +} Size3D; + +#ifdef __cplusplus +extern "C" int AllocateX3DBuffer (); +extern "C" void FillX3DBuffer (X3DBuffer *buff); +extern "C" Size3D* gFuncSize3D(); +#else +extern int AllocateX3DBuffer (); +extern void FillX3DBuffer (X3DBuffer *buff); +extern Size3D* gFuncSize3D(); +#endif + +#define gSize3D (*gFuncSize3D()) + +#endif diff --git a/graf3d/x3d/src/X3DDefs.h b/builtins/x3d/X3DDefs.h similarity index 98% rename from graf3d/x3d/src/X3DDefs.h rename to builtins/x3d/X3DDefs.h index a1c4df706fb57..deb30b982e5a6 100644 --- a/graf3d/x3d/src/X3DDefs.h +++ b/builtins/x3d/X3DDefs.h @@ -1,5 +1,3 @@ -/* @(#)root/g3d:$Id$ */ - /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * diff --git a/cmake/unix/module.modulemap b/cmake/unix/module.modulemap index 8dca6f5787f7f..0c013e9e85c54 100644 --- a/cmake/unix/module.modulemap +++ b/cmake/unix/module.modulemap @@ -45,14 +45,5 @@ module ROOT_Foundation_Stage1_NoRTTI { export * } -// We have a few c files scattered all over graf3d. We need to have a module -// which is built in C mode, to prevent trying to build the entire Graf3d module -// within a C context. -module "Graf3D.X3DBuffer.h_C" { - requires !cplusplus - header "X3DBuffer.h" - export * -} - // From this point on the contents of this file are automatically generated. @ROOT_GENERATED_MODULEMAP_CONTENT@ diff --git a/graf3d/g3d/CMakeLists.txt b/graf3d/g3d/CMakeLists.txt index 7fa08352593ac..cf37fc27ff589 100644 --- a/graf3d/g3d/CMakeLists.txt +++ b/graf3d/g3d/CMakeLists.txt @@ -27,10 +27,11 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Graf3d TPolyLine3D.cxx TPolyMarker3D.cxx TView3D.cxx - X3DBuffer.c DEPENDENCIES Gpad Graf Hist MathCore + LIBRARIES + x3d ) diff --git a/graf3d/g3d/inc/X3DBuffer.h b/graf3d/g3d/inc/X3DBuffer.h index 9b6b168e2e2b4..3fc4e4bbc9837 100644 --- a/graf3d/g3d/inc/X3DBuffer.h +++ b/graf3d/g3d/inc/X3DBuffer.h @@ -1,42 +1 @@ -/* @(#)root/g3d:$Id$ */ -/* Author: Nenad Buncic 13/12/95*/ - -/************************************************************************* - * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * - * All rights reserved. * - * * - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOT_X3DBuffer -#define ROOT_X3DBuffer - -typedef struct _x3d_data_ { - int numPoints; - int numSegs; - int numPolys; - float *points; /* x0, y0, z0, x1, y1, z1, ..... ..... .... */ - int *segs; /* c0, p0, q0, c1, p1, q1, ..... ..... .... */ - int *polys; /* c0, n0, s0, s1, ... sn, c1, n1, s0, ... sn */ -} X3DBuffer; - -typedef struct _x3d_sizeof_ { - int numPoints; - int numSegs; - int numPolys; -} Size3D; - -#ifdef __cplusplus -extern "C" int AllocateX3DBuffer (); -extern "C" void FillX3DBuffer (X3DBuffer *buff); -extern "C" Size3D* gFuncSize3D(); -#else -extern int AllocateX3DBuffer (); -extern void FillX3DBuffer (X3DBuffer *buff); -extern Size3D* gFuncSize3D(); -#endif - -#define gSize3D (*gFuncSize3D()) - -#endif +#include "../../../builtins/x3d/X3DBuffer.h" // for backward compatibility \ No newline at end of file diff --git a/graf3d/x3d/CMakeLists.txt b/graf3d/x3d/CMakeLists.txt index f48ee049ffe96..6f5a49f42f915 100644 --- a/graf3d/x3d/CMakeLists.txt +++ b/graf3d/x3d/CMakeLists.txt @@ -5,7 +5,7 @@ # For the list of contributors see $ROOTSYS/README/CREDITS. ############################################################################ -# CMakeLists.txt file for building ROOT graf3d/x3d package +# CMakeLists.txt file for building ROOT graf3d/x3d C++ package ############################################################################ ROOT_STANDARD_LIBRARY_PACKAGE(X3d @@ -15,17 +15,12 @@ ROOT_STANDARD_LIBRARY_PACKAGE(X3d SOURCES src/TViewerX3D.cxx src/TX3DFrame.cxx - ../../builtins/x3d/x3d.c LIBRARIES ${X11_LIBRARIES} + x3d DEPENDENCIES Graf3d Gui ) -# This ROOT package depends on a hard-coded builtin C library (x3d) that was forked in 1993 and slightly adapted for ROOT. See -# https://github.com/root-project/root/blob/852600061bcacd9b255d44f6312c96b6b1e00a2d/x3d/inc/x3d.h -# https://github.com/root-project/root/blob/852600061bcacd9b255d44f6312c96b6b1e00a2d/x3d/src/x3d.c -# vs http://hpux.connect.org.uk/hppd/hpux/X11/Viewers/x3d-2.2/ download source and rename from .tar.gz to just .tar - -target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR} src/ ../../builtins/x3d/) # src for src/X3DDefs.h, ../../builtins/x3d/ for x3d.h +target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR})