IFCLoader.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. Open Asset Import Library (ASSIMP)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2010, ASSIMP Development Team
  5. All rights reserved.
  6. Redistribution and use of this software in source and binary forms,
  7. with or without modification, are permitted provided that the
  8. following conditions are met:
  9. * Redistributions of source code must retain the above
  10. copyright notice, this list of conditions and the
  11. following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the
  14. following disclaimer in the documentation and/or other
  15. materials provided with the distribution.
  16. * Neither the name of the ASSIMP team, nor the names of its
  17. contributors may be used to endorse or promote products
  18. derived from this software without specific prior
  19. written permission of the ASSIMP Development Team.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. ----------------------------------------------------------------------
  32. */
  33. /** @file IFC.h
  34. * @brief Declaration of the Industry Foundation Classes (IFC) loader main class
  35. */
  36. #ifndef INCLUDED_AI_IFC_LOADER_H
  37. #define INCLUDED_AI_IFC_LOADER_H
  38. #include "BaseImporter.h"
  39. namespace Assimp {
  40. // TinyFormatter.h
  41. namespace Formatter {
  42. template <typename T,typename TR, typename A> class basic_formatter;
  43. typedef class basic_formatter< char, std::char_traits<char>, std::allocator<char> > format;
  44. }
  45. namespace STEP {
  46. class DB;
  47. }
  48. // -------------------------------------------------------------------------------------------
  49. /** Load the IFC format, which is an open specification to describe building and construction
  50. industry data.
  51. See http://en.wikipedia.org/wiki/Industry_Foundation_Classes
  52. */
  53. // -------------------------------------------------------------------------------------------
  54. class IFCImporter : public BaseImporter
  55. {
  56. friend class Importer;
  57. protected:
  58. /** Constructor to be privately used by Importer */
  59. IFCImporter();
  60. /** Destructor, private as well */
  61. ~IFCImporter();
  62. public:
  63. // --------------------
  64. bool CanRead( const std::string& pFile,
  65. IOSystem* pIOHandler,
  66. bool checkSig
  67. ) const;
  68. protected:
  69. // --------------------
  70. void GetExtensionList(std::set<std::string>& app);
  71. // --------------------
  72. void SetupProperties(const Importer* pImp);
  73. // --------------------
  74. void InternReadFile( const std::string& pFile,
  75. aiScene* pScene,
  76. IOSystem* pIOHandler
  77. );
  78. private:
  79. public:
  80. // loader settings, publicy accessible via their corresponding AI_CONFIG constants
  81. struct Settings
  82. {
  83. Settings()
  84. : skipSpaceRepresentations()
  85. , skipCurveRepresentations()
  86. {}
  87. bool skipSpaceRepresentations;
  88. bool skipCurveRepresentations;
  89. };
  90. public:
  91. // -------------------------------------------------------------------
  92. /** Prepend 'IFC: ' and throw msg.*/
  93. static void ThrowException(const std::string& msg);
  94. // -------------------------------------------------------------------
  95. /** @defgroup blog Prepend 'IFC: ' and write @c message to log.*/
  96. static void LogWarn (const Formatter::format& message); //! @ingroup blog
  97. static void LogError (const Formatter::format& message); //! @ingroup blog
  98. static void LogInfo (const Formatter::format& message); //! @ingroup blog
  99. static void LogDebug (const Formatter::format& message); //! @ingroup blog
  100. private:
  101. Settings settings;
  102. }; // !class IFCImporter
  103. } // end of namespace Assimp
  104. #endif // !INCLUDED_AI_IFC_LOADER_H