From d75a8ffd18a414b75f421778d6e14523b33b805d Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 21 Jul 2005 13:31:34 +0000 Subject: [PATCH] To make reusable some C++ idioms that are implemented in MEDWrapper of MED module --- src/CONVERTOR/Makefile.in | 17 ++++++++++--- src/CONVERTOR/VISU_Convertor.hxx | 42 ++------------------------------ 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/src/CONVERTOR/Makefile.in b/src/CONVERTOR/Makefile.in index 3b9480e9..fcbad7b7 100644 --- a/src/CONVERTOR/Makefile.in +++ b/src/CONVERTOR/Makefile.in @@ -32,12 +32,18 @@ VPATH=.:@srcdir@ @COMMENCE@ -EXPORT_HEADERS = VISU_Convertor.hxx VISU_Convertor_impl.hxx VISU_ConvertorUtils.hxx VISU_ExtractUnstructuredGrid.hxx +EXPORT_HEADERS = VISU_Convertor.hxx \ + VISU_Convertor_impl.hxx \ + VISU_ConvertorUtils.hxx \ + VISU_ExtractUnstructuredGrid.hxx # Libraries targets LIB = libVisuConvertor.la -LIB_SRC = VISU_Convertor.cxx VISU_Convertor_impl.cxx VISU_ConvertorUtils.cxx VISU_ExtractUnstructuredGrid.cxx \ +LIB_SRC = VISU_Convertor.cxx \ + VISU_Convertor_impl.cxx \ + VISU_ConvertorUtils.cxx \ + VISU_ExtractUnstructuredGrid.cxx \ VISU_MedConvertor.cxx # Executables targets @@ -45,7 +51,12 @@ BIN = VISUConvertor BIN_SRC = CPPFLAGS+= -ftemplate-depth-32 $(VTK_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome -I${MED_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) + -I${KERNEL_ROOT_DIR}/include/salome \ + -I${MED_ROOT_DIR}/include/salome \ + $(BOOST_CPPFLAGS) + LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) -L${MED_ROOT_DIR}/lib/salome -lMEDWrapper + LDFLAGSFORBIN=$(LDFLAGS) -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase + @CONCLUDE@ diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index 31e38ff3..ee0b46e8 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -36,53 +36,15 @@ #include #include -#include +#include "MED_SharedPtr.hxx" class vtkUnstructuredGrid; namespace VISU{ - template class SharedPtr: public boost::shared_ptr - { - public: - SharedPtr() {} - - template - explicit SharedPtr(Y * p): - boost::shared_ptr(p) - {} - - template - SharedPtr(SharedPtr const & r): - boost::shared_ptr(r,boost::detail::dynamic_cast_tag()) - {} - - template - SharedPtr & operator=(SharedPtr const & r) - { - boost::shared_ptr(r,boost::detail::dynamic_cast_tag()).swap(*this); - return *this; - } + using MED::SharedPtr; - template SharedPtr& operator()(Y * p) // Y must be complete - { - return operator=(SharedPtr(p)); - } - - operator const T& () const - { - return *(this->get()); - } - - operator T& () - { - return *(this->get()); - } - - }; //--------------------------------------------------------------- - - enum TEntity {NODE_ENTITY, EDGE_ENTITY, FACE_ENTITY, CELL_ENTITY}; struct TMesh; -- 2.39.2