Skip to content

Commit

Permalink
suppport simmetrix discrete models
Browse files Browse the repository at this point in the history
turn the discrete modeler on by default
  • Loading branch information
cwsmith committed Jul 31, 2017
1 parent d5b52dd commit 6ceeef4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
10 changes: 9 additions & 1 deletion cmake/FindSimModSuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,18 @@ if (SIM_ACIS)
SpaACIS)
endif()

option(SIM_DISCRETE "Use Simmetrix discrete modeling" OFF)
if (SIM_DISCRETE)
getSimCadLib("${SIMMODSUITE_INSTALL_DIR}/lib/${SIM_ARCHOS}"
SimDiscrete simDiscreteLib)
set(SIM_CAD_LIB_NAMES
${simDiscreteLib}
${SIM_CAD_LIB_NAMES})
endif()

simLibCheck("${SIM_CAD_LIB_NAMES}" TRUE)

set(SIM_OPT_LIB_NAMES
SimDiscrete
SimField
SimAdvMeshing)

Expand Down
3 changes: 2 additions & 1 deletion gmi_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ endif()

option(SIM_PARASOLID "Enable Parasolid interface" OFF)
option(SIM_ACIS "Enable Acis interface" OFF)
# this file brings SIM_PARASOLID and SIM_ACIS from CMake to C++
option(SIM_DISCRETE "Enable Acis interface" ON)
# this file brings SIM_PARASOLID, SIM_ACIS, SIM_DISCRETE from CMake to C++
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gmi_sim_config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/gmi_sim_config.h")

Expand Down
12 changes: 12 additions & 0 deletions gmi_sim/gmi_sim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include "SimAcisKrnl.h"
#endif

#ifdef SIM_DISCRETE
#include "SimDiscrete.h"
#endif

struct sim_model {
struct gmi_model model;
SGModel* sim;
Expand Down Expand Up @@ -367,6 +371,10 @@ static gmi_model* create_native(const char* filename)
void gmi_sim_start(void)
{
SimModel_start();
#ifdef SIM_DISCRETE
int ignored = 0;
SimDiscrete_start(ignored);
#endif
#ifdef SIM_PARASOLID
SimParasolid_start(1);
#endif
Expand All @@ -377,6 +385,10 @@ void gmi_sim_start(void)

void gmi_sim_stop(void)
{
#ifdef SIM_DISCRETE
int ignored = 0;
SimDiscrete_stop(ignored);
#endif
#ifdef SIM_ACIS
SimAcis_stop(1);
#endif
Expand Down
1 change: 1 addition & 0 deletions gmi_sim/gmi_sim_config.h.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#cmakedefine SIM_PARASOLID
#cmakedefine SIM_ACIS
#cmakedefine SIM_DISCRETE

0 comments on commit 6ceeef4

Please sign in to comment.