Skip to content

Commit

Permalink
Add test for vtkIOXML.
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Aug 15, 2017
1 parent 2743bea commit adab9ac
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drake/perception/estimators/dev/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ load(
"//tools:drake.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_test",
)
load("//tools:lint.bzl", "add_lint_tests")

Expand Down Expand Up @@ -90,4 +91,14 @@ drake_cc_googletest(
],
)

drake_cc_test(
name = "tmp_vtk_io_xml_test",
data = [
"test/tmp_vtk_io_xml_test.vtp",
],
deps = [
"@vtk//:vtkIOXML",
],
)

add_lint_tests()
19 changes: 19 additions & 0 deletions drake/perception/estimators/dev/test/tmp_vtk_io_xml_test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <vtkXMLPolyDataReader.h>

// Read a point cloud.
// Derived from VTK examples, VTK/Examples/Cxx/...:
// * IO/ReadPolyData
// * IO/WriteVTP
// * PolyData/PointSource

int main() {
// Read a file that was generated with a random point cloud.
const char* filename = "tmp_vtk_io_xml_test.vtp";
vtkSmartPointer<vtkXMLPolyDataReader> reader =
vtkSmartPointer<vtkXMLPolyDataReader>::New();
reader->SetFileName(filename);
reader->Update();
return 0;
}
33 changes: 33 additions & 0 deletions drake/perception/estimators/dev/test/tmp_vtk_io_xml_test.vtp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
<PolyData>
<Piece NumberOfPoints="50" NumberOfVerts="1" NumberOfLines="0" NumberOfStrips="0" NumberOfPolys="0" >
<PointData>
</PointData>
<CellData>
</CellData>
<Points>
<DataArray type="Float32" Name="Points" NumberOfComponents="3" format="appended" RangeMin="1.4376629654" RangeMax="4.9799350443" offset="0" />
</Points>
<Verts>
<DataArray type="Int64" Name="connectivity" format="appended" RangeMin="" RangeMax="" offset="840" />
<DataArray type="Int64" Name="offsets" format="appended" RangeMin="" RangeMax="" offset="988" />
</Verts>
<Lines>
<DataArray type="Int64" Name="connectivity" format="appended" RangeMin="" RangeMax="" offset="1028" />
<DataArray type="Int64" Name="offsets" format="appended" RangeMin="" RangeMax="" offset="1044" />
</Lines>
<Strips>
<DataArray type="Int64" Name="connectivity" format="appended" RangeMin="" RangeMax="" offset="1060" />
<DataArray type="Int64" Name="offsets" format="appended" RangeMin="" RangeMax="" offset="1076" />
</Strips>
<Polys>
<DataArray type="Int64" Name="connectivity" format="appended" RangeMin="" RangeMax="" offset="1092" />
<DataArray type="Int64" Name="offsets" format="appended" RangeMin="" RangeMax="" offset="1108" />
</Polys>
</Piece>
</PolyData>
<AppendedData encoding="base64">
_AQAAAACAAABYAgAAYwIAAA==eJwBWAKn/S2VA78RUDs/fP+SQCwhqr5KEb6/JTisv59Jrr/rfo2+ZSe9PhaUvr9Q8fs/wCoqQLtG0z+Nf1m/DmeAQMMOkUBu9ug/uj3XPji3OMBDTitAOJH2P1CuAkCtpgBAG0uDPyFagz0lSLI/AcMiwHSMpL9MMnZA1I6yv7hI/D8gdqa/zrl+Pliamb//QwhAH8snwNqJRcBjPns/SwZFv6F1CL9H/wU+dkKRQGm4EkAQ5G/A0QgivxHKlb9NFGVAWc/GvjsQIT//6oY/A2CFwChWfcDJldy/H1L/P1o8GMAiFiTAQ4VhwPeXDL84+iBASU1bvpUK4b8fDV/Ad/olwGmtMMDYgt4/kWY9vERwf8Ba5u6+bdYSQAnS6D/gjgRALSkGwAdmLsA1016+xApGQBB2akDtHpy/Mo2ev2S5AMC8JkhAjObMPyCx07+iKoFAomP3vsrRIMA5HhW/NVeHwAd00T/lGxHAXFoNwHiUH0Bxlk1APy53PvY6Db+h+jrAhzhaQHxyhj/53be95UJtQIbqEb49uADASulGwDlp7z8JLWe/DuyKQNMGE0C60cm/oVQjwGIl679b7vM+TUGBQC3oS8A4ERhAXIQLwIevA0AQ+h0/k7tnPpZzO8BJY3O+YvoLPw6G1L8QGqW+odgUQB59gMBPC4w/q2WHv9th6D+xcoq/dPk6wEAaicBDWzs/Ko4bwPKp5D/F3a4/AoSLwFkS179+FA3AtLVaP2lJ8b/zgTe/wTQYQCZPPMDtwj1AfJAKvrwzBEDmVY2/E288P2D5N0DYr6q+oJRgwDupFmI=AQAAAACAAACQAQAAXQAAAA==eJwtxdcCgQAAAMDMyGggsikr+/9/zoO7lwuCv4abbrntjrsO3XPfkQceeuSxYydOnXniqWfOPffChZdeee2Nt95574OPLl355LMvvvrm2nc//PTLb3/89Q+MdgTKAQAAAACAAAAIAAAACwAAAA==eJwzYoAAAAGYADM=AAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAA
</AppendedData>
</VTKFile>

0 comments on commit adab9ac

Please sign in to comment.