XMLSerializationTest.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. /* ---------------------------------------------------------------------------
  9. // XMLSerializationTest.h
  10. // Author: Christian Schüller <schuellchr@gmail.com>
  11. ------------------------------------------------------------------------------
  12. Used to demonstrates howto use the XMLSerialization class.
  13. ----------------------------------------------------------------------------*/
  14. #ifndef XML_SERIALIZABLE_H
  15. #define XML_SERIALIZABLE_H
  16. #include <igl/xml/XMLSerialization.h>
  17. namespace igl
  18. {
  19. class XMLSerializationTest : public ::igl::XMLSerialization
  20. {
  21. public:
  22. int testInt;
  23. std::vector<float> testVector;
  24. XMLSerializationTest();
  25. void InitSerialization();
  26. bool Test();
  27. };
  28. XMLSerializerTest::XMLSerializerTest()
  29. : XMLSerialization("testObject")
  30. {
  31. }
  32. void XMLSerializerTest::InitSerialization()
  33. {
  34. xmlSerializer->Add(testInt,"testInt");
  35. xmlSerializer->Add(testVector,"testVector");
  36. testInt = 10;
  37. testVector.push_back(1.0001f);
  38. testVector.push_back(2.0001f);
  39. testVector.push_back(3.0001f);
  40. }
  41. }
  42. #endif