1 /* 2 Copyright (C) 2010-2014 Kristian Duske 3 4 This file is part of TrenchBroom. 5 6 TrenchBroom is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 TrenchBroom is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with TrenchBroom. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef TrenchBroom_ModelFactoryImpl 21 #define TrenchBroom_ModelFactoryImpl 22 23 #include "TrenchBroom.h" 24 #include "VecMath.h" 25 #include "StringUtils.h" 26 #include "Model/MapFormat.h" 27 #include "Model/ModelFactory.h" 28 #include "Model/ModelTypes.h" 29 30 namespace TrenchBroom { 31 namespace Model { 32 class BrushContentTypeBuilder; 33 class BrushFaceAttributes; 34 35 class ModelFactoryImpl : public ModelFactory { 36 private: 37 MapFormat::Type m_format; 38 const BrushContentTypeBuilder* m_brushContentTypeBuilder; 39 public: 40 ModelFactoryImpl(); 41 ModelFactoryImpl(MapFormat::Type format, const BrushContentTypeBuilder* brushContentTypeBuilder); 42 private: // implement ModelFactory interface 43 MapFormat::Type doGetFormat() const; 44 World* doCreateWorld(const BBox3& worldBounds) const; 45 Layer* doCreateLayer(const String& name, const BBox3& worldBounds) const; 46 Group* doCreateGroup(const String& name) const; 47 Entity* doCreateEntity() const; 48 Brush* doCreateBrush(const BBox3& worldBounds, const BrushFaceList& faces) const; 49 50 BrushFace* doCreateFace(const Vec3& point1, const Vec3& point2, const Vec3& point3, const BrushFaceAttributes& attribs) const; 51 BrushFace* doCreateFace(const Vec3& point1, const Vec3& point2, const Vec3& point3, const BrushFaceAttributes& attribs, const Vec3& texAxisX, const Vec3& texAxisY) const; 52 }; 53 } 54 } 55 56 #endif /* defined(TrenchBroom_ModelFactoryImpl) */ 57