Skip to content
Closed
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
2 changes: 1 addition & 1 deletion graf3d/g3d/src/X3DBuffer.c → builtins/x3d/X3DBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* Author: Nenad Buncic 13/12/95*/

#include "X3DBuffer.h"
#include "../../x3d/src/X3DDefs.h"
#include "X3DDefs.h"
#include <stdio.h>
#include <stdlib.h>

Expand Down
41 changes: 41 additions & 0 deletions builtins/x3d/X3DBuffer.h
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions graf3d/x3d/src/X3DDefs.h → builtins/x3d/X3DDefs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* @(#)root/g3d:$Id$ */

/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
Expand Down
9 changes: 0 additions & 9 deletions cmake/unix/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -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@
3 changes: 2 additions & 1 deletion graf3d/g3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Graf3d
TPolyLine3D.cxx
TPolyMarker3D.cxx
TView3D.cxx
X3DBuffer.c
DEPENDENCIES
Gpad
Graf
Hist
MathCore
LIBRARIES
x3d
)
43 changes: 1 addition & 42 deletions graf3d/g3d/inc/X3DBuffer.h
Original file line number Diff line number Diff line change
@@ -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
11 changes: 3 additions & 8 deletions graf3d/x3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})
Loading