export const CUSTOM_ROOT_NAME = 'custom-model-root';
export const CUSTOM_ROOT_DISPLAY_NAME = '自定义模型元素';
export const DEFAULT_ELEMENT_COLOR = '#2C8CF0';
export const HISTORY_MERGE_WINDOW = 500;

export const ELEMENT_TYPES = [
  'box',
  'tetrahedron',
  'octahedron',
  'cylinder',
  'ring',
  'sphere',
  'capsule',
];

export const ELEMENT_LABELS = {
  box: '立方体',
  tetrahedron: '四面体',
  octahedron: '八面体',
  cylinder: '圆柱体',
  ring: '圆环体',
  sphere: '球体',
  capsule: '胶囊',
  group: '组',
};

export const TRANSFORM_MODE = {
  TRANSLATE: 'translate',
  ROTATE: 'rotate',
  SCALE: 'scale',
};

export const SCENE_NODE_TYPE = {
  CUSTOM_ELEMENT: 'custom-element',
  CUSTOM_GROUP: 'custom-group',
  CUSTOM_ROOT: 'custom-root',
  ORIGINAL_MODEL: 'original-model',
  HELPER: 'helper',
  UNKNOWN: 'unknown',
};

export const EDITOR_EVENT = {
  OBJECT_ADDED: 'objectAdded',
  OBJECT_REMOVED: 'objectRemoved',
  OBJECT_CHANGED: 'objectChanged',
  OBJECT_SELECTED: 'objectSelected',
  OBJECT_TRANSFORM_CHANGING: 'objectTransformChanging',
  OBJECT_TRANSFORM_CHANGED: 'objectTransformChanged',
  SCENE_GRAPH_CHANGED: 'sceneGraphChanged',
  HISTORY_CHANGED: 'historyChanged',
  TRANSFORM_MODE_CHANGED: 'transformModeChanged',
  ORIGINAL_MODEL_SELECTED: 'originalModelSelected',
  ORIGINAL_MODEL_STYLE_CHANGED: 'originalModelStyleChanged',
  ORIGINAL_MODEL_STYLE_RESET: 'originalModelStyleReset',
  ORIGINAL_MODEL_CHANGE_LIST_CHANGED: 'originalModelChangeListChanged',
};

export const COMMAND_TYPE = {
  ADD_ELEMENT: 'AddElementCommand',
  ADD_GROUP: 'AddGroupCommand',
  REMOVE_ELEMENT: 'RemoveElementCommand',
  CLONE_ELEMENT: 'CloneElementCommand',
  MOVE_ELEMENT: 'MoveElementCommand',
  SET_POSITION: 'SetPositionCommand',
  SET_ROTATION: 'SetRotationCommand',
  SET_SCALE: 'SetScaleCommand',
  SET_VALUE: 'SetValueCommand',
  SET_GEOMETRY_PARAMS: 'SetGeometryParamsCommand',
  SET_ORIGINAL_MODEL_STYLE: 'SetOriginalModelStyleCommand',
  RESET_ORIGINAL_MODEL_STYLE: 'ResetOriginalModelStyleCommand',
  MULTI: 'MultiCommand',
};

export const DEFAULT_GEOMETRY_PARAMS = {
  box: {
    width: 1,
    height: 1,
    depth: 1,
  },
  tetrahedron: {
    radius: 1,
  },
  octahedron: {
    radius: 1,
  },
  cylinder: {
    radiusTop: 1,
    radiusBottom: 1,
    height: 1,
  },
  ring: {
    radius: 1,
    tube: 0.4,
    arc: 360,
  },
  sphere: {
    radius: 1,
    phiStart: 0,
    phiLength: 360,
    thetaStart: 0,
    thetaLength: 180,
  },
  capsule: {
    radius: 1,
    length: 1,
  },
};
