requirement-mapping.interface.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // 需求映射接口定义
  2. export interface RequirementMapping {
  3. sceneGeneration: {
  4. baseScene: SceneTemplate; // 固定场景模板
  5. parameters: SceneParams; // 场景参数
  6. atmospherePreview: string; // 氛围感预览图
  7. };
  8. parameterMapping: {
  9. colorParams: ColorMappingParams;
  10. spaceParams: SpaceMappingParams;
  11. materialParams: MaterialMappingParams;
  12. };
  13. }
  14. // 场景参数接口
  15. export interface SceneParams {
  16. lighting: LightingParams;
  17. environment: EnvironmentParams;
  18. composition: CompositionParams;
  19. style: StyleParams;
  20. }
  21. // 灯光参数
  22. export interface LightingParams {
  23. primaryLight: {
  24. type: 'natural' | 'artificial' | 'mixed';
  25. intensity: number; // 0-100
  26. temperature: number; // 色温K值
  27. direction: 'top' | 'front' | 'back' | 'left' | 'right' | 'multiple';
  28. };
  29. ambientLight: {
  30. strength: number; // 0-100
  31. mood: 'dramatic' | 'romantic' | 'energetic' | 'calm' | 'mysterious' | 'cheerful' | 'professional';
  32. };
  33. shadows: {
  34. intensity: number; // 0-100
  35. softness: number; // 0-100
  36. };
  37. }
  38. // 环境参数
  39. export interface EnvironmentParams {
  40. setting: 'indoor' | 'outdoor' | 'studio' | 'natural';
  41. atmosphere: 'minimal' | 'cozy' | 'luxurious' | 'industrial' | 'natural' | 'modern';
  42. weatherCondition?: 'sunny' | 'cloudy' | 'overcast' | 'golden-hour' | 'blue-hour';
  43. timeOfDay?: 'morning' | 'noon' | 'afternoon' | 'evening' | 'night';
  44. }
  45. // 构图参数
  46. export interface CompositionParams {
  47. viewAngle: 'close-up' | 'medium' | 'wide' | 'panoramic';
  48. perspective: 'eye-level' | 'high-angle' | 'low-angle' | 'bird-eye';
  49. focusPoint: 'center' | 'left' | 'right' | 'top' | 'bottom';
  50. depth: number; // 0-100 景深效果
  51. }
  52. // 风格参数
  53. export interface StyleParams {
  54. renderStyle: 'photorealistic' | 'artistic' | 'minimalist' | 'dramatic' | 'soft' | 'vibrant';
  55. colorGrading: 'natural' | 'warm' | 'cool' | 'vintage' | 'modern' | 'high-contrast';
  56. textureDetail: 'low' | 'medium' | 'high' | 'ultra';
  57. }
  58. // 颜色映射参数
  59. export interface ColorMappingParams {
  60. primaryColors: ColorMapping[];
  61. colorHarmony: 'monochromatic' | 'analogous' | 'complementary' | 'triadic' | 'split-complementary';
  62. saturation: number; // 0-100
  63. brightness: number; // 0-100
  64. contrast: number; // 0-100
  65. temperature: 'warm' | 'neutral' | 'cool';
  66. }
  67. // 单个颜色映射
  68. export interface ColorMapping {
  69. originalColor: string; // hex color
  70. mappedColor: string; // hex color
  71. weight: number; // 0-100 在整体配色中的权重
  72. usage: 'primary' | 'secondary' | 'accent' | 'background';
  73. }
  74. // 空间映射参数
  75. export interface SpaceMappingParams {
  76. dimensions: {
  77. width: number;
  78. height: number;
  79. depth: number;
  80. unit: 'meter' | 'feet';
  81. };
  82. layout: {
  83. type: 'open' | 'enclosed' | 'semi-open' | 'multi-level';
  84. flow: 'linear' | 'circular' | 'grid' | 'organic';
  85. zones: SpaceZone[];
  86. };
  87. scale: {
  88. furniture: number; // 0-100 家具比例
  89. ceiling: number; // 0-100 天花板高度比例
  90. openness: number; // 0-100 开放程度
  91. };
  92. }
  93. // 空间区域
  94. export interface SpaceZone {
  95. name: string;
  96. function: string;
  97. area: number; // 占总面积百分比
  98. position: 'center' | 'corner' | 'wall' | 'entrance' | 'window';
  99. }
  100. // 材质映射参数
  101. export interface MaterialMappingParams {
  102. surfaceMaterials: MaterialMapping[];
  103. textureScale: number; // 0-100 纹理缩放
  104. reflectivity: number; // 0-100 反射率
  105. roughness: number; // 0-100 粗糙度
  106. metallic: number; // 0-100 金属度
  107. }
  108. // 单个材质映射
  109. export interface MaterialMapping {
  110. category: 'wood' | 'metal' | 'fabric' | 'stone' | 'glass' | 'ceramic' | 'plastic' | 'leather';
  111. subtype: string; // 具体材质类型
  112. finish: 'matte' | 'satin' | 'gloss' | 'textured' | 'brushed' | 'polished';
  113. color: string; // hex color
  114. coverage: number; // 0-100 覆盖面积百分比
  115. priority: 'primary' | 'secondary' | 'accent';
  116. }
  117. // 场景模板枚举
  118. export enum SceneTemplate {
  119. LIVING_ROOM_MODERN = 'living_room_modern',
  120. LIVING_ROOM_CLASSIC = 'living_room_classic',
  121. BEDROOM_MINIMAL = 'bedroom_minimal',
  122. BEDROOM_COZY = 'bedroom_cozy',
  123. KITCHEN_CONTEMPORARY = 'kitchen_contemporary',
  124. KITCHEN_TRADITIONAL = 'kitchen_traditional',
  125. BATHROOM_LUXURY = 'bathroom_luxury',
  126. BATHROOM_MINIMAL = 'bathroom_minimal',
  127. OFFICE_MODERN = 'office_modern',
  128. OFFICE_TRADITIONAL = 'office_traditional',
  129. DINING_FORMAL = 'dining_formal',
  130. DINING_CASUAL = 'dining_casual',
  131. STUDIO_APARTMENT = 'studio_apartment',
  132. OUTDOOR_PATIO = 'outdoor_patio',
  133. OUTDOOR_GARDEN = 'outdoor_garden'
  134. }
  135. // 需求映射结果
  136. export interface MappingResult {
  137. success: boolean;
  138. sceneId: string;
  139. generatedParams: SceneParams;
  140. previewUrl?: string;
  141. confidence: number; // 0-100 映射置信度
  142. suggestions?: string[]; // 优化建议
  143. errors?: string[]; // 错误信息
  144. }