Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/coin3d/sogtk
Browse files Browse the repository at this point in the history
  • Loading branch information
VolkerEnderlein committed Nov 20, 2023
2 parents 052b558 + 1fc92f6 commit d139484
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,15 @@ check_cxx_source_compiles("
#include <Inventor/VRMLnodes/SoVRMLViewpoint.h>
int main() { SoVRMLViewpoint * p = new SoVRMLViewpoint; return 0; }
" HAVE_SOVRMLVIEWPOINT)
check_cxx_source_compiles("
#include <Inventor/SbColorRGBA.h>
int main() { SbColorRGBA c; return 0; }
" HAVE_SBCOLORRGBA_H)
check_cxx_source_compiles("
#include <Inventor/SbColorRGBA.h>
#include <Inventor/SoSceneManager.h>
int main() { SoSceneManager * p = new SoSceneManager; SbColorRGBA c = p->getBackgroundColorRGBA(); return 0; }
" HAVE_SOSCENEMANAGER_GETBACKGROUNDCOLORRGBA)

unset(CMAKE_REQUIRED_LIBRARIES)

Expand Down
14 changes: 12 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ configure_file(config.h.cmake.in config.h)
# This is pulled from the subrepo SoGui.
add_subdirectory(Inventor/${Gui}/common)

set(COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Inventor/${Gui}/common)

configure_file(${COMMON_DIR}/SoAnyMaterialList.cpp.in ${CMAKE_BINARY_DIR}/src/Inventor/${Gui}/SoAnyMaterialList.cpp)
configure_file(${COMMON_DIR}/SoAnyMaterialList.h.in ${CMAKE_BINARY_DIR}/src/Inventor/${Gui}/SoAnyMaterialList.h)
configure_file(${COMMON_DIR}/SoGuiMaterialList.h.in ${CMAKE_BINARY_DIR}/src/Inventor/${Gui}/So${Gui}MaterialList.h)
configure_file(${COMMON_DIR}/SoAnyMaterialListBuiltins.cpp.in ${CMAKE_BINARY_DIR}/src/Inventor/${Gui}/SoAnyMaterialListBuiltins.cpp)


file(GLOB_RECURSE COMMON_HDRS ${CMAKE_CURRENT_BINARY_DIR}/*.h)
file(GLOB_RECURSE COMMON_SRCS ${CMAKE_CURRENT_BINARY_DIR}/*.cpp)


set(HDRS
#Inventor/${Gui}/So${Gui}Clipboard.h # added
Inventor/${Gui}/So${Gui}ComponentP.h
Expand All @@ -28,7 +37,7 @@ set(SRCS
Inventor/${Gui}/So${Gui}Component.cpp
Inventor/${Gui}/So${Gui}GLWidget.cpp
Inventor/${Gui}/So${Gui}GraphEditor.cpp #added
# Inventor/${Gui}/So${Gui}MaterialList.cpp #added
Inventor/${Gui}/So${Gui}MaterialList.cpp #added
Inventor/${Gui}/So${Gui}Roster.cpp #added
Inventor/${Gui}/devices/So${Gui}Device.cpp
Inventor/${Gui}/devices/So${Gui}InputFocus.cpp
Expand All @@ -44,10 +53,11 @@ set(SRCS
)

file(GLOB_RECURSE COMMON_RESOURCES ${CMAKE_BINARY_DIR}/data/materials/*.h)

include_directories(AFTER ${CMAKE_BINARY_DIR}/data)
include_directories(${GTK2_INCLUDE_DIRS})
include_directories(${GTK_GL2_INCLUDE_DIRS})


if(HAVE_JOYSTICK_LINUX)
list(APPEND HDRS Inventor/${Gui}/devices/So${Gui}LinuxJoystick.h)
list(APPEND SRCS Inventor/${Gui}/devices/So${Gui}LinuxJoystick.cpp)
Expand Down
6 changes: 6 additions & 0 deletions src/config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1

/* Define to 1 if you have the <Inventor/SbColorRGBA.h> header file. */
#cmakedefine HAVE_SBCOLORRGBA_H 1

/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H 1

Expand All @@ -62,6 +65,9 @@
/* define if pthread's struct timespec uses nsecs and not usecs */
#cmakedefine HAVE_PTHREAD_TIMESPEC_NSEC 1

/* Define to enable use of Inventor feature */
#cmakedefine HAVE_SOSCENEMANAGER_GETBACKGROUNDCOLORRGBA 1

/* Define to enable use of Inventor feature */
#cmakedefine HAVE_SBIMAGE_ADDREADIMAGECB 1

Expand Down
2 changes: 2 additions & 0 deletions test-code/components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
executable(graphed SOURCES graphed.cpp computils.cpp LIBS SoGtk)

executable(planeviewer SOURCES planeviewer.cpp computils.cpp LIBS SoGtk)

executable(materiallist SOURCES materiallist.cpp LIBS SoGtk)
55 changes: 55 additions & 0 deletions test-code/components/materiallist.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**************************************************************************\
* Copyright (c) Kongsberg Oil & Gas Technologies AS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\**************************************************************************/

#include <Inventor/Gtk/SoGtk.h>
#include <Inventor/Gtk/SoGtkMaterialList.h>

// *************************************************************************

int
main(
int argc,
char ** argv )
{
GtkWidget * window = SoGtk::init( argv[0] );

SoGtkMaterialList * grapheditor = new SoGtkMaterialList;
grapheditor->show();

SoGtk::mainLoop();

delete grapheditor;

return 0;
} // main()

// *************************************************************************

0 comments on commit d139484

Please sign in to comment.