public TextureViewControl( TextureInfo texture, IWindowsFormsEditorService editorService) { // This call is required by the designer. InitializeComponent(); }
public int AddTexture(TextureInfo texture) { if (this.nameIDMap.ContainsKey(texture.Name)) return nameIDMap[texture.Name]; nameIDMap.Add(texture.Name, CurrentID++); if (texture is ImageTextureInfo) { this.textures.Add(new Tuple<TextureInfo, ITexture>(texture, //new NoiseTexture(512, 512, new RgbSpectrum(1f))) ImageFactory.FreeImageLoadBitmap((texture as ImageTextureInfo).FilePath)) ); } else if (texture is ConstTextureInfo) { this.textures.Add(new Tuple<TextureInfo, ITexture>(texture, new ConstSpectrumTexture((texture as ConstTextureInfo).Color, 0, 0))); } else if (texture is SolidTextureInfo) { this.textures.Add(new Tuple<TextureInfo, ITexture>(texture, new NoiseTexture(512, 512, RgbSpectrum.UnitSpectrum()))); } return CurrentID-1; }
public void AddTexture(TextureInfo texture) { if (this.textures.ContainsKey(texture.Name)) return; if (texture is ImageTextureInfo) { this.textures.Add(texture.Name, new Tuple<TextureInfo, ITexture>(texture, //new NoiseTexture(512, 512, new RgbSpectrum(1f))) ImageFactory.FreeImageLoadBitmap((texture as ImageTextureInfo).FilePath)) ); } else if (texture is ConstTextureInfo) { this.textures.Add(texture.Name, new Tuple<TextureInfo, ITexture>(texture, new ConstSpectrumTexture((texture as ConstTextureInfo).Color, 0, 0))); } else if (texture is SolidTextureInfo) { this.textures.Add(texture.Name, new Tuple<TextureInfo, ITexture>(texture, new NoiseTexture(512,512, RgbSpectrum.UnitSpectrum()))); } }
public bool Contains(TextureInfo tx) { return this.textures.Any( item => item.Item1.GetType() == tx.GetType() && item.Item1.Name.Equals(tx.Name, StringComparison.InvariantCultureIgnoreCase)); }