Kaydet (Commit) 191f0944 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Handle collada libraries seperately: --disable-collada

Depends on gltf support.

Change-Id: Ief0452da3d03b0ddbca45272e5f5cd268691aeca
üst 74797294
...@@ -3373,6 +3373,8 @@ endef ...@@ -3373,6 +3373,8 @@ endef
endif # SYSTEN_LIBGLTF endif # SYSTEN_LIBGLTF
ifeq ($(ENABLE_COLLADA),TRUE)
define gb_LinkTarget__use_opencollada_parser define gb_LinkTarget__use_opencollada_parser
$(call gb_LinkTarget_set_include,$(1),\ $(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADABaseUtils/include \ -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADABaseUtils/include \
...@@ -3403,7 +3405,9 @@ $(call gb_LinkTarget_use_static_libraries,$(1),\ ...@@ -3403,7 +3405,9 @@ $(call gb_LinkTarget_use_static_libraries,$(1),\
) )
endef endef
endif endif # ENABLE_COLLADA
endif # ENABLE_GLTF
### Jars ############################################################ ### Jars ############################################################
......
...@@ -52,7 +52,7 @@ $(eval $(call gb_Library_add_exception_objects,avmedia,\ ...@@ -52,7 +52,7 @@ $(eval $(call gb_Library_add_exception_objects,avmedia,\
)) ))
endif endif
ifneq (,$(filter COLLADA2GLTF,$(BUILD_TYPE))) ifeq ($(ENABLE_COLLADA),TRUE)
$(eval $(call gb_Library_set_warnings_not_errors,avmedia)) $(eval $(call gb_Library_set_warnings_not_errors,avmedia))
ifeq ($(OS),LINUX) ifeq ($(OS),LINUX)
...@@ -68,9 +68,6 @@ $(eval $(call gb_Library_use_externals,avmedia,\ ...@@ -68,9 +68,6 @@ $(eval $(call gb_Library_use_externals,avmedia,\
png \ png \
)) ))
$(eval $(call gb_Library_add_defs,avmedia,\
-DENABLE_COLLADA2GLTF \
))
endif endif
$(eval $(call gb_Library_add_exception_objects,avmedia,\ $(eval $(call gb_Library_add_exception_objects,avmedia,\
......
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#ifdef ENABLE_COLLADA2GLTF #include <config_features.h>
#if HAVE_FEATURE_COLLADA
#include <COLLADA2GLTFWriter.h> #include <COLLADA2GLTFWriter.h>
#include <GLTFAsset.h> #include <GLTFAsset.h>
#endif #endif
...@@ -42,7 +44,7 @@ using namespace boost::property_tree; ...@@ -42,7 +44,7 @@ using namespace boost::property_tree;
namespace avmedia { namespace avmedia {
#ifdef ENABLE_COLLADA2GLTF #if HAVE_FEATURE_COLLADA
static void lcl_UnzipKmz(const OUString& rSourceURL, const OUString& rOutputFolderURL, OUString& o_rDaeFileURL) static void lcl_UnzipKmz(const OUString& rSourceURL, const OUString& rOutputFolderURL, OUString& o_rDaeFileURL)
{ {
...@@ -241,7 +243,8 @@ bool Embed3DModel( const uno::Reference<frame::XModel>& xModel, ...@@ -241,7 +243,8 @@ bool Embed3DModel( const uno::Reference<frame::XModel>& xModel,
const OUString& rSourceURL, OUString& o_rEmbeddedURL) const OUString& rSourceURL, OUString& o_rEmbeddedURL)
{ {
OUString sSource = rSourceURL; OUString sSource = rSourceURL;
#ifdef ENABLE_COLLADA2GLTF
#if HAVE_FEATURE_COLLADA
if( !rSourceURL.endsWithIgnoreAsciiCase(".json") ) if( !rSourceURL.endsWithIgnoreAsciiCase(".json") )
KmzDae2Gltf(rSourceURL, sSource); KmzDae2Gltf(rSourceURL, sSource);
#endif #endif
......
...@@ -112,6 +112,7 @@ export ENABLE_COINMP=@ENABLE_COINMP@ ...@@ -112,6 +112,7 @@ export ENABLE_COINMP=@ENABLE_COINMP@
export SYSTEM_COINMP=@SYSTEM_COINMP@ export SYSTEM_COINMP=@SYSTEM_COINMP@
export COINMP_CFLAGS=@COINMP_CFLAGS@ export COINMP_CFLAGS=@COINMP_CFLAGS@
export COINMP_LIBS=@COINMP_LIBS@ export COINMP_LIBS=@COINMP_LIBS@
export ENABLE_COLLADA=@ENABLE_COLLADA@
export ENABLE_CRASHDUMP=@ENABLE_CRASHDUMP@ export ENABLE_CRASHDUMP=@ENABLE_CRASHDUMP@
export ENABLE_CUPS=@ENABLE_CUPS@ export ENABLE_CUPS=@ENABLE_CUPS@
export ENABLE_CURL=@ENABLE_CURL@ export ENABLE_CURL=@ENABLE_CURL@
......
...@@ -142,4 +142,9 @@ ...@@ -142,4 +142,9 @@
*/ */
#define HAVE_FEATURE_GLTF 0 #define HAVE_FEATURE_GLTF 0
/*
* Whether we have COLLADA support.
*/
#define HAVE_FEATURE_COLLADA 0
#endif #endif
...@@ -1438,6 +1438,10 @@ AC_ARG_ENABLE(gltf, ...@@ -1438,6 +1438,10 @@ AC_ARG_ENABLE(gltf,
AS_HELP_STRING([--disable-gltf], AS_HELP_STRING([--disable-gltf],
[Determines whether to build libraries related to glTF 3D model rendering.])) [Determines whether to build libraries related to glTF 3D model rendering.]))
AC_ARG_ENABLE(collada,
AS_HELP_STRING([--disable-collada],
[Disable collada support (Rendering 3D models stored in *.dae and *.kmz format).]))
dnl =================================================================== dnl ===================================================================
dnl Optional Packages (--with/without-) dnl Optional Packages (--with/without-)
dnl =================================================================== dnl ===================================================================
...@@ -10640,10 +10644,6 @@ if test "x$enable_gltf" != "xno" -a $_os != iOS -a $_os != Android; then ...@@ -10640,10 +10644,6 @@ if test "x$enable_gltf" != "xno" -a $_os != iOS -a $_os != Android; then
else else
BUILD_TYPE="$BUILD_TYPE LIBGLTF" BUILD_TYPE="$BUILD_TYPE LIBGLTF"
fi fi
# otherwise build fails in collada2gltf external because of std::shared_ptr
if test "$have_std_shared_ptr" = "yes"; then
BUILD_TYPE="$BUILD_TYPE COLLADA2GLTF"
fi
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
...@@ -10652,6 +10652,21 @@ AC_SUBST(SYSTEM_LIBGLTF) ...@@ -10652,6 +10652,21 @@ AC_SUBST(SYSTEM_LIBGLTF)
AC_SUBST(LIBGLTF_CFLAGS) AC_SUBST(LIBGLTF_CFLAGS)
AC_SUBST(LIBGLTF_LIBS) AC_SUBST(LIBGLTF_LIBS)
dnl ===================================================================
dnl Check whether to enable COLLADA support
dnl ===================================================================
AC_MSG_CHECKING([whether to enable COLLADA support])
ENABLE_COLLADA=
if test "$enable_collada" != "no" -a "$ENABLE_GLTF" = "TRUE" -a "$have_std_shared_ptr" = "yes"; then
AC_MSG_RESULT([yes])
ENABLE_COLLADA=TRUE
AC_DEFINE(HAVE_FEATURE_COLLADA,1)
BUILD_TYPE="$BUILD_TYPE COLLADA2GLTF"
else
AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_COLLADA)
# pdf import? # pdf import?
AC_MSG_CHECKING([whether to build the PDF import feature]) AC_MSG_CHECKING([whether to build the PDF import feature])
ENABLE_PDFIMPORT= ENABLE_PDFIMPORT=
......
...@@ -14,9 +14,13 @@ ...@@ -14,9 +14,13 @@
#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XModel.hpp>
#include <avmedia/avmediadllapi.h> #include <avmedia/avmediadllapi.h>
#include <config_features.h>
namespace avmedia { namespace avmedia {
#if HAVE_FEATURE_COLLADA
bool KmzDae2Gltf(const OUString& rSourceURL, OUString& o_rOutput); bool KmzDae2Gltf(const OUString& rSourceURL, OUString& o_rOutput);
#endif
bool AVMEDIA_DLLPUBLIC Embed3DModel( bool AVMEDIA_DLLPUBLIC Embed3DModel(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel,
......
...@@ -784,10 +784,19 @@ void FuInsert3DModel::DoExecute( SfxRequest& ) ...@@ -784,10 +784,19 @@ void FuInsert3DModel::DoExecute( SfxRequest& )
sfx2::FileDialogHelper aDlg( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); sfx2::FileDialogHelper aDlg( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
aDlg.SetTitle( "Insert 3D Model" ); aDlg.SetTitle( "Insert 3D Model" );
#if HAVE_FEATURE_COLLADA
aDlg.AddFilter( "All supported formats", "*.json; *.dae; *.kmz" ); aDlg.AddFilter( "All supported formats", "*.json; *.dae; *.kmz" );
#else
aDlg.AddFilter( "All supported formats", "*.json" );
#endif
aDlg.AddFilter( "JSON - GL Transmission Format", "*.json" ); aDlg.AddFilter( "JSON - GL Transmission Format", "*.json" );
#if HAVE_FEATURE_COLLADA
aDlg.AddFilter( "DAE - COLLADA", "*.dae" ); aDlg.AddFilter( "DAE - COLLADA", "*.dae" );
aDlg.AddFilter( "KMZ - Keyhole Markup language Zipped", "*.kmz" ); aDlg.AddFilter( "KMZ - Keyhole Markup language Zipped", "*.kmz" );
#endif
OUString sURL; OUString sURL;
if( aDlg.Execute() == ERRCODE_NONE ) if( aDlg.Execute() == ERRCODE_NONE )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment