Esempio n. 1
0
 public TextureViewControl(
     TextureInfo texture,
     IWindowsFormsEditorService editorService)
 {
     // This call is required by the designer.
     InitializeComponent();
 }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 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())));
     }
 }
Esempio n. 4
0
 public bool Contains(TextureInfo tx)
 {
     return
         this.textures.Any(
             item =>
                 item.Item1.GetType() == tx.GetType() &&
                             item.Item1.Name.Equals(tx.Name, StringComparison.InvariantCultureIgnoreCase));
 }