主要功能: - 新增Shrinkwrap外壳导出API (/api/creo/shrinkwrap/shell) - 使用OTK SurfaceSubsetInstructions实现真正的外壳导出 - 智能重名处理,自动生成唯一文件名 - 完全使用用户参数配置,无硬编码限制 性能优化: - 移除耗时的装配体分析和差异计算 - 简化文件保存逻辑,统一保存到工作目录 - 精简API响应格式,专注核心导出功能 - 大幅提升导出速度和系统稳定性 技术突破: - 解决Windows API宏冲突问题 (GetCurrentDirectory) - 实现SurfaceSubset vs MergedSolid性能差异优化 - 建立稳定的跨线程OTK操作机制 - 支持装配体和零件的统一外壳导出 文件变更: + ShrinkwrapManager.h/cpp - 核心Shrinkwrap功能实现 + ShellExportHandler.h/cpp - HTTP API处理逻辑 * MFCCreoDll.cpp - 集成新的消息处理和路由 * CLAUDE.md - 更新项目文档 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
1.5 KiB
C++
37 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "ShrinkwrapManager.h"
|
|
#include "HttpServer.h"
|
|
#include <string>
|
|
#include <sstream>
|
|
|
|
class ShellExportHandler {
|
|
public:
|
|
// 主要HTTP处理方法
|
|
static HttpResponse HandleShrinkwrapShellRequest(const HttpRequest& request);
|
|
|
|
private:
|
|
// JSON解析辅助方法
|
|
static std::string ExtractJsonValue(const std::string& json, const std::string& key);
|
|
static bool ExtractJsonBoolValue(const std::string& json, const std::string& key, bool default_value = false);
|
|
static int ExtractJsonIntValue(const std::string& json, const std::string& key, int default_value = 0);
|
|
static double ExtractJsonDoubleValue(const std::string& json, const std::string& key, double default_value = 0.0);
|
|
|
|
// JSON转义辅助方法
|
|
static std::string EscapeJsonString(const std::string& input);
|
|
|
|
// 请求验证方法
|
|
static bool ValidateHttpRequest(const HttpRequest& request, std::string& error_message);
|
|
|
|
// 参数解析方法
|
|
static ShrinkwrapShellRequest ParseShrinkwrapRequest(const std::string& json_body);
|
|
|
|
// 响应格式化方法
|
|
static HttpResponse FormatSuccessResponse(const ShrinkwrapShellResult& result);
|
|
static HttpResponse FormatErrorResponse(int status_code, const std::string& error_message);
|
|
|
|
// 辅助工具方法
|
|
static std::string Trim(const std::string& str);
|
|
static bool StartsWith(const std::string& str, const std::string& prefix);
|
|
static bool EndsWith(const std::string& str, const std::string& suffix);
|
|
}; |