'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var deprecation = require('../../../utils/logging/deprecation.js');
var Container = require('../../scene/Container.js');
var MeshGeometry = require('./MeshGeometry.js');
var MeshView = require('./MeshView.js');

class Mesh extends Container.Container {
  constructor(...args) {
    let options = args[0];
    if (options instanceof MeshGeometry.MeshGeometry) {
      deprecation.deprecation(deprecation.v8_0_0, "Mesh: use new Mesh({ geometry, shader }) instead");
      options = {
        geometry: options,
        shader: args[1]
      };
      if (args[3]) {
        deprecation.deprecation(deprecation.v8_0_0, "Mesh: topology argument has been removed, use geometry.topology instead");
        options.geometry.topology = args[3];
      }
    }
    super({
      view: new MeshView.MeshView(options),
      label: "Mesh",
      ...options
    });
    this.allowChildren = false;
  }
  get texture() {
    return this.view.texture;
  }
  set texture(value) {
    this.view.texture = value;
  }
  get geometry() {
    return this.view.geometry;
  }
  set geometry(value) {
    this.view.geometry = value;
  }
  get material() {
    deprecation.deprecation(deprecation.v8_0_0, "mesh.material property has been removed, use mesh.shader instead");
    return this.view.shader;
  }
  get shader() {
    return this.view.shader;
  }
}

exports.Mesh = Mesh;
//# sourceMappingURL=Mesh.js.map
