00001 #pragma once 00002 00003 // -- Code from Sketchup SDK sample -- 00004 00005 #include "GeomUtilities.h" 00006 #include <vector> 00007 00008 //CInheritanceManager - A cross-platform class that manages the properties 00009 //of geometric elements (faces and edges) that can be inherited from component 00010 //instances, groups and images. These properties are transformations to world 00011 //space, layers and materials. 00012 class CInheritanceManager 00013 { 00014 public: 00015 00016 CInheritanceManager(); 00017 virtual ~CInheritanceManager(); 00018 00019 void SetTextureWriter(CComPtr<ISkpTextureWriter2> textureWriter); 00020 void SetMaterialsByLayer(bool materialsByLayer) { m_bMaterialsByLayer = materialsByLayer; } 00021 00022 void PushElement(CComPtr<ISkpComponentInstance> pElement); 00023 void PushElement(CComPtr<ISkpGroup> pElement); 00024 void PushElement(CComPtr<ISkpImage> pElement); 00025 void PushElement(CComPtr<ISkpFace> pElement); 00026 void PushElement(CComPtr<ISkpEdge> pElement); 00027 void PopElement(); 00028 00029 CComPtr<ISkpLayer> GetCurrentLayer(); 00030 CTransform GetCurrentTransform(); 00031 CComPtr<ISkpMaterial> GetCurrentFrontMaterial(); 00032 CComPtr<ISkpMaterial> GetCurrentBackMaterial(); 00033 long GetCurrentTextureHandle(); 00034 00035 protected: //Methods 00036 00037 void PushTransform(CTransform t); 00038 void PushTextureHandle(long textureHandle); 00039 00040 protected: //Data 00041 00042 bool m_bMaterialsByLayer; 00043 std::vector<CTransform> m_Transforms; 00044 std::vector<ISkpLayer*> m_Layers; 00045 std::vector<ISkpMaterial*> m_FrontMaterials; 00046 std::vector<ISkpMaterial*> m_BackMaterials; 00047 std::vector<long> m_TextureHandles; 00048 00049 CComPtr<ISkpTextureWriter2> m_pTextureWriter; 00050 };