Geometry.js 560 B

123456789101112131415161718192021222324
  1. //CLASS:基本几何类型。
  2. function Geometry(){
  3. this.id = CanvasSketch.getId("geomtry_");
  4. this.contextIndex=0;
  5. this.floor = 1;
  6. };
  7. //bounds属性定义了当前Geometry外接矩形范围。
  8. Geometry.prototype.bounds = null;
  9. //定义Geometry的id属性。
  10. Geometry.prototype.id = null;
  11. Geometry.prototype.name = null;
  12. //定义对bounds基类克隆的方法
  13. Geometry.prototype.clone = function () {
  14. return new Geometry();
  15. };
  16. //销毁当前的Geometry
  17. Geometry.prototype.destroy = function () {
  18. this.bounds = null;
  19. this.id = null;
  20. };