[MOAB-dev] r1224 - in MOAB/trunk: . test tools/qvdual
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Tue Jul 31 07:32:25 CDT 2007
Author: tautges
Date: 2007-07-31 07:32:25 -0500 (Tue, 31 Jul 2007)
New Revision: 1224
Modified:
MOAB/trunk/MeshTopoUtil.cpp
MOAB/trunk/Tqdcfr.cpp
MOAB/trunk/configure.in
MOAB/trunk/test/Makefile.am
MOAB/trunk/tools/qvdual/DrawDual.cpp
MOAB/trunk/tools/qvdual/DrawDual.hpp
MOAB/trunk/tools/qvdual/vtkMOABUtils.cxx
MOAB/trunk/tools/qvdual/vtkMOABUtils.h
Log:
tools/qvdual/DrawDual.cpp/.hpp, vtkMOABUtils.cxx/.h, uiQVDual.ui.h:
corrections to make qvdual work
with more recent versions of vtk and graphviz
configure.in: changing to make work with new versions of vtk and graphviz
MeshTopoUtil.cpp: fixing typo in get_bridge_entities
Tqdcfr.cpp: making various tag types integer rather than opaque
test/Makefile.am: changing .cub files included with make dist
Modified: MOAB/trunk/MeshTopoUtil.cpp
===================================================================
--- MOAB/trunk/MeshTopoUtil.cpp 2007-07-26 06:43:08 UTC (rev 1223)
+++ MOAB/trunk/MeshTopoUtil.cpp 2007-07-31 12:32:25 UTC (rev 1224)
@@ -392,7 +392,7 @@
// get the vertices making up this sub-entity
int num_bridge_verts = MBCN::VerticesPerEntity( MBCN::SubEntityType( from_type, bridge_dim, i ) );
MBCN::SubEntityVertexIndices( from_type, bridge_dim, i, bridge_indices );
- for (int j = 0; j < num_bridge_verts; ++i)
+ for (int j = 0; j < num_bridge_verts; ++j)
bridge_verts[j]= connect[bridge_indices[j]];
//MBCN::SubEntityConn(connect, from_type, bridge_dim, i, &bridge_verts[0], num_bridge_verts);
Modified: MOAB/trunk/Tqdcfr.cpp
===================================================================
--- MOAB/trunk/Tqdcfr.cpp 2007-07-26 06:43:08 UTC (rev 1223)
+++ MOAB/trunk/Tqdcfr.cpp 2007-07-31 12:32:25 UTC (rev 1224)
@@ -150,7 +150,7 @@
MBErrorCode result = mdbImpl->tag_get_handle("cubIdTag", cubIdTag);
if (MB_SUCCESS != result || MB_TAG_NOT_FOUND == result) {
int default_val = -1;
- result = mdbImpl->tag_create("cubIdTag", 4, MB_TAG_DENSE,
+ result = mdbImpl->tag_create("cubIdTag", sizeof(int), MB_TAG_DENSE, MB_TYPE_INTEGER,
cubIdTag, &default_val);
assert (MB_SUCCESS == result);
}
@@ -368,8 +368,8 @@
if (0 != nodeset_offset) {
if (0 == nsTag) {
int default_val = 0;
- tmp_result = mdbImpl->tag_create(DIRICHLET_SET_TAG_NAME, 4, MB_TAG_SPARSE,
- nsTag, &default_val);
+ tmp_result = mdbImpl->tag_create(DIRICHLET_SET_TAG_NAME, sizeof(int), MB_TAG_SPARSE,
+ MB_TYPE_INTEGER, nsTag, &default_val);
if (MB_SUCCESS != tmp_result) result = tmp_result;
}
if (MB_SUCCESS == tmp_result)
@@ -382,8 +382,8 @@
if (0 != sideset_offset) {
if (0 == ssTag) {
int default_val = 0;
- tmp_result = mdbImpl->tag_create(NEUMANN_SET_TAG_NAME, 4, MB_TAG_SPARSE,
- ssTag, &default_val);
+ tmp_result = mdbImpl->tag_create(NEUMANN_SET_TAG_NAME, sizeof(int), MB_TAG_SPARSE,
+ MB_TYPE_INTEGER, ssTag, &default_val);
if (MB_SUCCESS != tmp_result) result = tmp_result;
}
if (MB_SUCCESS == tmp_result)
@@ -513,7 +513,8 @@
FREADD(sideseth->numDF);
MBTag distFactorTag;
double *dum_val = NULL;
- MBErrorCode result = mdbImpl->tag_create("distFactor", sizeof(double*), MB_TAG_SPARSE, distFactorTag,
+ MBErrorCode result = mdbImpl->tag_create("distFactor", sizeof(double*), MB_TAG_SPARSE,
+ distFactorTag,
&dum_val);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
double *dist_data = new double[ss_dfs.size()];
@@ -573,7 +574,7 @@
int def_val = 1;
MBTag sense_tag;
tmp_result = mdbImpl->tag_create("SENSE", sizeof(int),
- MB_TAG_SPARSE, sense_tag, &def_val);
+ MB_TAG_SPARSE, MB_TYPE_INTEGER, sense_tag, &def_val);
if (tmp_result != MB_SUCCESS && tmp_result != MB_ALREADY_ALLOCATED) result = tmp_result;
def_val = -1;
tmp_result = mdbImpl->tag_set_data(sense_tag, &reverse_set, 1, &def_val);
@@ -632,7 +633,7 @@
int def_val = 1;
MBTag sense_tag;
tmp_result = mdbImpl->tag_create("SENSE", sizeof(int),
- MB_TAG_SPARSE, sense_tag, &def_val);
+ MB_TAG_SPARSE, MB_TYPE_INTEGER, sense_tag, &def_val);
if (tmp_result != MB_SUCCESS && tmp_result != MB_ALREADY_ALLOCATED) result = tmp_result;
def_val = -1;
tmp_result = mdbImpl->tag_set_data(sense_tag, &reverse_set, 1, &def_val);
@@ -682,7 +683,7 @@
// now do something with them...
MBErrorCode result = mdbImpl->tag_create("Block_Attributes",
blockh->attribOrder*sizeof(double), MB_TAG_SPARSE,
- block_attribs, NULL);
+ MB_TYPE_DOUBLE, block_attribs, NULL);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
result = mdbImpl->tag_set_data(block_attribs, &(blockh->setHandle), 1,
&(dbl_buf[0]));
@@ -1030,7 +1031,7 @@
if (MB_SUCCESS != result || 0 == fixedFlagTag) {
int dum_val = 0;
result = mdbImpl->tag_create("NodeFixed", sizeof(int), MB_TAG_SPARSE,
- fixedFlagTag, &dum_val);
+ MB_TYPE_INTEGER, fixedFlagTag, &dum_val);
if (MB_SUCCESS != result) return result;
}
}
@@ -1496,8 +1497,8 @@
int has_mid_nodes[] = {0, 0, 0, 0};
static MBTag hasMidNodesTag = 0;
if (0 == hasMidNodesTag) {
- result = instance->mdbImpl->tag_create(HAS_MID_NODES_TAG_NAME, 4*sizeof(int), MB_TAG_SPARSE, hasMidNodesTag,
- has_mid_nodes);
+ result = instance->mdbImpl->tag_create(HAS_MID_NODES_TAG_NAME, 4*sizeof(int), MB_TAG_SPARSE,
+ MB_TYPE_INTEGER, hasMidNodesTag, has_mid_nodes);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
}
@@ -1669,16 +1670,16 @@
int default_val = -1;
MBErrorCode result;
- result = instance->mdbImpl->tag_create(GLOBAL_ID_TAG_NAME, 4, MB_TAG_DENSE,
+ result = instance->mdbImpl->tag_create(GLOBAL_ID_TAG_NAME, sizeof(int), MB_TAG_DENSE, MB_TYPE_INTEGER,
instance->globalIdTag, &default_val);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
if (feModelHeader.geomArray.numEntities > 0) {
- result = instance->mdbImpl->tag_create(GEOM_DIMENSION_TAG_NAME, 4, MB_TAG_SPARSE,
- instance->geomTag, &default_val);
+ result = instance->mdbImpl->tag_create(GEOM_DIMENSION_TAG_NAME, sizeof(int), MB_TAG_SPARSE,
+ MB_TYPE_INTEGER, instance->geomTag, &default_val);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
- result = instance->mdbImpl->tag_create("UNIQUE_ID", 4, MB_TAG_SPARSE,
+ result = instance->mdbImpl->tag_create("UNIQUE_ID", sizeof(int), MB_TAG_SPARSE, MB_TYPE_INTEGER,
instance->uniqueIdTag, &default_val);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
@@ -1700,8 +1701,8 @@
}
if (feModelHeader.blockArray.numEntities > 0) {
- result = instance->mdbImpl->tag_create(MATERIAL_SET_TAG_NAME, 4, MB_TAG_SPARSE,
- instance->blockTag, &default_val);
+ result = instance->mdbImpl->tag_create(MATERIAL_SET_TAG_NAME, sizeof(int), MB_TAG_SPARSE,
+ MB_TYPE_INTEGER, instance->blockTag, &default_val);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
result = Tqdcfr::BlockHeader::read_info_header(data_version, modelOffset,
@@ -1712,8 +1713,8 @@
print_block_headers("Block headers:", feBlockH, feModelHeader.blockArray.numEntities);
}
if (feModelHeader.nodesetArray.numEntities > 0) {
- result = instance->mdbImpl->tag_create(DIRICHLET_SET_TAG_NAME, 4, MB_TAG_SPARSE,
- instance->nsTag, &default_val);
+ result = instance->mdbImpl->tag_create(DIRICHLET_SET_TAG_NAME, sizeof(int), MB_TAG_SPARSE,
+ MB_TYPE_INTEGER, instance->nsTag, &default_val);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
result = Tqdcfr::NodesetHeader::read_info_header(modelOffset,
@@ -1724,8 +1725,8 @@
print_nodeset_headers("Nodeset headers:", feNodeSetH, feModelHeader.nodesetArray.numEntities);
}
if (feModelHeader.sidesetArray.numEntities > 0) {
- result = instance->mdbImpl->tag_create(NEUMANN_SET_TAG_NAME, 4, MB_TAG_SPARSE,
- instance->ssTag, &default_val);
+ result = instance->mdbImpl->tag_create(NEUMANN_SET_TAG_NAME, sizeof(int), MB_TAG_SPARSE,
+ MB_TYPE_INTEGER, instance->ssTag, &default_val);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
result = Tqdcfr::SidesetHeader::read_info_header(modelOffset,
Modified: MOAB/trunk/configure.in
===================================================================
--- MOAB/trunk/configure.in 2007-07-26 06:43:08 UTC (rev 1223)
+++ MOAB/trunk/configure.in 2007-07-31 12:32:25 UTC (rev 1224)
@@ -354,7 +354,7 @@
GRAPH_DIR=
for dir in /usr /usr/local; do
if test "x" = "x$GRAPH_DIR"; then
- AC_CHECK_FILE([${dir}/include/graphviz/dotneato.h],[GRAPH_DIR="$dir"])
+ AC_CHECK_FILE([${dir}/include/graphviz/gvc.h],[GRAPH_DIR="$dir"])
fi
done
AC_MSG_CHECKING([for GraphViz include dir])
@@ -377,7 +377,7 @@
GRAPH_INC_DIR=
for dir in ${GRAPH_DIR}/include/graphviz ${GRAPH_DIR}/include ${GRAPH_DIR}; do
if test "x" = "x$GRAPH_INC_DIR"; then
- AC_CHECK_FILE([${dir}/dotneato.h],[GRAPH_INC_DIR="-I$dir"])
+ AC_CHECK_FILE([${dir}/gvc.h],[GRAPH_INC_DIR="-I$dir"])
fi
done
AC_MSG_CHECKING([for GraphViz include dir])
@@ -405,16 +405,15 @@
;;
esac
- GRAPH_LIBS="$GRAPH_LIB_DIR -ldotneato -lgraph"
+ GRAPH_LIBS="$GRAPH_LIB_DIR -lgvc -lgraph"
old_CXXFLAGS="$CXXFLAGS"
old_CPPFLAGS="$CPPFLAGS"
CXXFLAGS="$GRAPH_INC_DIR"
CPPFLAGS="$GRAPH_INC_DIR"
old_LIBS="$LIBS"
LIBS=$GRAPH_LIBS
- AC_CHECK_HEADERS([dotneato.h],[],[AC_MSG_WARN([Missing GraphViz header]); GRAPHVIZ_MISSING=yes])
- AC_CHECK_LIB([graph],[aginitlib],[],[AC_MSG_WARN([Cannot find GraphViz library: -lgraph]); GRAPHVIZ_MISSING=yes])
- AC_CHECK_LIB([dotneato],[gvContext],[],[AC_MSG_WARN([Cannot find GraphViz library: -ldotneato]); GRAPHVIZ_MISSING=yes],[-lgraph])
+ AC_CHECK_HEADERS([gvc.h],[],[AC_MSG_WARN([Missing GraphViz header]); GRAPHVIZ_MISSING=yes])
+ AC_CHECK_LIB([gvc],[gvContext],[],[AC_MSG_WARN([Cannot find GraphViz library: -lgraph]); GRAPHVIZ_MISSING=yes])
LIBS="$old_LIBS"
CXXFLAGS="$old_CXXFLAGS"
CPPFLAGS="$old_CPPFLAGS"
@@ -450,7 +449,7 @@
xyes|x)
VTK_LIB_DIR=
VTK_INC_DIR=
- for dir in /usr/include/vtk /usr/local/include/vtk /include/vtk; do
+ for dir in /usr/include/vtk /usr/local/include/vtk /include/vtk /usr/include/vtk-5.0; do
if test "x" = "x$VTK_INC_DIR"; then
AC_CHECK_FILE([${dir}/vtkRenderer.h],[VTK_INC_DIR="-I$dir"])
fi
@@ -461,11 +460,24 @@
else
VTK_INCLUDES="$VTK_INC_DIR"
fi
+ old_LIBS="$LIBS"
+ for dir in /usr/lib/vtk /usr/lib /usr/bin /usr; do
+ if test "x" = "x$VTK_LIB_DIR"; then
+ LIBS="$old_LIBS -L$dir"
+ unset ac_cv_lib_vtkCommon
+ unset ac_cv_lib_vtkCommon_main
+ AC_HAVE_LIBRARY([vtkCommon],[VTK_LIB_DIR=$dir])
+ fi
+ done
+ if test "x" = "x$VTK_LIB_DIR"; then
+ VTK_MISSING=yes
+ fi
+ LIBS="$old_LIBS"
;;
x?*)
VTK_LIB_DIR=
VTK_INC_DIR=
- for dir in ${VTK_DIR}/include/vtk ${VTK_DIR}/include ${VTK_DIR}; do
+ for dir in ${VTK_DIR}/include/vtk ${VTK_DIR}/include/vtk/Rendering ${VTK_DIR}/include ${VTK_DIR}; do
if test "x" = "x$VTK_INC_DIR"; then
AC_CHECK_FILE([${dir}/vtkRenderer.h],[VTK_INC_DIR="-I$dir"])
fi
@@ -490,9 +502,9 @@
for dir in ${VTK_DIR}/lib/vtk ${VTK_DIR}/lib ${VTK_DIR}/bin ${VTK_DIR}; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- unset ac_cv_lib_vtkexpat
- unset ac_cv_lib_vtkexpat_main
- AC_HAVE_LIBRARY([vtkexpat],[VTK_LIB_DIR=$dir])
+ unset ac_cv_lib_vtkCommon
+ unset ac_cv_lib_vtkCommon_main
+ AC_HAVE_LIBRARY([vtkCommon],[VTK_LIB_DIR=$dir])
fi
done
if test "x" = "x$VTK_LIB_DIR"; then
@@ -549,7 +561,7 @@
SNL_CHECK_LIB_LIST([vtkexoIIc], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
SNL_CHECK_LIB_LIST([vtkIO], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
SNL_CHECK_LIB_LIST([vtkRendering], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- SNL_CHECK_LIB_LIST([vtkParallel], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ SNL_CHECK_LIB_LIST([vtkParallel], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
SNL_CHECK_LIB_LIST([vtkHybrid], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
# Make sure we found at least vtkCommon and vtkRendering
Modified: MOAB/trunk/test/Makefile.am
===================================================================
--- MOAB/trunk/test/Makefile.am 2007-07-26 06:43:08 UTC (rev 1223)
+++ MOAB/trunk/test/Makefile.am 2007-07-31 12:32:25 UTC (rev 1224)
@@ -10,7 +10,9 @@
4k-tri-plane.vtk \
4tet.g \
8hex.g \
- block.cub \
+ brick_cubit10.1.cub \
+ brick_cubit10.2.cub \
+ brick_cubit10.cub \
cell1.gen.gz \
cell2.gen.gz \
mb_big_test.g.gz \
Modified: MOAB/trunk/tools/qvdual/DrawDual.cpp
===================================================================
--- MOAB/trunk/tools/qvdual/DrawDual.cpp 2007-07-26 06:43:08 UTC (rev 1223)
+++ MOAB/trunk/tools/qvdual/DrawDual.cpp 2007-07-31 12:32:25 UTC (rev 1224)
@@ -44,11 +44,11 @@
extern "C"
{
-#include "dotneato.h"
+#include "gvc.h"
// extern GVC_t *gvContext();
}
-const bool my_debug = false;
+const bool my_debug = true;
const int SHEET_WINDOW_SIZE = 500;
@@ -227,7 +227,7 @@
else {
// more than one - traverse, choosing the chord if any first
actors->InitTraversal();
- while (tmp_actor = actors->GetNextItem()) {
+ while ((tmp_actor = actors->GetNextItem())) {
MBEntityHandle this_set = vtkMOABUtils::propSetMap[tmp_actor];
if (0 == this_set) continue;
// get whether it's a dual surface or dual curve
@@ -443,7 +443,7 @@
agwrite(this_gw.gvizGraph, stdout);
}
// neato_init_graph(this_gw.gvizGraph);
- neato_layout(this_gw.gvizGraph);
+ gvLayout(gvContext(), this_gw.gvizGraph, "neato");
// adjustNodes(this_gw.gvizGraph);
// spline_edges(this_gw.gvizGraph);
// dotneato_postprocess(this_gw.gvizGraph, neato_nodesize);
@@ -1320,8 +1320,8 @@
endloop = loop_verts.end();
if ((firstv == endloop && lastv != endloop) ||
(firstv != endloop && lastv == endloop)) {
- agxset(this_gved, asym_weight->index, "10");
- agxset(this_gved, asym_len->index, "0.1");
+ // agxset(this_gved, asym_weight->index, "10");
+ // agxset(this_gved, asym_len->index, "0.1");
}
}
@@ -1789,8 +1789,8 @@
{
// get the ids of these verts, equal to entity ids of their primal entities
static std::vector<MBEntityHandle> primals;
- primals.reserve(ents.size());
- ids.reserve(ents.size());
+ primals.resize(ents.size());
+ ids.resize(ents.size());
MBErrorCode result = MBI->tag_get_data(dualEntityTagHandle, ents, &primals[0]);
if (MB_SUCCESS != result) {
for (unsigned int i = 0; i < ents.size(); i++) ids[i] = 0;
@@ -1798,6 +1798,9 @@
result = MBI->tag_get_data(vtkMOABUtils::globalId_tag(), &primals[0], ents.size(),
&ids[0]);
+ if (MB_SUCCESS != result && MB_TAG_NOT_FOUND != result)
+ std::cerr << "tag_get_data returned non-zero result in get_primal_ids." << std::endl;
+
for (unsigned int i = 0; i < ents.size(); i++) {
if (0 == ids[i]) ids[i] = MBI->id_from_handle(primals[i]);
}
@@ -1838,7 +1841,7 @@
MBRange saved_sets;
// get all actors, check sets in propSetMap; save set, remove actor from map
- while (tmp_actor = acoll->GetNextItem()) {
+ while ((tmp_actor = acoll->GetNextItem())) {
std::map<vtkProp*,MBEntityHandle>::iterator mit =
vtkMOABUtils::propSetMap.find(tmp_actor);
if (mit == vtkMOABUtils::propSetMap.end()) continue;
Modified: MOAB/trunk/tools/qvdual/DrawDual.hpp
===================================================================
--- MOAB/trunk/tools/qvdual/DrawDual.hpp 2007-07-26 06:43:08 UTC (rev 1223)
+++ MOAB/trunk/tools/qvdual/DrawDual.hpp 2007-07-31 12:32:25 UTC (rev 1224)
@@ -4,6 +4,7 @@
class Agnode_t;
class Agedge_t;
class Agraph_t;
+
class QVTKWidget;
#include "MBInterface.hpp"
Modified: MOAB/trunk/tools/qvdual/vtkMOABUtils.cxx
===================================================================
--- MOAB/trunk/tools/qvdual/vtkMOABUtils.cxx 2007-07-26 06:43:08 UTC (rev 1223)
+++ MOAB/trunk/tools/qvdual/vtkMOABUtils.cxx 2007-07-31 12:32:25 UTC (rev 1224)
@@ -123,7 +123,7 @@
MBTag vtkMOABUtils::globalIdTag = 0;
MBTag vtkMOABUtils::categoryTag = 0;
-bool debug = false;
+bool vtkMOABUtils::debug = false;
//vtkStandardNewMacro(vtkMOABUtils);
Modified: MOAB/trunk/tools/qvdual/vtkMOABUtils.h
===================================================================
--- MOAB/trunk/tools/qvdual/vtkMOABUtils.h 2007-07-26 06:43:08 UTC (rev 1223)
+++ MOAB/trunk/tools/qvdual/vtkMOABUtils.h 2007-07-31 12:32:25 UTC (rev 1224)
@@ -242,6 +242,9 @@
//! assign global ids, in preparation for writing mesh
static void assign_global_ids();
+
+ //! debug parameter
+ static bool debug;
private:
//! private constructor so nobody can construct one
More information about the moab-dev
mailing list