From 5ee9bed590b760813a43f5154635bfc6aa630dc3 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Fri, 19 Feb 2016 22:53:09 +0200 Subject: [PATCH 1/5] CMakeLists.txt for IfcMax. Tested with VS 2015 and 3ds Max + SDK 2016 --- README.md | 3 +- cmake/CMakeLists.txt | 8 ++++ src/ifcmax/CMakeLists.txt | 39 ++++++++++++++++ src/ifcmax/IfcMax.cpp | 96 +++++++++++++++++++++------------------ src/ifcmax/IfcMax.def | 8 ---- src/ifcmax/IfcMax.h | 8 +--- win/build-deps.cmd | 1 - win/readme.md | 3 +- win/run-cmake.bat | 3 +- 9 files changed, 107 insertions(+), 62 deletions(-) create mode 100644 src/ifcmax/CMakeLists.txt delete mode 100644 src/ifcmax/IfcMax.def diff --git a/README.md b/README.md index 10d03630a1..069ab3f3ec 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ Dependencies * [SWIG](http://www.swig.org/), [Python](https://www.python.org/) libraries - *optional* For building the IfcOpenShell Python interface and the Blender add-on * 3ds Max SDK - *optional* - For building the 3ds Max plug-in + For building the 3ds Max plug-in. + All recent versions of 3ds Max (2014 and newer) are 64-bit only, so a 64-bit installation is assumed. Compiling on Windows diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 71963665ca..27e71cb278 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -29,6 +29,7 @@ OPTION(USE_IFC4 "Use IFC 4 instead of IFC 2x3 (full rebuild recommended when swi OPTION(BUILD_IFCPYTHON "Build IfcPython." ON) OPTION(BUILD_EXAMPLES "Build example applications." ON) OPTION(USE_VLD "Use Visual Leak Detector for debugging memory leaks, MSVC-only." OFF) +OPTION(BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." OFF) # TODO QtViewer is deprecated ATM as it uses the 0.4 API # OPTION(BUILD_QTVIEWER "Build IfcOpenShell Qt GUI Viewer (requires Qt 4 framework)." OFF) @@ -48,6 +49,9 @@ UNIFY_ENVVARS_AND_CACHE(OPENCOLLADA_INCLUDE_DIR) UNIFY_ENVVARS_AND_CACHE(OPENCOLLADA_LIBRARY_DIR) UNIFY_ENVVARS_AND_CACHE(PCRE_LIBRARY_DIR) UNIFY_ENVVARS_AND_CACHE(PYTHON_EXECUTABLE) +IF(WIN32) + UNIFY_ENVVARS_AND_CACHE(THREEDS_MAX_SDK_HOME) +ENDIF() # Find Boost IF(MSVC) @@ -419,6 +423,10 @@ IF(BUILD_EXAMPLES) ADD_SUBDIRECTORY(../src/examples examples) ENDIF() +IF(BUILD_IFCMAX) + ADD_SUBDIRECTORY(../src/ifcmax ifcmax) +ENDIF() + # CMake installation targets INSTALL(FILES ${IFCPARSE_H_FILES} DESTINATION include/ifcparse) INSTALL(FILES ${IFCGEOM_H_FILES} DESTINATION include/ifcgeom) diff --git a/src/ifcmax/CMakeLists.txt b/src/ifcmax/CMakeLists.txt new file mode 100644 index 0000000000..923532b073 --- /dev/null +++ b/src/ifcmax/CMakeLists.txt @@ -0,0 +1,39 @@ +################################################################################ +# # +# This file is part of IfcOpenShell. # +# # +# IfcOpenShell is free software: you can redistribute it and/or modify # +# it under the terms of the Lesser GNU General Public License as published by # +# the Free Software Foundation, either version 3.0 of the License, or # +# (at your option) any later version. # +# # +# IfcOpenShell is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# Lesser GNU General Public License for more details. # +# # +# You should have received a copy of the Lesser GNU General Public License # +# along with this program. If not, see . # +# # +################################################################################ + +INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${OCC_INCLUDE_DIR} ${OPENCOLLADA_INCLUDE_DIRS} ${ICU_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} ${THREEDS_MAX_SDK_HOME}/include +) + +# All recent versions of 3ds Max (2014 and newer) are 64-bit only so assume lib/x64 directory +LINK_DIRECTORIES(${LINK_DIRECTORIES} ${IfcOpenShell_BINARY_DIR} ${OCC_LIBRARY_DIR} ${OPENCOLLADA_LIBRARY_DIR} + ${ICU_LIBRARY_DIR} ${Boost_LIBRARY_DIRS} ${THREEDS_MAX_SDK_HOME}/lib/x64/Release +) + +ADD_LIBRARY(IfcMax SHARED IfcMax.h IfcMax.cpp) + +TARGET_LINK_LIBRARIES(IfcMax IfcParse IfcGeom Comctl32.lib zlibdll.lib bmm.lib core.lib CustDlg.lib edmodel.lib expr.lib + flt.lib geom.lib gfx.lib gup.lib imageViewers.lib ManipSys.lib maxnet.lib Maxscrpt.lib + maxutil.lib MenuMan.lib menus.lib mesh.lib MNMath.lib Paramblk2.lib particle.lib Poly.lib RenderUtil.lib + tessint.lib viewfile.lib ${OPENCASCADE_LIBRARIES} +) + +SET_TARGET_PROPERTIES(IfcMax PROPERTIES SUFFIX ".dli") + +INSTALL(TARGETS IfcMax RUNTIME DESTINATION bin) diff --git a/src/ifcmax/IfcMax.cpp b/src/ifcmax/IfcMax.cpp index dde5cc8547..46bf0f39f8 100644 --- a/src/ifcmax/IfcMax.cpp +++ b/src/ifcmax/IfcMax.cpp @@ -20,49 +20,54 @@ #include #include -#include #include #include -#include "../ifcmax/IfcMax.h" +#include "IfcMax.h" #include "../ifcgeom/IfcGeomIterator.h" static const int NUM_MATERIAL_SLOTS = 24; -int controlsInit = false; - -BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { +BOOL WINAPI DllMain(HINSTANCE /*hinstDLL*/, ULONG /*fdwReason*/, LPVOID /*lpvReserved*/) { + static int controlsInit = false; if (!controlsInit) { controlsInit = true; InitCommonControls(); - } - return true; + } + return TRUE; } -__declspec( dllexport ) const TCHAR* LibDescription() { - return _T("IfcOpenShell IFC Importer"); -} - -__declspec( dllexport ) int LibNumberClasses() { return 1; } - -static class IFCImpClassDesc:public ClassDesc { +static class IFCImpClassDesc :public ClassDesc { public: - int IsPublic() {return 1;} - void * Create(BOOL loading = FALSE) {return new IFCImp;} - const TCHAR * ClassName() {return _T("IFCImp");} - SClass_ID SuperClassID() {return SCENE_IMPORT_CLASS_ID;} - Class_ID ClassID() {return Class_ID(0x3f230dbf, 0x5b3015c2);} - const TCHAR* Category() {return _T("Chrutilities");} + int IsPublic() { return 1; } + void * Create(BOOL /*loading = FALSE*/) { return new IFCImp; } + // TODO Delete() function? + const TCHAR * ClassName() { return _T("IFCImp"); } + SClass_ID SuperClassID() { return SCENE_IMPORT_CLASS_ID; } + Class_ID ClassID() { return Class_ID(0x3f230dbf, 0x5b3015c2); } + const TCHAR* Category() { return _T("Chrutilities"); } } IFCImpDesc; -__declspec( dllexport ) ClassDesc* LibClassDesc(int i) { - return i == 0 ? &IFCImpDesc : 0; +#define DLLEXPORT __declspec(dllexport) + +extern "C" { + +DLLEXPORT const TCHAR* LibDescription() { + return _T("IfcOpenShell IFC Importer"); } -__declspec( dllexport ) ULONG LibVersion() { - return VERSION_3DSMAX; +DLLEXPORT int LibNumberClasses() { return 1; } + +DLLEXPORT ClassDesc* LibClassDesc(int i) { + return i == 0 ? &IFCImpDesc : 0; } +DLLEXPORT ULONG LibVersion() { + return VERSION_3DSMAX; +} + +} // extern "C" + int IFCImp::ExtCount() { return 1; } const TCHAR * IFCImp::Ext(int n) { @@ -82,7 +87,7 @@ const TCHAR * IFCImp::AuthorName() { } const TCHAR * IFCImp::CopyrightMessage() { - return _T("Copyight (c) 2011 IfcOpenShell"); + return _T("Copyright (c) 2011-2016 IfcOpenShell"); } const TCHAR * IFCImp::OtherMessage1() { @@ -97,13 +102,14 @@ unsigned int IFCImp::Version() { return 12; } -static BOOL CALLBACK AboutBoxDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - return TRUE; -} +// TODO Use this in IFCImp::ShowAbout() if/when wanted +//static BOOL CALLBACK AboutBoxDlgProc(HWND /*hWnd*/, UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/) { +// return TRUE; +//} -void IFCImp::ShowAbout(HWND hWnd) {} +void IFCImp::ShowAbout(HWND /*hWnd*/) {} -DWORD WINAPI fn(LPVOID arg) { return 0; } +DWORD WINAPI fn(LPVOID /*arg*/) { return 0; } #if MAX_RELEASE > 14000 # define S(x) (TSTR::FromCStr(x.c_str())) @@ -113,8 +119,9 @@ DWORD WINAPI fn(LPVOID arg) { return 0; } # define S(x) (CStr(x.c_str())) #endif -Mtl* FindMaterialByName(MtlBaseLib* library, const std::string& material_name) { - const int mat_index = library->FindMtlByName(S(material_name)); +static Mtl* FindMaterialByName(MtlBaseLib* library, const std::string& material_name) { + TSTR mat_name = S(material_name); + const int mat_index = library->FindMtlByName(mat_name); Mtl* m = 0; if (mat_index != -1) { m = static_cast((*library)[mat_index]); @@ -122,7 +129,7 @@ Mtl* FindMaterialByName(MtlBaseLib* library, const std::string& material_name) { return m; } -Mtl* FindOrCreateMaterial(MtlBaseLib* library, Interface* max_interface, int& slot, const IfcGeom::Material& material) { +static Mtl* FindOrCreateMaterial(MtlBaseLib* library, Interface* max_interface, int& slot, const IfcGeom::Material& material) { Mtl* m = FindMaterialByName(library, material.name()); if (m == 0) { StdMat2* stdm = NewDefaultStdMat(); @@ -136,10 +143,10 @@ Mtl* FindOrCreateMaterial(MtlBaseLib* library, Interface* max_interface, int& sl stdm->SetSpecular(Color(specular[0], specular[1], specular[2]),t); } if (material.hasSpecularity()) { - stdm->SetShininess(material.specularity(), t); + stdm->SetShininess((float)material.specularity(), t); } if (material.hasTransparency()) { - stdm->SetOpacity(1.0 - material.transparency(), t); + stdm->SetOpacity(1.0f - (float)material.transparency(), t); } m = stdm; m->SetName(S(material.name())); @@ -151,7 +158,10 @@ Mtl* FindOrCreateMaterial(MtlBaseLib* library, Interface* max_interface, int& sl return m; } -Mtl* ComposeMultiMaterial(std::map, Mtl*>& multi_mats, MtlBaseLib* library, Interface* max_interface, int& slot, const std::vector& materials, const std::string& object_type, const std::vector& material_ids) { +static Mtl* ComposeMultiMaterial(std::map, Mtl*>& multi_mats, MtlBaseLib* library, + Interface* max_interface, int& slot, const std::vector& materials, + const std::string& object_type, const std::vector& material_ids) +{ std::vector material_names; bool needs_default = std::find(material_ids.begin(), material_ids.end(), -1) != material_ids.end(); if (needs_default) { @@ -184,7 +194,7 @@ Mtl* ComposeMultiMaterial(std::map, Mtl*>& multi_mats, return i->second; } MultiMtl* multi_mat = NewDefaultMultiMtl(); - multi_mat->SetNumSubMtls(material_names.size()); + multi_mat->SetNumSubMtls((int)material_names.size()); int mtl_id = 0; if (needs_default) { multi_mat->SetSubMtlAndName(mtl_id ++, default_material, default_material->GetName()); @@ -201,7 +211,7 @@ Mtl* ComposeMultiMaterial(std::map, Mtl*>& multi_mats, return multi_mat; } -int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc, BOOL suppressPrompts) { +int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc, BOOL /*suppressPrompts*/) { IfcGeom::IteratorSettings settings; settings.use_world_coords() = false; @@ -217,7 +227,7 @@ int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc, #endif IfcGeom::Iterator iterator(settings, fn_mb); - + delete fn_mb; if (!iterator.initialize()) return false; itfc->ProgressStart(_T("Importing file..."), TRUE, fn, NULL); @@ -237,12 +247,12 @@ int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc, TriObject* tri = CreateNewTriObject(); - const int numVerts = o->geometry().verts().size()/3; + const int numVerts = (int)o->geometry().verts().size()/3; tri->mesh.setNumVerts(numVerts); for( int i = 0; i < numVerts; i ++ ) { tri->mesh.setVert(i,o->geometry().verts()[3*i+0],o->geometry().verts()[3*i+1],o->geometry().verts()[3*i+2]); } - const int numFaces = o->geometry().faces().size()/3; + const int numFaces = (int)o->geometry().faces().size()/3; tri->mesh.setNumFaces(numFaces); bool needs_default = std::find(o->geometry().material_ids().begin(), o->geometry().material_ids().end(), -1) != o->geometry().material_ids().end(); @@ -274,7 +284,7 @@ int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc, tri->mesh.faces[i].setVerts(v1, v2, v3); tri->mesh.faces[i].setEdgeVisFlags(b1, b2, b3); - MtlID mtlid = o->geometry().material_ids()[i]; + MtlID mtlid = (MtlID)o->geometry().material_ids()[i]; if (needs_default) { mtlid ++; } @@ -310,4 +320,4 @@ int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc, itfc->ProgressEnd(); return true; -} \ No newline at end of file +} diff --git a/src/ifcmax/IfcMax.def b/src/ifcmax/IfcMax.def deleted file mode 100644 index 03d30e4b97..0000000000 --- a/src/ifcmax/IfcMax.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY ifcmax.dli -EXPORTS - LibDescription @1 - LibNumberClasses @2 - LibClassDesc @3 - LibVersion @4 -SECTIONS - .data READ WRITE \ No newline at end of file diff --git a/src/ifcmax/IfcMax.h b/src/ifcmax/IfcMax.h index d144f9c777..19a89d9da0 100644 --- a/src/ifcmax/IfcMax.h +++ b/src/ifcmax/IfcMax.h @@ -21,12 +21,6 @@ #define IFCMAX_H #include "Max.h" -#include "istdplug.h" -#include "stdmat.h" -#include "decomp.h" -#include "shape.h" -#include "splshape.h" -#include "dummy.h" extern ClassDesc* GetIFCImpDesc(); @@ -38,7 +32,7 @@ public: const TCHAR * LongDesc(); // = "IfcOpenShell IFC Importer for 3ds Max" const TCHAR * ShortDesc(); // = "Industry Foundation Classes" const TCHAR * AuthorName(); // = "Thomas Krijnen" - const TCHAR * CopyrightMessage(); // = "Copyight (c) 2011 IfcOpenShell" + const TCHAR * CopyrightMessage(); // = "Copyright (c) 2011-2016 IfcOpenShell" const TCHAR * OtherMessage1(); // = "" const TCHAR * OtherMessage2(); // = "" unsigned int Version(); // = 12 diff --git a/win/build-deps.cmd b/win/build-deps.cmd index d7d8b44b35..974b578134 100644 --- a/win/build-deps.cmd +++ b/win/build-deps.cmd @@ -434,4 +434,3 @@ echo - https://www.visualstudio.com/ echo 5. Run this batch script with Visual Studio environment variables set. echo - https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx echo. -REM TODO 3ds Max SDK instructions? diff --git a/win/readme.md b/win/readme.md index dd85e652e0..6497d0ba4c 100644 --- a/win/readme.md +++ b/win/readme.md @@ -40,7 +40,8 @@ After this, one can build the project using the `IfcOpenShell.sln` file in the b if wanted. Convenience batch files `build-ifcopenshell.cmd` and `install-ifcopenshell.cmd` can also be used. The batch files expect `%1` and `%2` in same fashion as above and possible extra parameters are passed for the `MSBuild` call. The project will be installed to `installed-vs-\` folder in the project's root folder and the required IfcOpenShell-Python -parts are deployed to the `\Lib\site-packages\` folder. +parts are deployed to the `\Lib\site-packages\` folder. The 3ds Max plug-in, IfcMax.dli, needs to be copied manually +to the 3ds Max's `plugins` folder. **Note:** All of the dependencies are build as static libraries against the static run-time allowing the developer to effortlessly deploy standalone IFCOS binaries. diff --git a/win/run-cmake.bat b/win/run-cmake.bat index 1c2865d723..e29fd6dd65 100644 --- a/win/run-cmake.bat +++ b/win/run-cmake.bat @@ -59,7 +59,7 @@ set PYTHON_LIBRARY=%PYTHONHOME%\libs\python%PY_VER_MAJOR_MINOR%.lib set PYTHON_EXECUTABLE=%PYTHONHOME%\python.exe set SWIG_DIR=%INSTALL_DIR%\swigwin set PATH=%PATH%;%SWIG_DIR%;%PYTHONHOME% -:: TODO 3ds Max SDK? +set THREEDS_MAX_SDK_HOME=C:\Program Files\Autodesk\3ds Max 2016 SDK\maxsdk echo. call cecho.cmd 0 10 "Script configuration:" @@ -80,6 +80,7 @@ echo PYTHON_INCLUDE_DIR = %PYTHON_INCLUDE_DIR% echo PYTHON_LIBRARY = %PYTHON_LIBRARY% echo PYTHON_EXECUTABLE = %PYTHON_EXECUTABLE% echo SWIG_DIR = %SWIG_DIR% +echo THREEDS_MAX_SDK_HOME = %THREEDS_MAX_SDK_HOME% echo. echo CMAKE_INSTALL_PREFIX = %CMAKE_INSTALL_PREFIX% echo. From 645315a8f4ff756372eae43d3e0c0329349881d2 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Fri, 19 Feb 2016 23:02:09 +0200 Subject: [PATCH 2/5] remove win/sln as these are not needed anymore --- README.md | 20 +- win/readme.md | 1 - win/sln/IfcConvert.vcproj | 248 ------------------------ win/sln/IfcGeom.vcproj | 293 ---------------------------- win/sln/IfcMax.vcproj | 204 -------------------- win/sln/IfcOpenHouse.vcproj | 184 ------------------ win/sln/IfcOpenShell.sln | 73 ------- win/sln/IfcParse.vcproj | 326 -------------------------------- win/sln/IfcParseExamples.vcproj | 195 ------------------- win/sln/IfcWrap.vcproj | 217 --------------------- win/sln/readme.txt | 16 -- 11 files changed, 7 insertions(+), 1770 deletions(-) delete mode 100644 win/sln/IfcConvert.vcproj delete mode 100644 win/sln/IfcGeom.vcproj delete mode 100644 win/sln/IfcMax.vcproj delete mode 100644 win/sln/IfcOpenHouse.vcproj delete mode 100644 win/sln/IfcOpenShell.sln delete mode 100644 win/sln/IfcParse.vcproj delete mode 100644 win/sln/IfcParseExamples.vcproj delete mode 100644 win/sln/IfcWrap.vcproj delete mode 100644 win/sln/readme.txt diff --git a/README.md b/README.md index 069ab3f3ec..19c0f29b24 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ IfcOpenShell ============ -Open source (LGPL) software library for working with the IFC ([IFC2x3 TC1] and [IFC4]) file format. +IfcOpenShell is an open source (LGPL) software library for working with the IFC ([IFC2x3 TC1] and [IFC4]) file format. [http://ifcopenshell.org](http://ifcopenshell.org) [http://academy.ifcopenshell.org](http://academy.ifcopenshell.org) @@ -8,7 +8,10 @@ Open source (LGPL) software library for working with the IFC ([IFC2x3 TC1] and [ Prerequisites ============= -* Git, CMake (2.6 or newer), Visual Studio 2008 or newer with C++ toolset (Windows), or GCC (*nix, Clang untested). +* Git +* CMake (2.6 or newer) +* Windows: Visual Studio 2008 or newer with C++ toolset, MinGW not supported currently +* *nix: GCC 4.7 or newer, or Clang (any version should work, but not tested) Dependencies @@ -30,9 +33,6 @@ Dependencies Compiling on Windows ==================== -Users are advised to build IfcOpenShell using the CMake file provided in -the cmake/ folder. - The preferred way to fetch and build this project's dependencies is to use the build scripts in win/ folder. **See [win/readme.md] for more information**. Instructions in a nutshell (**assuming Visual Studio 2015 x64 environment variables set**): @@ -55,16 +55,10 @@ Alternatively, one can use the utility batch files to build and install the proj > build-ifcopenshell.cmd > install-ifcopenshell.cmd -Alternatively, the old Visual Studio solution and project files requiring manual work can -be found from the win/sln folder. - - Compiling on *nix ================= -Users are advised to build IfcOpenShell using the CMake file provided in -the cmake/ folder. There might be an Open CASCADE package in your operating -system's software repository. If not, you will need to compile Open -CASCADE yourself. See http://opencascade.org. +There might be an Open CASCADE package in your operating system's software repository. If not, you will need to compile +Open CASCADE yourself. See http://opencascade.org. For building the IfcPython wrapper, SWIG and Python development are required. diff --git a/win/readme.md b/win/readme.md index 6497d0ba4c..80a044371a 100644 --- a/win/readme.md +++ b/win/readme.md @@ -83,6 +83,5 @@ Directory Structure | run-cmake.bat - Sets environment variables for the dependencies and runs CMake for IFCOS | set-python-to-path.bat - Utility for setting PYTHONHOME (read from BuildDepsCache-.txt) to PATH | vs-cfg.cmd - Utility file used by the build scripts -+---sln - Contains the old Visual Studio solution and project files \---utils - Contains various utilities for the build scripts ``` diff --git a/win/sln/IfcConvert.vcproj b/win/sln/IfcConvert.vcproj deleted file mode 100644 index edc1b07ac1..0000000000 --- a/win/sln/IfcConvert.vcproj +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/sln/IfcGeom.vcproj b/win/sln/IfcGeom.vcproj deleted file mode 100644 index 4d13716f3d..0000000000 --- a/win/sln/IfcGeom.vcproj +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/sln/IfcMax.vcproj b/win/sln/IfcMax.vcproj deleted file mode 100644 index 8778979fb9..0000000000 --- a/win/sln/IfcMax.vcproj +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/sln/IfcOpenHouse.vcproj b/win/sln/IfcOpenHouse.vcproj deleted file mode 100644 index 4f0ce2b955..0000000000 --- a/win/sln/IfcOpenHouse.vcproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/sln/IfcOpenShell.sln b/win/sln/IfcOpenShell.sln deleted file mode 100644 index 898dddbb71..0000000000 --- a/win/sln/IfcOpenShell.sln +++ /dev/null @@ -1,73 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IfcParse", "IfcParse.vcproj", "{F7600775-3D48-426A-88E2-F3A4BF4408A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IfcPython", "IfcWrap.vcproj", "{DF780EE9-405F-4D15-A679-A251E30E84E2}" - ProjectSection(ProjectDependencies) = postProject - {F7600775-3D48-426A-88E2-F3A4BF4408A2} = {F7600775-3D48-426A-88E2-F3A4BF4408A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IfcMax", "IfcMax.vcproj", "{BD4D152C-8619-4DB9-8637-56DA166979F3}" - ProjectSection(ProjectDependencies) = postProject - {F7600775-3D48-426A-88E2-F3A4BF4408A2} = {F7600775-3D48-426A-88E2-F3A4BF4408A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IfcConvert", "IfcConvert.vcproj", "{5B0BAAB3-9FC4-4C0C-9D38-8BF4B07F4A85}" - ProjectSection(ProjectDependencies) = postProject - {BA57AF0F-1D12-4FAC-BD40-7474D729CAE9} = {BA57AF0F-1D12-4FAC-BD40-7474D729CAE9} - {F7600775-3D48-426A-88E2-F3A4BF4408A2} = {F7600775-3D48-426A-88E2-F3A4BF4408A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IfcGeom", "IfcGeom.vcproj", "{BA57AF0F-1D12-4FAC-BD40-7474D729CAE9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IfcParseExamples", "IfcParseExamples.vcproj", "{4DA9E9D7-60A6-4031-BA78-A3741BD62CB9}" - ProjectSection(ProjectDependencies) = postProject - {F7600775-3D48-426A-88E2-F3A4BF4408A2} = {F7600775-3D48-426A-88E2-F3A4BF4408A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IfcOpenHouse", "IfcOpenHouse.vcproj", "{163D7E4F-5337-4FAD-AC11-4D40078395A3}" - ProjectSection(ProjectDependencies) = postProject - {BA57AF0F-1D12-4FAC-BD40-7474D729CAE9} = {BA57AF0F-1D12-4FAC-BD40-7474D729CAE9} - {F7600775-3D48-426A-88E2-F3A4BF4408A2} = {F7600775-3D48-426A-88E2-F3A4BF4408A2} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F7600775-3D48-426A-88E2-F3A4BF4408A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {F7600775-3D48-426A-88E2-F3A4BF4408A2}.Debug|Win32.Build.0 = Debug|Win32 - {F7600775-3D48-426A-88E2-F3A4BF4408A2}.Release|Win32.ActiveCfg = Release|Win32 - {F7600775-3D48-426A-88E2-F3A4BF4408A2}.Release|Win32.Build.0 = Release|Win32 - {DF780EE9-405F-4D15-A679-A251E30E84E2}.Debug|Win32.ActiveCfg = Debug|Win32 - {DF780EE9-405F-4D15-A679-A251E30E84E2}.Debug|Win32.Build.0 = Debug|Win32 - {DF780EE9-405F-4D15-A679-A251E30E84E2}.Release|Win32.ActiveCfg = Release|Win32 - {DF780EE9-405F-4D15-A679-A251E30E84E2}.Release|Win32.Build.0 = Release|Win32 - {BD4D152C-8619-4DB9-8637-56DA166979F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {BD4D152C-8619-4DB9-8637-56DA166979F3}.Debug|Win32.Build.0 = Debug|Win32 - {BD4D152C-8619-4DB9-8637-56DA166979F3}.Release|Win32.ActiveCfg = Release|Win32 - {BD4D152C-8619-4DB9-8637-56DA166979F3}.Release|Win32.Build.0 = Release|Win32 - {5B0BAAB3-9FC4-4C0C-9D38-8BF4B07F4A85}.Debug|Win32.ActiveCfg = Debug|Win32 - {5B0BAAB3-9FC4-4C0C-9D38-8BF4B07F4A85}.Debug|Win32.Build.0 = Debug|Win32 - {5B0BAAB3-9FC4-4C0C-9D38-8BF4B07F4A85}.Release|Win32.ActiveCfg = Release|Win32 - {5B0BAAB3-9FC4-4C0C-9D38-8BF4B07F4A85}.Release|Win32.Build.0 = Release|Win32 - {BA57AF0F-1D12-4FAC-BD40-7474D729CAE9}.Debug|Win32.ActiveCfg = Debug|Win32 - {BA57AF0F-1D12-4FAC-BD40-7474D729CAE9}.Debug|Win32.Build.0 = Debug|Win32 - {BA57AF0F-1D12-4FAC-BD40-7474D729CAE9}.Release|Win32.ActiveCfg = Release|Win32 - {BA57AF0F-1D12-4FAC-BD40-7474D729CAE9}.Release|Win32.Build.0 = Release|Win32 - {4DA9E9D7-60A6-4031-BA78-A3741BD62CB9}.Debug|Win32.ActiveCfg = Debug|Win32 - {4DA9E9D7-60A6-4031-BA78-A3741BD62CB9}.Debug|Win32.Build.0 = Debug|Win32 - {4DA9E9D7-60A6-4031-BA78-A3741BD62CB9}.Release|Win32.ActiveCfg = Release|Win32 - {4DA9E9D7-60A6-4031-BA78-A3741BD62CB9}.Release|Win32.Build.0 = Release|Win32 - {163D7E4F-5337-4FAD-AC11-4D40078395A3}.Debug|Win32.ActiveCfg = Debug|Win32 - {163D7E4F-5337-4FAD-AC11-4D40078395A3}.Debug|Win32.Build.0 = Debug|Win32 - {163D7E4F-5337-4FAD-AC11-4D40078395A3}.Release|Win32.ActiveCfg = Release|Win32 - {163D7E4F-5337-4FAD-AC11-4D40078395A3}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/win/sln/IfcParse.vcproj b/win/sln/IfcParse.vcproj deleted file mode 100644 index e36d27bd4c..0000000000 --- a/win/sln/IfcParse.vcproj +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/sln/IfcParseExamples.vcproj b/win/sln/IfcParseExamples.vcproj deleted file mode 100644 index 94027eb617..0000000000 --- a/win/sln/IfcParseExamples.vcproj +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/sln/IfcWrap.vcproj b/win/sln/IfcWrap.vcproj deleted file mode 100644 index 51ffcc7320..0000000000 --- a/win/sln/IfcWrap.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - <..\..s> - <..\.. - Name="Debug|Win32" - OutputDirectory="..\build\debug" - IntermediateDirectory="..\temp\wrap\debug" - ..\..Type="2" - CharacterSet="2" - BuildLogFile="$(IntDir)\BuildLog.htm" - > - - - - - - - - - - - - - - - - - - - <..\.. - Name="Release|Win32" - OutputDirectory="..\build\release" - IntermediateDirectory="..\temp\wrap\release" - ..\..Type="2" - CharacterSet="2" - WholeProgramOptimization="1" - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/sln/readme.txt b/win/sln/readme.txt deleted file mode 100644 index d338443843..0000000000 --- a/win/sln/readme.txt +++ /dev/null @@ -1,16 +0,0 @@ -Original information from the README.md: - -For Windows users a prebuilt Open CASCADE version is available from the -http://opencascade.org website. Download and install this version and -provide the paths to the Open CASCADE header and library files to MS -Visual Studio C++. - -For building the Autodesk 3ds Max plugin, the 3ds Max SDK needs to be -installed as well as 3ds Max itself. Please provide the include and -library paths to Visual Studio. - -For building the IfcPython wrapper, SWIG needs to be installed. Please -download the latest swigwin version from http://www.swig.org/download.html. -After extracting the .zip file, please add the extracted folder to the PATH -environment variable. Python needs to be installed, please provide the -include and library paths to Visual Studio. From e171e308d00da83fbe6625fc59fb3260462072ea Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Sat, 20 Feb 2016 00:13:04 +0200 Subject: [PATCH 3/5] Enable solution folders --- cmake/CMakeLists.txt | 5 +++++ src/examples/CMakeLists.txt | 2 ++ 2 files changed, 7 insertions(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 27e71cb278..d1e7729ffd 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -243,6 +243,11 @@ if(ENABLE_BUILD_OPTIMIZATIONS) endif() IF(MSVC) + # Enable solution folders (free VS versions < 2012 doesn't support solution folders) + if (MSVC_VERSION GREATER 1600) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + endif() + IF(USE_VLD) ADD_DEFINITIONS(-DUSE_VLD) ENDIF() diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt index 0f0da6a525..8805d40e8c 100644 --- a/src/examples/CMakeLists.txt +++ b/src/examples/CMakeLists.txt @@ -19,6 +19,8 @@ ADD_EXECUTABLE(IfcParseExamples IfcParseExamples.cpp) TARGET_LINK_LIBRARIES(IfcParseExamples IfcParse) +set_target_properties(IfcParseExamples PROPERTIES FOLDER Examples) ADD_EXECUTABLE(IfcOpenHouse IfcOpenHouse.cpp) TARGET_LINK_LIBRARIES(IfcOpenHouse IfcParse IfcGeom ${OPENCASCADE_LIBRARIES}) +set_target_properties(IfcOpenHouse PROPERTIES FOLDER Examples) From 58b5838da9726bf39163e15e9f207a7f3fc45c31 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Sat, 20 Feb 2016 00:43:35 +0200 Subject: [PATCH 4/5] README.md tweaks --- README.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 19c0f29b24..c320658ab7 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,19 @@ IfcOpenShell ============ -IfcOpenShell is an open source (LGPL) software library for working with the IFC ([IFC2x3 TC1] and [IFC4]) file format. - -[http://ifcopenshell.org](http://ifcopenshell.org) -[http://academy.ifcopenshell.org](http://academy.ifcopenshell.org) - +IfcOpenShell is an open source ([LGPL]) software library for working with the [IFC] ([IFC2x3 TC1] and [IFC4]) file format. +For more information, see +* [http://ifcopenshell.org](http://ifcopenshell.org) +* [http://academy.ifcopenshell.org](http://academy.ifcopenshell.org) Prerequisites -============= +------------- * Git * CMake (2.6 or newer) * Windows: Visual Studio 2008 or newer with C++ toolset, MinGW not supported currently * *nix: GCC 4.7 or newer, or Clang (any version should work, but not tested) - Dependencies -============ +------------- * [Boost](http://www.boost.org/) * Open Cascade - *optional*, but required for building IfcGeom ([official](http://www.opencascade.org/getocc/download/loadocc/) or [community edition](https://github.com/tpaviot/oce)) @@ -30,9 +28,9 @@ Dependencies For building the 3ds Max plug-in. All recent versions of 3ds Max (2014 and newer) are 64-bit only, so a 64-bit installation is assumed. - -Compiling on Windows -==================== +Building IfcOpenShell +--------------------- +### Compiling on Windows The preferred way to fetch and build this project's dependencies is to use the build scripts in win/ folder. **See [win/readme.md] for more information**. Instructions in a nutshell (**assuming Visual Studio 2015 x64 environment variables set**): @@ -55,8 +53,7 @@ Alternatively, one can use the utility batch files to build and install the proj > build-ifcopenshell.cmd > install-ifcopenshell.cmd -Compiling on *nix -================= +### Compiling on *nix There might be an Open CASCADE package in your operating system's software repository. If not, you will need to compile Open CASCADE yourself. See http://opencascade.org. @@ -90,7 +87,7 @@ To build IfcOpenShell please take the following steps: If all worked out correctly you can now use IfcOpenShell. See the examples below. Usage examples -============== +-------------- **Invoking IfcConvert from the command line** @@ -160,6 +157,8 @@ Usage examples >>> # Writing IFC-SPF files to disk: >>> f.write("out.ifc") -[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md" +[LGPL]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/COPYING "LGPL" +[IFC]: http://www.buildingsmart-tech.org/specifications/ifc-overview "IFC" [IFC2x3 TC1]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc2x3-tc1-release "IFC2x3 TC1" -[IFC4]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc4-release "IFC4" \ No newline at end of file +[IFC4]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc4-release "IFC4" +[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md" \ No newline at end of file From ee75545ecd77d33b844e85289b6a8e1b32f8d5ec Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Sun, 21 Feb 2016 16:52:00 +0200 Subject: [PATCH 5/5] README tweaks --- README.md | 8 +++++--- cmake/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c320658ab7..059869ee62 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ IfcOpenShell ============ -IfcOpenShell is an open source ([LGPL]) software library for working with the [IFC] ([IFC2x3 TC1] and [IFC4]) file format. +IfcOpenShell is an open source ([LGPL]) software library for working with the Industry Foundation Classes ([IFC]) +file format. Currently supported IFC releases are [IFC2x3 TC1] and [IFC4]. + For more information, see * [http://ifcopenshell.org](http://ifcopenshell.org) * [http://academy.ifcopenshell.org](http://academy.ifcopenshell.org) @@ -22,9 +24,9 @@ Dependencies For handling code pages and Unicode in the parser * [OpenCOLLADA](https://github.com/khronosGroup/OpenCOLLADA/) - *optional* For IfcConvert to be able to write tessellated Collada (.dae) files -* [SWIG](http://www.swig.org/), [Python](https://www.python.org/) libraries - *optional* +* [SWIG](http://www.swig.org/) and [Python](https://www.python.org/) - *optional* For building the IfcOpenShell Python interface and the Blender add-on -* 3ds Max SDK - *optional* +* [3ds Max SDK](http://www.autodesk.com/products/3ds-max/free-trial) - *optional* For building the 3ds Max plug-in. All recent versions of 3ds Max (2014 and newer) are 64-bit only, so a 64-bit installation is assumed. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index d1e7729ffd..07554ff63f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -243,7 +243,7 @@ if(ENABLE_BUILD_OPTIMIZATIONS) endif() IF(MSVC) - # Enable solution folders (free VS versions < 2012 doesn't support solution folders) + # Enable solution folders (free VS versions prior to 2012 don't support solution folders) if (MSVC_VERSION GREATER 1600) set_property(GLOBAL PROPERTY USE_FOLDERS ON) endif()