#pragma once #include #include #include #include #include namespace hhb { namespace algorithm { class AICommandManager { public: static AICommandManager& getInstance(); void setModelLoadedCallback(std::function callback); void setAnalysisCompleteCallback(std::function callback); void setHighlightCallback(std::function&, int)> callback); bool loadModel(const std::string& filename); void resetCamera(); void setCameraPosition(float x, float y, float z); void setCameraRotation(float pitch, float yaw); void setZoom(float zoom); void setHighlight(int type, const std::vector& indices); void setPBRParams(float metallic, float roughness); void clearHighlight(); void executeAnalysis(const std::string& command); float getCameraPositionX() const { return cameraPositionX.load(); } float getCameraPositionY() const { return cameraPositionY.load(); } float getCameraPositionZ() const { return cameraPositionZ.load(); } float getCameraPitch() const { return cameraPitch.load(); } float getCameraYaw() const { return cameraYaw.load(); } float getZoom() const { return zoom.load(); } bool isModelLoaded() const { return modelLoaded.load(); } enum class HighlightType { None = 0, ThinParts = 1, CurvedSurfaces = 2, SharpEdges = 3, FlatSurfaces = 4 }; private: AICommandManager() = default; ~AICommandManager() = default; AICommandManager(const AICommandManager&) = delete; AICommandManager& operator=(const AICommandManager&) = delete; std::atomic modelLoaded{false}; std::atomic cameraPositionX{0.0f}; std::atomic cameraPositionY{0.0f}; std::atomic cameraPositionZ{5.0f}; std::atomic cameraPitch{0.0f}; std::atomic cameraYaw{0.0f}; std::atomic zoom{1.0f}; std::atomic metallic{0.5f}; std::atomic roughness{0.5f}; std::atomic currentHighlightType{HighlightType::None}; std::vector currentHighlightIndices; std::mutex highlightMutex; std::function modelLoadedCallback; std::function analysisCompleteCallback; std::function&, int)> highlightCallback; }; } // namespace algorithm } // namespace hhb