diff --git a/.gitignore b/.gitignore index e131921..d742d4b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ Python/*_wrap.* Binaries CMakeFiles .vs -Scripts \ No newline at end of file +Scripts +bin \ No newline at end of file diff --git a/Core/mymath.h b/Core/mymath.h index 88a5cb0..254ec12 100644 --- a/Core/mymath.h +++ b/Core/mymath.h @@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #include +#include #include #include #include diff --git a/GUI/CMakeLists.txt b/GUI/CMakeLists.txt index bdf9c3b..069f3e8 100644 --- a/GUI/CMakeLists.txt +++ b/GUI/CMakeLists.txt @@ -41,19 +41,7 @@ LINK_DIRECTORIES(${VTK_LIBRARY_DIRS} ) IF(UNIX) ADD_DEFINITIONS("`pkg-config --cflags gtk+-2.0`") ADD_DEFINITIONS("`wx-config --cflags`") - TARGET_LINK_LIBRARIES(TexGenGUI - TexGenRenderer - TexGenCore - vtkGraphics - vtkFiltering - vtkCommon - vtkRendering - vtkWidgets - vtkftgl - vtksys - vtkexpat - vtkNetCDF - LatinHypercube + TARGET_LINK_LIBRARIES(${VTK_LIBRARIES} ${wxWidgets_LIBRARIES} #optimized ${PYTHON_LIBRARIES}) ${PYTHON_LIBRARIES}) @@ -80,16 +68,7 @@ IF(WIN32) TexGenCore opengl32 glu32 - ${VTK_LIBRARY_DIRS}/vtkGraphics - ${VTK_LIBRARY_DIRS}/vtkFiltering - ${VTK_LIBRARY_DIRS}/vtkCommon - ${VTK_LIBRARY_DIRS}/vtkRendering - ${VTK_LIBRARY_DIRS}/vtkWidgets - ${VTK_LIBRARY_DIRS}/vtkftgl - ${VTK_LIBRARY_DIRS}/vtksys - ${VTK_LIBRARY_DIRS}/vtkexpat - ${VTK_LIBRARY_DIRS}/vtknetcdf - ${VTK_LIBRARY_DIRS}/vtkhdf5 + ${VTK_LIBRARIES} ${wxWidgets_LIBRARIES} optimized ${PYTHON_LIBRARIES} comctl32 diff --git a/GUI/CustomWidget.cpp b/GUI/CustomWidget.cpp index 77d6f29..76af96b 100644 --- a/GUI/CustomWidget.cpp +++ b/GUI/CustomWidget.cpp @@ -24,7 +24,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "vtkCallbackCommand.h" #include "vtkCellPicker.h" -vtkCxxRevisionMacro(vtkCustomWidget, "$Revision: 1.0 $"); +#include "vtkAutoInit.h" +VTK_MODULE_INIT(vtkRenderingOpenGL); // VTK was built with vtkRenderingOpenGL +VTK_MODULE_INIT(vtkInteractionStyle); + vtkStandardNewMacro(vtkCustomWidget); vtkCustomWidget::vtkCustomWidget() @@ -45,7 +48,7 @@ vtkCustomWidget::vtkCustomWidget() // pArrow->SetShaftResolution(8); // pArrow->SetTipResolution(8); vtkPolyDataMapper* pPolyDataMapper = vtkPolyDataMapper::New(); - pPolyDataMapper->SetInput(pArrow->GetOutput()); + pPolyDataMapper->SetInputData(pArrow->GetOutput()); vtkActor* pActor = vtkActor::New(); pActor->SetMapper(pPolyDataMapper); pActor->SetScale(2); diff --git a/GUI/CustomWidget.h b/GUI/CustomWidget.h index d3431af..008cb58 100644 --- a/GUI/CustomWidget.h +++ b/GUI/CustomWidget.h @@ -46,7 +46,7 @@ class vtkCustomWidget : public vtk3DWidget // Instantiate the object. static vtkCustomWidget *New(); - vtkTypeRevisionMacro(vtkCustomWidget, vtk3DWidget); + vtkTypeMacro(vtkCustomWidget, vtk3DWidget); // void PrintSelf(ostream& os, vtkIndent indent) {;} // Description: diff --git a/GUI/PrecompiledHeaders.h b/GUI/PrecompiledHeaders.h index db297c6..c26bae4 100644 --- a/GUI/PrecompiledHeaders.h +++ b/GUI/PrecompiledHeaders.h @@ -17,11 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. =============================================================================*/ -#ifdef WIN32 -# include -#else -# include -#endif +#include // Prevent python.h from adding python24_d.lib to the linker in debug mode (that library does not exist) /*#ifdef WIN32 diff --git a/GUI/TexGenMainFrame.cpp b/GUI/TexGenMainFrame.cpp index 1f51c8e..968c384 100644 --- a/GUI/TexGenMainFrame.cpp +++ b/GUI/TexGenMainFrame.cpp @@ -2600,8 +2600,7 @@ void CTexGenMainFrame::OnOptions(wxCommandEvent& event) void CTexGenMainFrame::LaunchSurvey() { - wxStandardPaths paths; - wxString path = paths.GetUserConfigDir(); + wxString path = wxStandardPaths::Get().GetUserConfigDir(); wxString Filename = path + wxT("/.count.txt"); if ( !wxFileExists( Filename ) ) diff --git a/GUI/wxVTKRenderWindowInteractor.cxx b/GUI/wxVTKRenderWindowInteractor.cxx index 7eb643c..cf9e944 100644 --- a/GUI/wxVTKRenderWindowInteractor.cxx +++ b/GUI/wxVTKRenderWindowInteractor.cxx @@ -19,12 +19,16 @@ #include "PrecompiledHeaders.h" #include "wxVTKRenderWindowInteractor.h" +#include "vtkAutoInit.h" +VTK_MODULE_INIT(vtkRenderingOpenGL); // VTK was built with vtkRenderingOpenGL +VTK_MODULE_INIT(vtkRenderingFreeType); + //This is needed for vtk 3.1 : #ifndef VTK_MAJOR_VERSION # include "vtkVersion.h" #endif -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) # include "vtkCommand.h" #else # include "vtkInteractorStyle.h" @@ -268,7 +272,7 @@ void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event)) if (!Enabled) return; -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::TimerEvent, NULL); #else @@ -359,7 +363,7 @@ void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event)) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) InvokeEvent(vtkCommand::ConfigureEvent, NULL); #endif //this will check for Handle @@ -372,7 +376,7 @@ void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event) { return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); @@ -391,7 +395,7 @@ void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); @@ -411,7 +415,7 @@ void wxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); @@ -431,7 +435,7 @@ void wxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style int keycode = event.GetKeyCode(); char key = '\0'; @@ -460,7 +464,7 @@ void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style int keycode = event.GetKeyCode(); char key = '\0'; @@ -489,14 +493,14 @@ void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event) } ActiveButton = event.GetEventType(); -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); #endif if(event.RightDown()) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::RightButtonPressEvent, NULL); #else @@ -507,7 +511,7 @@ void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event) } else if(event.LeftDown()) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL); #else @@ -518,7 +522,7 @@ void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event) } else if(event.MiddleDown()) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::MiddleButtonPressEvent, NULL); #else @@ -548,14 +552,14 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); #endif if(ActiveButton == wxEVT_RIGHT_DOWN) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::RightButtonReleaseEvent, NULL); #else @@ -566,7 +570,7 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event) } else if(ActiveButton == wxEVT_LEFT_DOWN) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::LeftButtonReleaseEvent, NULL); #else @@ -577,7 +581,7 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event) } else if(ActiveButton == wxEVT_MIDDLE_DOWN) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::MiddleButtonReleaseEvent, NULL); #else @@ -597,7 +601,7 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event) void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event) { // Mouse wheel was only added after VTK 4.4 (I think...) -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2) // new style //Set vtk event information ... The numebr of wheel rotations is stored in //the x varible. y varible is zero @@ -640,7 +644,7 @@ void wxVTKRenderWindowInteractor::Render() { RenderWindow->Render(); } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2) +#if VTK_MAJOR_VERSION >= 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2) else if(GetHandleHack()) { //this means the user has reparented us; let's adapt to the diff --git a/GUI/wxVTKRenderWindowInteractor.h b/GUI/wxVTKRenderWindowInteractor.h index f731634..f293b50 100644 --- a/GUI/wxVTKRenderWindowInteractor.h +++ b/GUI/wxVTKRenderWindowInteractor.h @@ -84,7 +84,7 @@ class wxSizeEvent; #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) class VTK_RENDERING_EXPORT wxVTKRenderWindowInteractor : public wxGLCanvas, public vtkRenderWindowInteractor #else -class VTK_RENDERING_EXPORT wxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInteractor +class wxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInteractor #endif //__WXGTK__ { DECLARE_DYNAMIC_CLASS(wxVTKRenderWindowInteractor) diff --git a/README.md b/README.md index 89ff6d3..3c1566d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,12 @@ TexGen is a geometric textile modelling software package to be used for obtaining engineering properties of woven textiles and textile composites. More information about the project can be found here http://texgen.sourceforge.net ## Building Code -Instructions for building TexGen from source can be found here http://texgen.sourceforge.net/index.php/Compiling_from_Source +Original Instructions for building TexGen from source can be found here http://texgen.sourceforge.net/index.php/Compiling_from_Source + +Latest specific install instructions: + +1. [Windows 10 install](mddocs/WindowsInstall.md) +1. [Ubuntu 18.04 LTS install](mddocs/UbuntuBionicInstall.md) ## Executables Windows executables and release tarballs can be found here https://sourceforge.net/projects/texgen/ diff --git a/Renderer/CMakeLists.txt b/Renderer/CMakeLists.txt index 18c6f3c..a26130a 100644 --- a/Renderer/CMakeLists.txt +++ b/Renderer/CMakeLists.txt @@ -20,25 +20,7 @@ IF(UNIX) SET_TARGET_PROPERTIES(TexGenRenderer PROPERTIES LINK_FLAGS "-Wl,-rpath,${VTK_DIR}/bin -L${VTK_DIR}/bin") TARGET_LINK_LIBRARIES(TexGenRenderer TexGenCore - vtkGraphics - vtkFiltering - vtkCommon - vtkRendering - vtkHybrid - vtkIO - vtkWidgets - vtkzlib - vtkfreetype - vtkftgl - vtkpng - vtkImaging - vtkjpeg - vtktiff - vtksys - vtkexpat - vtkNetCDF - vtkhdf5 - vtkmetaio + ${VTK_LIBRARIES} ) ENDIF(UNIX) @@ -52,24 +34,6 @@ INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) IF(WIN32) TARGET_LINK_LIBRARIES(TexGenRenderer TexGenCore opengl32 glu32 - ${VTK_LIBRARY_DIRS}/vtkGraphics - ${VTK_LIBRARY_DIRS}/vtkFiltering - ${VTK_LIBRARY_DIRS}/vtkCommon - ${VTK_LIBRARY_DIRS}/vtkRendering - ${VTK_LIBRARY_DIRS}/vtkHybrid - ${VTK_LIBRARY_DIRS}/vtkIO - ${VTK_LIBRARY_DIRS}/vtkWidgets - ${VTK_LIBRARY_DIRS}/vtkzlib - ${VTK_LIBRARY_DIRS}/vtkfreetype - ${VTK_LIBRARY_DIRS}/vtkftgl - ${VTK_LIBRARY_DIRS}/vtkpng - ${VTK_LIBRARY_DIRS}/vtkImaging - ${VTK_LIBRARY_DIRS}/vtkjpeg - ${VTK_LIBRARY_DIRS}/vtktiff - ${VTK_LIBRARY_DIRS}/vtksys - ${VTK_LIBRARY_DIRS}/vtkexpat - ${VTK_LIBRARY_DIRS}/vtknetcdf - ${VTK_LIBRARY_DIRS}/vtkhdf5 - ${VTK_LIBRARY_DIRS}/vtkmetaio + ${VTK_LIBRARIES} ) ENDIF(WIN32) diff --git a/Renderer/TexGenRenderer.cpp b/Renderer/TexGenRenderer.cpp index 7079408..5519d07 100644 --- a/Renderer/TexGenRenderer.cpp +++ b/Renderer/TexGenRenderer.cpp @@ -470,7 +470,7 @@ vtkActor *CTexGenRenderer::ConvertToActor(vtkPolyData *pPolyData) { vtkActor *pActor = vtkActor::New(); vtkPolyDataMapper *pPolyDataMapper = vtkPolyDataMapper::New(); - pPolyDataMapper->SetInput(pPolyData); + pPolyDataMapper->SetInputData(pPolyData); pActor->SetMapper(pPolyDataMapper); pPolyDataMapper->Delete(); @@ -896,7 +896,7 @@ void CTexGenRenderer::RenderPath(CTextile &Textile, int iYarn) vtkTubeFilter* pProfileTubes = vtkTubeFilter::New(); pProfileTubes->SetNumberOfSides(8); - pProfileTubes->SetInput(pPolyData); + pProfileTubes->SetInputData(pPolyData); pProfileTubes->SetRadius(dRadius); pProfileTubes->CappingOn(); @@ -982,8 +982,8 @@ void CTexGenRenderer::RenderInterference(CTextile &Textile, bool bDepth) pBalls->SetThetaResolution(10); vtkGlyph3D* pGlyphPoints = vtkGlyph3D::New(); - pGlyphPoints->SetInput(pPolyData); - pGlyphPoints->SetSource(pBalls->GetOutput()); + pGlyphPoints->SetInputData(pPolyData); + pGlyphPoints->SetSourceData(pBalls->GetOutput()); if ( bDepth ) { @@ -1111,8 +1111,8 @@ void CTexGenRenderer::RenderGrid(CTextile &Textile, int iResX, int iResY, int iR vtkGlyph3D* pGlyphPoints = vtkGlyph3D::New(); pGlyphPoints->SetScaleFactor(dLength); pGlyphPoints->SetVectorModeToUseVector(); - pGlyphPoints->SetSource(pArrow->GetOutput()); - pGlyphPoints->SetInput(pPolyData); + pGlyphPoints->SetSourceData(pArrow->GetOutput()); + pGlyphPoints->SetInputData(pPolyData); vtkPolyDataMapper* pGlyphMapper = vtkPolyDataMapper::New(); pGlyphMapper->SetInputConnection(pGlyphPoints->GetOutputPort()); @@ -1137,7 +1137,7 @@ bool CTexGenRenderer::RenderImage(string FileName, double dMaxDim, XYZ Orientati // vtkPNGReader* pReader = vtkPNGReader::New(); pReader->SetFileName(FileName.c_str()); vtkImageActor* pImageActor = vtkImageActor::New(); - pImageActor->SetInput(pReader->GetOutput()); + pImageActor->SetInputData(pReader->GetOutput()); double Bounds[6]; pImageActor->GetBounds(Bounds); double dMaxBound = Bounds[1] - Bounds[0]; @@ -1317,7 +1317,7 @@ vtkAlgorithm *CTexGenRenderer::CalculateNormals(vtkPolyData *pInput) pPolyDataNormals->ComputeCellNormalsOn(); pPolyDataNormals->FlipNormalsOff(); - pPolyDataNormals->SetInput(pInput); + pPolyDataNormals->SetInputData(pInput); pInput->Delete(); @@ -1418,7 +1418,7 @@ bool CTexGenRenderer::SaveMeshToVTK(string FileName, const CMesh &Mesh) FileName += ".vtp"; vtkPolyData* pPolyData = GetPolyData(Mesh); vtkXMLPolyDataWriter* pPolyDataWriter = vtkXMLPolyDataWriter::New(); - pPolyDataWriter->SetInput(pPolyData); + pPolyDataWriter->SetInputData(pPolyData); pPolyDataWriter->SetDataModeToBinary(); pPolyDataWriter->SetFileName(FileName.c_str()); bool bSuccess = pPolyDataWriter->Write()?true:false; diff --git a/mddocs/UbuntuBionicInstall.md b/mddocs/UbuntuBionicInstall.md new file mode 100644 index 0000000..b8634ef --- /dev/null +++ b/mddocs/UbuntuBionicInstall.md @@ -0,0 +1,50 @@ +Requirements on Ubuntu 18.04 LTS: + + sudo apt-get install cmake cmake-curses-gui + sudo apt-get install swig libvtk6-dev libvtk6.3 libvtk6-qt-dev libvtk6.3-qt + sudo apt-get install libwxgtk3.0-dev + +Next, clone the repo + + git clone https://github.com/louisepb/TexGen.git + cd TexGen + mkdir bin + cd bin + ccmake ../ + +Press 'c' to configure, and set first to only core compile by setting to following settings (press 't' for this full list): + + BUILD_CASCADE_EXPORT OFF + BUILD_DOCUMENTATION OFF + BUILD_EXAMPLES OFF + BUILD_GUI OFF + BUILD_PROFILE OFF + BUILD_PYTHON_INTERFACE OFF + BUILD_RENDERER OFF + BUILD_SHARED ON + BUILD_UNIT_TESTS OFF + CMAKE_BACKWARDS_COMPATIBILITY 2.4 + CMAKE_BUILD_TYPE + CMAKE_INSTALL_PREFIX /usr/local + PYTHON_SITEPACKAGES_DIR PYTHON_SITEPACKAGES_DIR-NOTFOUND + Qt5Core_DIR /usr/lib/x86_64-linux-gnu/cmake/Qt5Core + Qt5Gui_DIR /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui + Qt5Network_DIR /usr/lib/x86_64-linux-gnu/cmake/Qt5Network + Qt5WebKit_DIR /usr/lib/x86_64-linux-gnu/cmake/Qt5WebKit + SWIG_EXECUTABLE /usr/bin/swig3.0 + VTK_DIR /usr/lib/cmake/vtk-6.3 + wxWidgets_CONFIG_EXECUTABLE /usr/bin/wx-config + +Press 'c' again to see there are no errors (in case of errors, change settings to fix these). + +Press 'g' to generate the makefiles and exit + +Now compile with: + + make + +which will build targets `TexGenCore` and `LatinHypercube`. + +Install with: + + make install diff --git a/mddocs/WindowsInstall.md b/mddocs/WindowsInstall.md new file mode 100644 index 0000000..e23a85e --- /dev/null +++ b/mddocs/WindowsInstall.md @@ -0,0 +1,150 @@ +In order to compile [TexGen](../README.md) and all of its modules, the following software is required: + +The following programs are needed to build TexGen: + +1. CMake +2. SWIG + +The following libraries are needed to link to TexGen: + +1. VTK +2. wxWidgets +3. OpenCascade +4. Python + +# Build using Visual Studio 2017 Community on Windows 10 + +We present here how to build TexGen on __Windows 10__, 64 bit, using VS2017. +## Install tools +1. Install [cmake](https://cmake.org/download/). At the time of writing this is +version 3.12.4: `cmake-3.12.4-win64-x64.msi`. This will install the graphical +application __CMake__ (cmake-gui). +2. Install [Github Desktop](https://desktop.github.com/). Once installed, start it, +and select __Clone Repository__ `CTRL+SHIFT+O`, and clone this repository. +3. Install [Visual Studio Community 2017](https://visualstudio.microsoft.com/downloads/), + which is the free version of the Microsoft Compiler + +## Install and Build Dependencies +### SWIG +TexGen requires SWIG. We install an older version, namely `2.0.10`. On the [download page](http://www.swig.org/download.html), go to the older releases and download package `swigwin-2.0.10.zip`. Extract this zip in __C:\Program Files\swigwin-2.0.10__ + +### OpenCascade +Go to the download area of [OpenCascade](https://www.opencascade.com/content/download-center), select `Previous Releases`, and +download version 6.5.2: __OpenCASCADE652.exe__. + +Run this exe file to install. + +### Python 2.7 +Next download the WIN32 (x86) version of [Python 2.7](https://www.python.org/downloads/windows/). At the time of writing this is +[python-2.7.15.msi](https://www.python.org/ftp/python/2.7.15/python-2.7.15.msi). + +Run the installer, which should install in location __C:\Python27__. + +### wxWidgets +[Download](http://www.wxwidgets.org/downloads/) from the [sourceforge archive](https://sourceforge.net/projects/wxwindows/files/2.8.12/) +the installer `wxMSW-2.8.12-Setup.exe`. Run it, which will install in __C:\wxWidgets-2.8.12__ + +This code still needs to be build. Start Visual Studio 2017, and open project __C:\wxWidgets-2.8.12\build\msw\wx.dsw__. VS2017 will require you to upgrade this project, and will save it as __C:\wxWidgets-2.8.12\build\msw\wx.sln__. Change in __ALL__ projects the target platform to _Windows 10_(right click project, select `Properties-->General`, and select correct platform). Build the solution (F7). + +You can download a zip of the already converted project from [ugent.be](http://users.ugent.be/~bmalengi/TexGen/), which for use you need to extract in the location __C:\wxWidgets-2.8.12__. + +### VTK +From the [VTK](https://www.vtk.org/download/) website download __VTK-6.3.0.zip__, and extract this in your Download directory in folder `VTK-6.3.0`. We now need to build this with VS2017 using first cmake to set our compile options. + +From your start menu, select cmake, and set as source code directory + + YOUR_LOCATION/Downloads/VTK-6.3.0/VTK-6.3.0 + +Creqate a directory bin there and set that as build directory: + + YOUR_LOCATION/Downloads/VTK-6.3.0/VTK-6.3.0/bin + +You can click the `Advanced` checkbox to indicate components to build. For TexGen you need: + + BUILD_EXAMPLES OFF + BUILD_SHARED_LIBS OFF or ON + VTK_GROUP_STANDALONE ON + VTK_GROUP_TK ON + VTK_PYTHON_VERSION 2 + VTK_RENDERING_BACKEND OpenGL + +Press `Configure`. No errors should appear (in red). If so, fix the errors, and press `Configure` again. When no errors, press `Generate`, which will create a solution for VS2017. + +Now that you have created a VS2017 project, start VS2017, and open __YOUR_LOCATION\Downloads\VTK-6.3.0\VTK-6.3.0\bin\VTK.sln__ +Select in Solution Explorer target ALL_BUILD, set in the toolbar as configuration __Release__, and build VTK (F7). + +When finished, start VS2017 as admin (right-click in start menu`-->more-->run as admin`), select VTK.sln, select target `INSTALL`and build this (F7) to install VTK to __C:\Program Files (x86)\VTK__. + +Note that this builds VTK for platform WIN32. + +## Build TexGen + +You downloaded this TexGen repo when installing Github Desktop, see above. Now we use cmake to set build options, and use VS2017 to build TexGen. +From your start menu, select cmake, and set as source code directory + + YOUR_LOCATION/Documents/GitHub/TexGen + +Creqate a directory bin there and set that as build directory: + + YOUR_LOCATION/Documents/GitHub/TexGen/bin + +You can click the `Advanced` checkbox to indicate components to build. It is recommended to begin with a minimal build, this is achieved by setting the cache values as follows: + + BUILD_CASCADE_EXPORT OFF + BUILD_DOCUMENTATION OFF + BUILD_EXAMPLES OFF + BUILD_GUI OFF + BUILD_PYTHON_INTERFACE OFF + BUILD_RENDERER OFF + BUILD_SHARED ON + BUILD_UNIT_TESTS OFF + +Press `Configure`. No errors should appear (in red). If so, fix the errors, and press `Configure` again. When no errors, press `Generate`, which will create a solution for VS2017. + +Now that you have created a VS2017 project, start VS2017, and open __YOUR_LOCATION/Documents/GitHub/TexGen/bin/TexGen.sln__ +Select in Solution Explorer target `ALL_BUILD`, set in the toolbar as configuration __Release__, and build TexGen. + +In order to build the GUI, you need to set the options in cmake instead as: + + BUILD_CASCADE_EXPORT ON + BUILD_DOCUMENTATION OFF + BUILD_EXAMPLES OFF + BUILD_GUI ON + BUILD_PYTHON_INTERFACE ON + BUILD_RENDERER ON + BUILD_SHARED ON + BUILD_UNIT_TESTS OFF + +Configure and when no errors, press Generate to update the solution. + +When finished, start VS2017 as admin (right-click in start menu`-->more-->run as admin`), select TexGen.sln, select target `INSTALL`and build this (F7) to install TexGen to __C:\Program Files (x86)\TexGen__. + +Note that this builds TexGen for platform WIN32. Only in this final directory can you run the `TexGenGUI.exe` application. If `dll`-files are missing, copy them into this directory as the most easy fix. + + +### cmake variables +In case of problems, make sure following variables in cmake are set correct: + +__PYTHON_SITEPACKAGES_DIR__ - This should be the folder where the TexGen python modules will be placed. With above install this should be `C:/Python27/Lib/site-packages`. This will depend on the version of Python installed and where you decided to install it. + +__SWIG_DIR__ - This is the location where you extracted the SWIG executable. e.g. ´C:/Program Files/swigwin-2.0.10´. + +__SWIG_EXECUTABLE__ - Same as root directory followed by swig.exe e.g. +´C:/Program Files/swigwin-2.0.10/swig.exe´. + +__wxWidgets_ROOT_DIR__ - Location where you install wxWidgets. e.g. `C:/wxWidgets-2.8.12`. + +__wxWidgets_LIB_DIR__ - Location where the wxWidgets libraries were compiled to, should be the same as the root directory followed by lib/vc_lib: `C:/wxWidgets-2.8.12/lib/vc_lib`. + +__wxWidgets_INCLUDE_DIR__ - Location where you install header files of wxWidgets. e.g. `C:/wxWidgets-2.8.12/include`. + +__wxWidgets_CONFIGURATION__ - `msw` + +__OPENCASCADE_INCLUDE_DIR__ - Location where the OpenCascade header files are located. e.g. `C:/OpenCASCADE6.5.2/ros/inc`. + +__OPENCASCADE_LIBRARY_DIR__ - Location where the OpenCascade libraries are located. e.g. `C:/OpenCASCADE6.5.2/ros/win32/vc8/lib`. + +__OPENCASCADE_DEBUG_LIBRARY_DIR__ - Location where the OpenCascade debug libraries are located. e.g. 'C:/OpenCASCADE6.5.2/ros/win32/vc8/libd'. If no debug made, use OPENCASCADE_LIBRARY_DIR value. + +__VTK_DIR__ - Location of the VTK binary directory (note: not the source directory): `C:/Program Files (x86)/VTK/lib/cmake/vtk-6.3` +