Switch NetgenObject to inert if build without Netgen

This commit is contained in:
jriegel 2013-06-26 23:20:09 +02:00
parent e1847a00f9
commit b312232b80
4 changed files with 41 additions and 13 deletions

View File

@ -4,6 +4,10 @@ else(MSVC)
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
endif(MSVC)
if(FREECAD_BUILD_FEM_NETGEN)
add_definitions(-DFCWithNetgen)
endif(FREECAD_BUILD_FEM_NETGEN)
include_directories(
${CMAKE_SOURCE_DIR}/src
@ -20,14 +24,25 @@ include_directories(
link_directories(${OCC_LIBRARY_DIR})
set(Fem_LIBS
Part
Mesh
FreeCADApp
StdMeshers
NETGENPlugin
SMESH
)
if(FREECAD_BUILD_FEM_NETGEN)
set(Fem_LIBS
Part
Mesh
FreeCADApp
StdMeshers
NETGENPlugin
SMESH
)
else(FREECAD_BUILD_FEM_NETGEN)
set(Fem_LIBS
Part
Mesh
FreeCADApp
StdMeshers
SMESH
)
endif(FREECAD_BUILD_FEM_NETGEN)
generate_from_xml(FemMeshPy)

View File

@ -38,9 +38,11 @@
#include <SMDS_PolyhedralVolumeOfNodes.hxx>
#include <SMDS_VolumeTool.hxx>
#include <NETGENPlugin_SimpleHypothesis_3D.hxx>
#include <NETGENPlugin_Hypothesis.hxx>
#include <NETGENPlugin_Mesher.hxx>
#ifdef FCWithNetgen
#include <NETGENPlugin_SimpleHypothesis_3D.hxx>
#include <NETGENPlugin_Hypothesis.hxx>
#include <NETGENPlugin_Mesher.hxx>
#endif
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepTools.hxx>
@ -71,7 +73,8 @@ FemMeshShapeNetgenObject::~FemMeshShapeNetgenObject()
App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
{
#ifdef FCWithNetgen
Fem::FemMesh newMesh;
Part::Feature *feat = Shape.getValue<Part::Feature*>();
@ -132,7 +135,7 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
// set the value to the object
FemMesh.setValue(newMesh);
#endif
return App::DocumentObject::StdReturn;
}

View File

@ -4,6 +4,10 @@ else(MSVC)
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
endif(MSVC)
if(FREECAD_BUILD_FEM_NETGEN)
add_definitions(-DFCWithNetgen)
endif(FREECAD_BUILD_FEM_NETGEN)
include_directories(
${CMAKE_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}

View File

@ -126,6 +126,12 @@ CmdFemCreateAnalysis::CmdFemCreateAnalysis()
void CmdFemCreateAnalysis::activated(int iMsg)
{
#ifndef FCWithNetgen
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
return;
#endif
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
if (selection.size() != 1) {