|
@@ -0,0 +1,93 @@
|
|
|
|
+package com.fdkankan.modeling.service.impl;
|
|
|
|
+
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.fdkankan.model.enums.ModelTypeEnums;
|
|
|
|
+import com.fdkankan.modeling.service.IBuildService;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+@Slf4j
|
|
|
|
+@Service
|
|
|
|
+public class BuildServiceImpl implements IBuildService {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, String> getTypeString(String cameraType, String algorithm, String resolution, JSONObject fdageData){
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
|
+ String splitType = "";
|
|
|
|
+ String skyboxType = "";
|
|
|
|
+ String dataDescribe = "";
|
|
|
|
+ if(Integer.parseInt(cameraType) >= 4){
|
|
|
|
+ if("0".equals(resolution)){
|
|
|
|
+// skyboxType = "SKYBOX_V4"; //tiles
|
|
|
|
+// skyboxType = "SKYBOX_V6"; //high,low,4k
|
|
|
|
+ skyboxType = "SKYBOX_V7"; //high,low,2k
|
|
|
|
+ }else {
|
|
|
|
+ skyboxType = "SKYBOX_V1";
|
|
|
|
+ }
|
|
|
|
+ splitType = "SPLIT_V1";
|
|
|
|
+// skyboxType = "SKYBOX_V4"; //tiles
|
|
|
|
+ dataDescribe = "double spherical";
|
|
|
|
+
|
|
|
|
+ if(Integer.parseInt(cameraType) == 5 ){
|
|
|
|
+ //新双目相机
|
|
|
|
+// skyboxType = "SKYBOX_V9";
|
|
|
|
+ splitType = "SPLIT_V9";
|
|
|
|
+ skyboxType = "SKYBOX_V1";
|
|
|
|
+ }
|
|
|
|
+ if(Integer.parseInt(cameraType) == 6){
|
|
|
|
+ //小红屋新双目相机
|
|
|
|
+// skyboxType = "SKYBOX_V9";
|
|
|
|
+ splitType = "SPLIT_V3";
|
|
|
|
+ skyboxType = "SKYBOX_V7";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(Integer.parseInt(cameraType) == 13){
|
|
|
|
+ //转台相机
|
|
|
|
+ skyboxType = "SKYBOX_V6";
|
|
|
|
+ splitType = "SPLIT_V12";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(Integer.parseInt(cameraType) == 14){
|
|
|
|
+ //转台相机
|
|
|
|
+ log.info("激光转台相机调用算法");
|
|
|
|
+ skyboxType = "SKYBOX_V11";
|
|
|
|
+ splitType = "SPLIT_V14";
|
|
|
|
+ if (!ObjectUtils.isEmpty(fdageData)) {
|
|
|
|
+ if ((fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)
|
|
|
|
+ || fdageData.containsKey("OnlyExportMeshObj")) {
|
|
|
|
+ splitType = "SPLIT_V22";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ if("sfm".equals(algorithm)){
|
|
|
|
+ splitType = "SPLIT_V2";
|
|
|
|
+ skyboxType = "SKYBOX_V1";
|
|
|
|
+ dataDescribe = "old sfm";
|
|
|
|
+ }else {
|
|
|
|
+ splitType = "SPLIT_V3";
|
|
|
|
+ skyboxType = "SKYBOX_V1";
|
|
|
|
+ dataDescribe = "old slam";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!ObjectUtils.isEmpty(fdageData) && !ObjectUtils.isEmpty(fdageData.getString("modelType"))) {
|
|
|
|
+ switch (fdageData.getString("modelType")){
|
|
|
|
+ case ModelTypeEnums.TILE_CODE:
|
|
|
|
+ if(skyboxType.equals("SKYBOX_V6")){
|
|
|
|
+ skyboxType = "SKYBOX_V14";
|
|
|
|
+ }else{
|
|
|
|
+ skyboxType = "SKYBOX_V13";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map.put("splitType", splitType);
|
|
|
|
+ map.put("skyboxType", skyboxType);
|
|
|
|
+ map.put("dataDescribe", dataDescribe);
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+}
|