[cig-commits] r13741 - cs/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Dec 17 02:32:48 PST 2008
Author: luis
Date: 2008-12-17 02:32:47 -0800 (Wed, 17 Dec 2008)
New Revision: 13741
Modified:
cs/cigma/trunk/src/io_vtk.cpp
cs/cigma/trunk/src/io_vtk.h
Log:
Map cigma::Cell::type enum to appropriate VTK constants
Modified: cs/cigma/trunk/src/io_vtk.cpp
===================================================================
--- cs/cigma/trunk/src/io_vtk.cpp 2008-12-17 10:32:46 UTC (rev 13740)
+++ cs/cigma/trunk/src/io_vtk.cpp 2008-12-17 10:32:47 UTC (rev 13741)
@@ -89,6 +89,19 @@
return "";
}
+/* get vtk cell type from a cigma::Cell::type */
+int vtk_celltype(Cell::type cellType)
+{
+ switch (cellType)
+ {
+ case Cell::HEX8: return VTK_HEXAHEDRON;
+ case Cell::TET4: return VTK_TETRA;
+ case Cell::QUAD4: return VTK_QUAD;
+ case Cell::TRI3: return VTK_TRIANGLE;
+ }
+ return VTK_EMPTY_CELL;
+}
+
/* get dimension of cell */
int vtk_celldim(int cellType)
{
@@ -129,7 +142,7 @@
return 3;
}
- return -1;
+ return 0;
}
Modified: cs/cigma/trunk/src/io_vtk.h
===================================================================
--- cs/cigma/trunk/src/io_vtk.h 2008-12-17 10:32:46 UTC (rev 13740)
+++ cs/cigma/trunk/src/io_vtk.h 2008-12-17 10:32:47 UTC (rev 13741)
@@ -24,6 +24,7 @@
#include <sstream>
#include <cassert>
+#include "Cell.h"
#include "tri_logger.hpp"
#include "Exception.h"
@@ -70,6 +71,8 @@
std::string vtk_cellname(int cellType);
+int vtk_celltype(Cell::type cellType);
+
int vtk_celldim(int cellType);
vtkDataSetReader* vtk_read_legacy(const char *filename, vtkGridType& gridType);
More information about the CIG-COMMITS
mailing list