Commit 5f0f4e16 authored by Dave Demarle's avatar Dave Demarle
Browse files

ENH: Add reader, writer and IO test for the new HyperOctree datastructure -...

ENH: Add reader, writer and IO test for the new HyperOctree datastructure - fix dashboard warnings and errors.
parent 6c8e48ea
......@@ -22,9 +22,11 @@ TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkIO vtkImaging vtksys vtkRendering)
IF (VTK_DATA_ROOT)
ADD_TEST(TestXML ${CXX_TEST_PATH}/${KIT}CxxTests TestXML ${VTK_DATA_ROOT}/Data/sample.xml)
ADD_TEST(TestCompress ${CXX_TEST_PATH}/${KIT}CxxTests TestCompress ${VTK_DATA_ROOT}/Data/sample.xml)
ADD_TEST(TestHyperOctreeIO ${CXX_TEST_PATH}/${KIT}CxxTests TestHyperOctreeIO -D ${VTK_DATA_ROOT}
-T ${VTK_BINARY_DIR}/Testing/Temporary
-V ${VTK_DATA_ROOT}/Baseline/${KIT}/TestHyperOctreeIO.png)
IF (VTK_USE_DISPLAY)
ADD_TEST(TestHyperOctreeIO ${CXX_TEST_PATH}/${KIT}CxxTests TestHyperOctreeIO -D ${VTK_DATA_ROOT}
-T ${VTK_BINARY_DIR}/Testing/Temporary
-V ${VTK_DATA_ROOT}/Baseline/${KIT}/TestHyperOctreeIO.png)
ENDIF (VTK_USE_DISPLAY)
ENDIF (VTK_DATA_ROOT)
IF(WIN32 AND VTK_USE_VIDEO_FOR_WINDOWS)
......
......@@ -58,8 +58,10 @@ int TestHyperOctreeIO(int argc, char* argv[])
int compressed = 1;
int showcontour = 1;
int ncontours = 1;
int interactive = 0;
int rewrite = 0;
#ifdef HYPEROCTREEIO_STANDALONE
int interactive = 0;
#endif
if (argc > 1)
{
......@@ -110,16 +112,16 @@ int TestHyperOctreeIO(int argc, char* argv[])
if (ncontours < 1) ncontours = 1;
if (ncontours > 3) ncontours = 3;
}
else if (!strcmp("-I",argv[i]))
#ifdef HYPEROCTREEIO_STANDALONE
else if (!strcmp("-interactive",argv[i]))
{
interactive = 1;
}
else if (i > 1)
{
#ifdef HYPEROCTREEIO_STANDALONE
cout << "Unrecognized argument " << argv[i] << endl;
#endif
}
#endif
}
}
......
......@@ -30,7 +30,7 @@
#include "vtkIntArray.h"
#include "vtkFieldData.h"
vtkCxxRevisionMacro(vtkXMLHyperOctreeReader, "1.1");
vtkCxxRevisionMacro(vtkXMLHyperOctreeReader, "1.2");
vtkStandardNewMacro(vtkXMLHyperOctreeReader);
//----------------------------------------------------------------------------
......@@ -243,7 +243,7 @@ void vtkXMLHyperOctreeReader::ReadTopology(vtkXMLDataElement *elem)
vtkHyperOctreeCursor *cursor=this->GetOutput()->NewCellCursor();
cursor->ToRoot();
//Where in the array we need to read from next.
this->idx = 0;
this->ArrayIndex = 0;
if (!this->BuildNextCell(ta, cursor, cursor->GetNumberOfChildren()))
{
vtkErrorMacro( << "Problem reading topology. ");
......@@ -263,7 +263,7 @@ int vtkXMLHyperOctreeReader::BuildNextCell(
int nchildren)
{
int nodeType = ta->GetValue(idx);
int nodeType = ta->GetValue(this->ArrayIndex);
if (nodeType == 1)
{
......@@ -288,7 +288,7 @@ int vtkXMLHyperOctreeReader::BuildNextCell(
{
cursor->ToChild(i);
this->idx++;
this->ArrayIndex++;
if (!this->BuildNextCell(ta, cursor, nchildren))
{
//IO failure somewhere below
......
......@@ -80,7 +80,7 @@ protected:
int BuildNextCell(vtkIntArray *, vtkHyperOctreeCursor *, int);
//Helper for BuildNextCell
int idx;
int ArrayIndex;
private:
vtkXMLHyperOctreeReader(const vtkXMLHyperOctreeReader&); // Not implemented.
......
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