/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef OD_GS_SR_CONVEYOR_NODE_MANAGER #define OD_GS_SR_CONVEYOR_NODE_MANAGER #include "Gi/GiOrthoClipper.h" #include "Gi/GiPerspectivePreprocessor.h" #include "Gi/GiHLRemover.h" #include "Gi/GiXform.h" class OdGsSrBaseView; class OdSrConveyorPipelineManager { public: OdSrConveyorPipelineManager(); ~OdSrConveyorPipelineManager(); void setupPipeline(OdGsSrBaseView* pView); void destroyPipeline(); struct PipelineConfig { bool hlrEnabled = false; }; class ConfigUpdater { OdSrConveyorPipelineManager* m_manager; bool m_active; PipelineConfig& config() { return m_manager->m_config; } public: explicit ConfigUpdater(OdSrConveyorPipelineManager* manager) : m_manager(manager), m_active(true) {} ~ConfigUpdater() { if (m_active && m_manager) { m_manager->onChangeConfig(); } } ConfigUpdater(const ConfigUpdater&) = delete; ConfigUpdater& operator=(const ConfigUpdater&) = delete; ConfigUpdater(ConfigUpdater&& other) noexcept : m_manager(other.m_manager), m_active(other.m_active) { other.m_active = false; } ConfigUpdater& operator=(ConfigUpdater&&) = delete; // HLR configuration methods ConfigUpdater& enableHLR(bool enable) { config().hlrEnabled = enable; return *this; } // onChange() called automatically in the destructor }; ConfigUpdater configure(); void onChangeConfig(); void process(); void processOnce(); // Get final output destination OdGiConveyorOutput& finalOutput(); private: // Pipeline nodes OdGiHLRemoverPtr m_pHLR; PipelineConfig m_config; OdGsSrBaseView* m_pCurrentView = nullptr; }; #endif // OD_GS_SR_CONVEYOR_NODE_MANAGER