00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc. 00002 // 00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., 00004 // and considered a trade secret as defined under civil and criminal statutes. 00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of 00006 // unauthorized use or misappropriation of its trade secrets. Use of this information 00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under 00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use. 00009 00010 #pragma once 00011 00012 #include "GeometryImporter.h" 00013 #include "GroupRepository.h" 00014 #include "InheritanceManager.h" 00015 00016 #include <slapi/model/component_definition.h> 00017 00018 #include <hc.h> 00019 00020 #include <map> 00021 #include <cstdint> 00022 00023 class DefinitionRepository 00024 { 00025 public: 00026 DefinitionRepository(HC_KEY includeSegmentKey, GeometryImporter& geometryImporter, 00027 GroupRepository& groupRepository, InheritanceManager& inheritanceManager); 00028 00029 bool Import(SUComponentDefinitionRef& definition); 00030 HC_KEY GetDefinitionKey(SUComponentDefinitionRef& definition) const; 00031 InheritanceManager & GetInheritanceManager() { return m_inheritance_manager; } 00032 00033 private: 00034 DefinitionRepository(const DefinitionRepository&); 00035 DefinitionRepository& operator=(const DefinitionRepository&); 00036 00037 int32_t GetId(SUComponentDefinitionRef& definition) const; 00038 00039 private: 00040 HC_KEY m_definitionsSegmentKey; 00041 GeometryImporter& m_geometryImporter; 00042 GroupRepository& m_groupRepository; 00043 InheritanceManager& m_inheritance_manager; 00044 std::map<int32_t, HC_KEY> m_definitionsMap; 00045 };