LOCAL_INCLUDES=""
LOCAL_LIBS="-lcgns $HDF5_LIBS"
-if test -z $CGNSHOME
-then
- AC_MSG_WARN(undefined CGNSHOME variable which specify CGNS library installation directory)
- AC_PATH_PROG(BINDIR, cgnsversion)
- if test "x$BINDIR" != "x" ; then
- CGNSHOME=$BINDIR
- CGNSHOME=`echo ${CGNSHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
- CGNSHOME=`echo ${CGNSHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
- fi
-fi
-if test ! -z $CGNSHOME
-then
- LOCAL_INCLUDES="-I$CGNSHOME/include"
- if test "x$CGNSHOME" != "x/usr"; then
- LOCAL_LIBS="-L$CGNSHOME/lib $LOCAL_LIBS"
- fi
-fi
+if test "x$CGNSHOME" != "xno"; then
+ if test "x$CGNSHOME" == "xyes"; then
+ CGNSHOME=""
+ fi
+ if test -z $CGNSHOME
+ then
+ AC_MSG_WARN(undefined CGNSHOME variable which specify CGNS library installation directory)
+ AC_PATH_PROG(BINDIR, cgnsversion)
+ if test "x$BINDIR" != "x" ; then
+ CGNSHOME=$BINDIR
+ CGNSHOME=`echo ${CGNSHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+ CGNSHOME=`echo ${CGNSHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+ fi
+ fi
+ if test ! -z $CGNSHOME
+ then
+ LOCAL_INCLUDES="-I$CGNSHOME/include"
+ if test "x$CGNSHOME" != "x/usr"; then
+ LOCAL_LIBS="-L$CGNSHOME/lib $LOCAL_LIBS"
+ fi
+ fi
dnl check cgnslib header
-CPPFLAGS_old=$CPPFLAGS
-CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
+ CPPFLAGS_old=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
-AC_CHECK_HEADER(cgnslib.h,cgns_ok=yes ,cgns_ok=no)
+ AC_CHECK_HEADER(cgnslib.h,cgns_ok=yes ,cgns_ok=no)
-CPPFLAGS=$CPPFLAGS_old
+ CPPFLAGS=$CPPFLAGS_old
+fi
if test "x$cgns_ok" = "xyes"
then
then
CGNS_LIBS="$LOCAL_LIBS"
CGNS_INCLUDES="$LOCAL_INCLUDES"
- #CPPFLAGS="-DWITH_CGNS $CPPFLAGS"
+ CPPFLAGS="-DWITH_CGNS $CPPFLAGS"
fi
AC_MSG_RESULT(for CGNS: $cgns_ok)
-#AM_CONDITIONAL(WITH_CGNS, [test x"$cgns_ok" = xyes])
+AM_CONDITIONAL(WITH_CGNS, [test x"$cgns_ok" = xyes])
])dnl
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
+if WITH_CGNS
+ DriverCGNS_SUDIR = DriverCGNS
+endif
+
SUBDIRS = \
SMDS \
SMESHDS \
DriverDAT \
DriverUNV \
DriverSTL \
- DriverCGNS \
+ $(DriverCGNS_SUDIR) \
SMESH \
SMESH_I \
SMESHClient \
StdMeshersGUI
endif
-DIST_SUBDIRS = SMDS SMESHDS Controls Driver DriverMED DriverDAT DriverUNV DriverSTL SMESH \
- SMESH_I SMESHClient SMESH_SWIG MEFISTO2 StdMeshers StdMeshers_I OBJECT \
+DIST_SUBDIRS = SMDS SMESHDS Controls Driver DriverMED DriverDAT DriverUNV DriverSTL DriverCGNS \
+ SMESH SMESH_I SMESHClient SMESH_SWIG MEFISTO2 StdMeshers StdMeshers_I OBJECT \
SMESHFiltersSelection SMESHGUI PluginUtils SMESH_SWIG_WITHIHM StdMeshersGUI SMESH_PY Tools
-I$(srcdir)/../SMESHDS \
-I$(srcdir)/../SMESHUtils
+if WITH_CGNS
+ DriverCGNS_LIB = ../DriverCGNS/libMeshDriverCGNS.la
+endif
+
libSMESHimpl_la_LDFLAGS = \
../SMESHDS/libSMESHDS.la \
../Controls/libSMESHControls.la \
../DriverSTL/libMeshDriverSTL.la \
../DriverMED/libMeshDriverMED.la \
../DriverUNV/libMeshDriverUNV.la \
- ../DriverCGNS/libMeshDriverCGNS.la \
+ $(DriverCGNS_LIB) \
../SMESHUtils/libSMESHUtils.la \
$(GEOM_LDFLAGS) -lNMTTools \
$(CAS_LDPATH) -lTKShHealing -lTKPrim -lTKG2d
#include "DriverMED_R_SMESHDS_Mesh.h"
#include "DriverUNV_R_SMDS_Mesh.h"
#include "DriverSTL_R_SMDS_Mesh.h"
+#ifdef WITH_CGNS
#include "DriverCGNS_Read.hxx"
#include "DriverCGNS_Write.hxx"
+#endif
#undef _Precision_HeaderFile
#include <BRepBndLib.hxx>
const int theMeshIndex,
std::string& theMeshName)
{
+ int res = Driver_Mesh::DRS_FAIL;
+#ifdef WITH_CGNS
+
DriverCGNS_Read myReader;
myReader.SetMesh(_myMeshDS);
myReader.SetFile(theFileName);
myReader.SetMeshId(theMeshIndex);
- int res = myReader.Perform();
+ res = myReader.Perform();
theMeshName = myReader.GetMeshName();
// create groups
SynchronizeGroups();
+#endif
return res;
}
void SMESH_Mesh::ExportCGNS(const char * file,
const SMESHDS_Mesh* meshDS)
{
+ int res = Driver_Mesh::DRS_FAIL;
+#ifdef WITH_CGNS
DriverCGNS_Write myWriter;
myWriter.SetFile( file );
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
myWriter.SetMeshName( SMESH_Comment("Mesh_") << meshDS->GetPersistentId());
- if ( myWriter.Perform() != Driver_Mesh::DRS_OK )
+ res = myWriter.Perform();
+#endif
+ if ( res != Driver_Mesh::DRS_OK )
throw SALOME_Exception("Export failed");
}
createMenu( 112, importId, -1 );
createMenu( 113, importId, -1 );
createMenu( 115, importId, -1 );
+#ifdef WITH_CGNS
createMenu( 116, importId, -1 );
-
+#endif
createMenu( 121, exportId, -1 );
createMenu( 122, exportId, -1 );
createMenu( 123, exportId, -1 );
createMenu( 140, exportId, -1 ); // export to STL
+#ifdef WITH_CGNS
createMenu( 142, exportId, -1 ); // export to CGNS
-
+#endif
createMenu( separator(), fileId, 10 );
createMenu( 33, editId, -1 );
createPopupItem( 125, OB, mesh_group, multiple_non_empty ); // EXPORT_MED
createPopupItem( 126, OB, mesh_group, only_one_non_empty ); // EXPORT_UNV
createPopupItem( 141, OB, mesh_group, only_one_2D ); // EXPORT_STL
+#ifdef WITH_CGNS
createPopupItem( 143, OB, mesh_group, multiple_non_empty ); // EXPORT_CGNS
+#endif
createPopupItem( 33, OB, mesh_part + " " + hyp_alg ); // DELETE
popupMgr()->insert( separator(), -1, 0 );
#include "DriverMED_W_SMESHDS_Mesh.h"
#include "DriverMED_R_SMESHDS_Mesh.h"
+#ifdef WITH_CGNS
#include "DriverCGNS_Read.hxx"
+#endif
#include "SALOMEDS_Tool.hxx"
#include "SALOME_NamingService.hxx"
{
Unexpect aCatch(SALOME_SalomeException);
+ SMESH::mesh_array_var aResult = new SMESH::mesh_array();
+
+#ifdef WITH_CGNS
// Retrieve nb meshes from the file
DriverCGNS_Read myReader;
myReader.SetFile( theFileName );
int nbMeshes = myReader.GetNbMeshes(aStatus);
theStatus = (SMESH::DriverMED_ReadStatus)aStatus;
- SMESH::mesh_array_var aResult = new SMESH::mesh_array();
aResult->length( nbMeshes );
{ // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups()
// Dump creation of groups
for ( int i = 0; i < aResult->length(); ++i )
SMESH::ListOfGroups_var groups = aResult[ i ]->GetGroups();
+#else
+ THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR);
+#endif
return aResult._retn();
}
CORBA::Boolean overwrite)
throw (SALOME::SALOME_Exception)
{
+#ifdef WITH_CGNS
Unexpect aCatch(SALOME_SalomeException);
PrepareForWriting(file,overwrite);
TPythonDump() << _this() << ".ExportCGNS( "
<< meshPart<< ", r'" << file << "', " << overwrite << ")";
+#else
+ THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR);
+#endif
}
//=============================================================================