Commit ccffdc90 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'mesh-friend-exports'

c42b8e83 ctest: use add_test(NAME) signature
4364c5bd exodus: publicly link to vtkCommonDataModel
219d6ec7 moab: export error handling functions
3302e724 mesh: export CellTypes functions
8c7b7a13 exodus: get a std::string from paths
9b07ad5a

 smtkMesh: add export symbol to friend declarations
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: David Thompson's avatarDavid Thompson <david.thompson@kitware.com>
Merge-request: !14
parents f0b4c67b c42b8e83
......@@ -27,5 +27,5 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
# if (SMTK_ENABLE_CGM_SESSION)
# target_link_libraries(add_a_session smtkCGMSession)
# endif (SMTK_ENABLE_CGM_SESSION)
# add_test(tut-add_a_session add_a_session)
# add_test(NAME tut-add_a_session COMMAND add_a_session)
#endif()
......@@ -27,5 +27,5 @@ if (SMTK_ENABLE_TESTING)
if (SMTK_ENABLE_CGM_SESSION)
target_link_libraries(implement_an_operator smtkCGMSession)
endif (SMTK_ENABLE_CGM_SESSION)
add_test(tut-implement_an_operator implement_an_operator)
add_test(NAME tut-implement_an_operator COMMAND implement_an_operator)
endif()
add_executable(list-cgm-engines list-cgm-engines.cxx)
target_link_libraries(list-cgm-engines smtkCGMSession smtkCore)
add_test(list-cgm-engines list-cgm-engines -test-set-default)
add_test(NAME list-cgm-engines COMMAND list-cgm-engines -test-set-default)
add_executable(test-operators test-operators.cxx)
target_link_libraries(test-operators smtkCGMSession smtkCore ${Boost_LIBRARIES})
add_test(test-operators test-operators)
add_test(NAME test-operators COMMAND test-operators)
ADD_EXECUTABLE(DiscreteSerializationTest DiscreteSerializationTest.cxx)
TARGET_LINK_LIBRARIES(DiscreteSerializationTest smtkDiscreteSession vtkSMTKDiscreteModel)
add_test(discreteModelSerializationTest DiscreteSerializationTest)
add_test(NAME discreteModelSerializationTest COMMAND DiscreteSerializationTest)
ADD_EXECUTABLE(Discrete2DModelTopologyTest Discrete2DModelTopologyTest.cxx)
TARGET_LINK_LIBRARIES(Discrete2DModelTopologyTest smtkDiscreteSession vtkSMTKDiscreteModel)
add_test(discreteModel2DModelTopologyTest Discrete2DModelTopologyTest)
add_test(NAME discreteModel2DModelTopologyTest COMMAND Discrete2DModelTopologyTest)
# ADD_EXECUTABLE(DiscreteParserV4Test DiscreteParserV4Test.cxx)
# TARGET_LINK_LIBRARIES(DiscreteParserV4Test smtkDiscreteSession vtkSMTKDiscreteModel)
# add_test(discreteModelParserV4Test
# DiscreteParserV4Test
# add_test(NAME discreteModelParserV4Test
# COMMAND DiscreteParserV4Test
# ${SMTK_DATA_DIR}/cmb/CMBParserV4Test.cmb )
# ADD_EXECUTABLE(DiscreteModelEventsTest DiscreteModelEventsTest.cxx)
# TARGET_LINK_LIBRARIES(DiscreteModelEventsTest smtkDiscreteSession)
# add_test(ModelBuilderModelEventsTest
# DiscreteModelEventsTest
# add_test(NAME ModelBuilderModelEventsTest
# COMMAND DiscreteModelEventsTest
# ${SMTK_DATA_DIR}/test2D.cmb ${SMTK_DATA_DIR}/smooth_surface.cmb)
......@@ -28,6 +28,7 @@ add_library(smtkExodusSession ${exodusSrcs})
target_link_libraries(smtkExodusSession
LINK_PUBLIC
smtkCore
vtkCommonDataModel
LINK_PRIVATE
vtkIOExodus
vtkIONetCDF
......@@ -36,7 +37,6 @@ target_link_libraries(smtkExodusSession
vtkFiltersGeneral
vtkIOParallelExodus
vtkFiltersGeometry
vtkCommonDataModel
${Boost_LIBRARIES}
)
smtk_export_header(smtkExodusSession Exports.h)
......
......@@ -181,7 +181,7 @@ smtk::model::OperatorResult ReadOperator::readExodus()
// Now iterate over the dataset and mark each block (leaf or not)
// with information needed by the session to determine how it should
// be presented.
MarkMeshInfo(modelOut, dim, path(filename).stem().c_str(), EXO_MODEL, -1);
MarkMeshInfo(modelOut, dim, path(filename).stem().string<std::string>().c_str(), EXO_MODEL, -1);
vtkMultiBlockDataSet* elemBlocks =
vtkMultiBlockDataSet::SafeDownCast(
modelOut->GetBlock(0));
......@@ -266,7 +266,7 @@ smtk::model::OperatorResult ReadOperator::readSLAC()
modelOut->SetBlock(0, surfBlocks.GetPointer());
modelOut->SetBlock(1, voluBlocks.GetPointer());
MarkMeshInfo(modelOut.GetPointer(), 3, path(filename).stem().c_str(), EXO_MODEL, -1);
MarkMeshInfo(modelOut.GetPointer(), 3, path(filename).stem().string<std::string>().c_str(), EXO_MODEL, -1);
MarkSLACMeshWithChildren(surfBlocks.GetPointer(), 2, "surfaces", EXO_SIDE_SETS, EXO_SIDE_SET);
MarkSLACMeshWithChildren(voluBlocks.GetPointer(), 3, "volumes", EXO_BLOCKS, EXO_BLOCK);
......@@ -412,7 +412,7 @@ smtk::model::OperatorResult ReadOperator::readLabelMap()
modelOut->SetNumberOfBlocks(1);
modelOut->SetBlock(0, img.GetPointer());
MarkMeshInfo(modelOut.GetPointer(), imgDim, path(filename).stem().c_str(), EXO_MODEL, -1);
MarkMeshInfo(modelOut.GetPointer(), imgDim, path(filename).stem().string<std::string>().c_str(), EXO_MODEL, -1);
MarkMeshInfo(img.GetPointer(), imgDim, labelname.c_str(), EXO_LABEL_MAP, -1);
for (int i = 0; i < numLabels; ++i)
{
......
......@@ -7,7 +7,7 @@ set(ioTests
foreach (test ${ioTests})
add_executable(${test} ${test}.cxx)
target_link_libraries(${test} smtkCore smtkCoreModelTesting)
add_test(${test} ${test})
add_test(NAME ${test} COMMAND ${test})
endforeach()
......@@ -16,8 +16,8 @@ if (SMTK_DATA_DIR)
set(writer_test ResourceSetWriterTest)
add_executable(${writer_test} ${writer_test}.cxx)
target_link_libraries(${writer_test} smtkCore ${Boost_LIBRARIES})
add_test(${writer_test}
${writer_test}
add_test(NAME ${writer_test}
COMMAND ${writer_test}
${SMTK_DATA_DIR}/smtk/attribute/Basic2DFluid.sbt
${SMTK_DATA_DIR}/smtk/attribute/copyAttributeTest.sbi
writer_output.crf
......@@ -26,8 +26,8 @@ if (SMTK_DATA_DIR)
set(reader_test ResourceSetReaderTest)
add_executable(${reader_test} ${reader_test}.cxx)
target_link_libraries(${reader_test} smtkCore ${Boost_LIBRARIES})
add_test(${reader_test}
${reader_test}
add_test(NAME ${reader_test}
COMMAND ${reader_test}
${SMTK_DATA_DIR}/smtk/attribute/resourceTest/resources.xml
2
)
......
......@@ -35,12 +35,12 @@ namespace mesh {
//a new MeshSet using Collection::createMesh.
class SMTKCORE_EXPORT CellSet
{
friend CellSet set_intersect( const CellSet& a, const CellSet& b);
friend CellSet set_difference( const CellSet& a, const CellSet& b);
friend CellSet set_union( const CellSet& a, const CellSet& b );
friend CellSet point_intersect( const CellSet& a, const CellSet& b, ContainmentType t);
friend CellSet point_difference( const CellSet& a, const CellSet& b, ContainmentType t);
friend void for_each( const CellSet& a, CellForEach& filter);
friend SMTKCORE_EXPORT CellSet set_intersect( const CellSet& a, const CellSet& b);
friend SMTKCORE_EXPORT CellSet set_difference( const CellSet& a, const CellSet& b);
friend SMTKCORE_EXPORT CellSet set_union( const CellSet& a, const CellSet& b );
friend SMTKCORE_EXPORT CellSet point_intersect( const CellSet& a, const CellSet& b, ContainmentType t);
friend SMTKCORE_EXPORT CellSet point_difference( const CellSet& a, const CellSet& b, ContainmentType t);
friend SMTKCORE_EXPORT void for_each( const CellSet& a, CellForEach& filter);
friend class Collection; //required for creation of new meshes, deletion of cells
public:
......
......@@ -11,6 +11,8 @@
#ifndef __smtk_mesh_CellTypes_h
#define __smtk_mesh_CellTypes_h
#include "smtk/CoreExports.h"
#include <bitset>
#include <string>
......@@ -36,8 +38,8 @@ enum CellType
CellType_MAX = 9
};
int verticesPerCell(CellType ctype);
std::string cellTypeSummary(CellType ctype, int flag = 0);
SMTKCORE_EXPORT int verticesPerCell(CellType ctype);
SMTKCORE_EXPORT std::string cellTypeSummary(CellType ctype, int flag = 0);
//Need a basic blitter for cell queries, mainly used by
//TypeSet
......
......@@ -89,7 +89,7 @@ public:
private:
friend void extractTessellation( const smtk::mesh::CellSet&, const smtk::mesh::PointSet& , PreAllocatedTessellation& );
friend SMTKCORE_EXPORT void extractTessellation( const smtk::mesh::CellSet&, const smtk::mesh::PointSet& , PreAllocatedTessellation& );
boost::int64_t* m_connectivity;
boost::int64_t* m_cellLocations;
unsigned char* m_cellTypes;
......
......@@ -35,10 +35,10 @@ typedef std::set<smtk::mesh::MeshSet> MeshSets;
//and a vector/range of mesh entities
class SMTKCORE_EXPORT MeshSet
{
friend MeshSet set_intersect( const MeshSet& a, const MeshSet& b);
friend MeshSet set_difference( const MeshSet& a, const MeshSet& b);
friend MeshSet set_union( const MeshSet& a, const MeshSet& b );
friend void for_each( const MeshSet& a, MeshForEach& filter);
friend SMTKCORE_EXPORT MeshSet set_intersect( const MeshSet& a, const MeshSet& b);
friend SMTKCORE_EXPORT MeshSet set_difference( const MeshSet& a, const MeshSet& b);
friend SMTKCORE_EXPORT MeshSet set_union( const MeshSet& a, const MeshSet& b );
friend SMTKCORE_EXPORT void for_each( const MeshSet& a, MeshForEach& filter);
friend class Collection; //required for deletion of meshes
public:
//default constructor generates an invalid MeshSet
......
......@@ -22,10 +22,10 @@ namespace mesh {
class SMTKCORE_EXPORT PointSet
{
friend PointSet set_intersect( const PointSet& a, const PointSet& b);
friend PointSet set_difference( const PointSet& a, const PointSet& b);
friend PointSet set_union( const PointSet& a, const PointSet& b );
friend void for_each( const PointSet& a, PointForEach& filter);
friend SMTKCORE_EXPORT PointSet set_intersect( const PointSet& a, const PointSet& b);
friend SMTKCORE_EXPORT PointSet set_difference( const PointSet& a, const PointSet& b);
friend SMTKCORE_EXPORT PointSet set_union( const PointSet& a, const PointSet& b );
friend SMTKCORE_EXPORT void for_each( const PointSet& a, PointForEach& filter);
public:
PointSet(const smtk::mesh::CollectionPtr& parent,
const smtk::mesh::HandleRange& points);
......
......@@ -18,15 +18,15 @@ target_link_libraries(demoReportArrangements smtkCore smtkCoreModelTesting)
################################################################################
add_executable(unitManager unitManager.cxx)
target_link_libraries(unitManager smtkCore smtkCoreModelTesting)
add_test(unitManager unitManager)
add_test(NAME unitManager COMMAND unitManager)
add_executable(unitIterators unitIterators.cxx)
target_link_libraries(unitIterators smtkCore smtkCoreModelTesting)
add_test(unitIterators unitIterators)
add_test(NAME unitIterators COMMAND unitIterators)
add_executable(unitTessellation unitTessellation.cxx)
target_link_libraries(unitTessellation smtkCore smtkCoreModelTesting)
add_test(unitTessellation unitTessellation)
add_test(NAME unitTessellation COMMAND unitTessellation)
add_executable(unitOperator unitOperator.cxx)
smtk_operator_xml( "${CMAKE_CURRENT_SOURCE_DIR}/unitOutcomeOperator.sbt" unitOperatorXML)
......@@ -35,37 +35,37 @@ target_link_libraries(unitOperator smtkCore smtkCoreModelTesting)
if (SMTK_ENABLE_CGM_SESSION)
target_link_libraries(unitOperator smtkCGMSession)
endif (SMTK_ENABLE_CGM_SESSION)
add_test(unitOperator unitOperator)
add_test(NAME unitOperator COMMAND unitOperator)
add_executable(unitEntityRef unitEntityRef.cxx)
target_link_libraries(unitEntityRef smtkCore smtkCoreModelTesting)
add_test(unitEntityRef unitEntityRef)
add_test(NAME unitEntityRef COMMAND unitEntityRef)
add_executable(unitDefaultSession unitDefaultSession.cxx)
smtk_operator_xml( "${CMAKE_CURRENT_SOURCE_DIR}/unitForwardingOperator.sbt" unitOperatorXML)
target_include_directories(unitDefaultSession PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_link_libraries(unitDefaultSession smtkCore smtkCoreModelTesting)
add_test(unitDefaultSession unitDefaultSession)
add_test(NAME unitDefaultSession COMMAND unitDefaultSession)
add_executable(unitDescriptivePhrase unitDescriptivePhrase.cxx)
target_link_libraries(unitDescriptivePhrase smtkCore smtkCoreModelTesting)
add_executable(unitArrangement unitArrangement.cxx)
target_link_libraries(unitArrangement smtkCore)
add_test(unitArrangement unitArrangement)
add_test(NAME unitArrangement COMMAND unitArrangement)
add_executable(unitEntity unitEntity.cxx)
target_link_libraries(unitEntity smtkCore smtkCoreModelTesting)
add_test(unitEntity unitEntity)
add_test(NAME unitEntity COMMAND unitEntity)
add_executable(benchmarkModel benchmarkModel.cxx)
target_link_libraries(benchmarkModel smtkCore smtkCoreModelTesting)
#add_test(benchmarkModel benchmarkModel)
#add_test(NAME benchmarkModel COMMAND benchmarkModel)
################################################################################
# Tests that require SMTK_DATA_DIR
################################################################################
if (SMTK_DATA_DIR AND EXISTS ${SMTK_DATA_DIR}/ReadMe.mkd)
add_test(unitDescriptivePhrase unitDescriptivePhrase
add_test(NAME unitDescriptivePhrase COMMAND unitDescriptivePhrase
"${SMTK_DATA_DIR}/smtk/simple.json")
endif()
......@@ -5,6 +5,8 @@
#define __func__ __FUNCTION__
#endif
#include "moab_export.h"
#include "moab/Types.hpp"
#include <sstream>
......@@ -17,18 +19,23 @@ namespace moab {
enum ErrorType {MB_ERROR_TYPE_NEW_GLOBAL = 0, MB_ERROR_TYPE_NEW_LOCAL = 1, MB_ERROR_TYPE_EXISTING = 2};
//! Initialize MOAB error handler (e.g. create a utility object for printing error output)
MOAB_EXPORT
void MBErrorHandler_Init();
//! Finalize MOAB error handler (e.g. delete the utility object for printing error output)
MOAB_EXPORT
void MBErrorHandler_Finalize();
//! Indicates whether MBErrorHandler_Init has been called
MOAB_EXPORT
bool MBErrorHandler_Initialized();
//! Get information about the last error
MOAB_EXPORT
void MBErrorHandler_GetLastError(std::string& error);
//! Routine that is called to create a new error or handle an existing one
MOAB_EXPORT
ErrorCode MBError(int line, const char* func, const char* file, const char* dir,
ErrorCode err_code, const char* err_msg, ErrorType err_type);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment