#pragma once

#include "../CommandHistory.h"
#include "../RenderLayerManager.h"
#include <pxr/usd/sdf/path.h>
#include <string>
#include <vector>

namespace UsdLayerManager {

/// Adds one or more prim paths to a render layer's membership (Sdf-level, so
/// this works whether or not layerId is currently active). Re-runs viewport
/// isolation if layerId happens to be the active layer.
class RenderLayerAddMembersCommand : public ICommand {
public:
    RenderLayerAddMembersCommand(RenderLayerManager* mgr, std::string layerId,
                                 std::vector<pxr::SdfPath> paths);
    void Execute() override;
    void Undo()    override;
    std::string GetDescription() const override { return m_description; }

private:
    RenderLayerManager*       m_mgr;
    std::string                m_layerId;
    std::vector<pxr::SdfPath>  m_paths;
    std::string                m_description;
};

class RenderLayerRemoveMembersCommand : public ICommand {
public:
    RenderLayerRemoveMembersCommand(RenderLayerManager* mgr, std::string layerId,
                                    std::vector<pxr::SdfPath> paths);
    void Execute() override;
    void Undo()    override;
    std::string GetDescription() const override { return m_description; }

private:
    RenderLayerManager*       m_mgr;
    std::string                m_layerId;
    std::vector<pxr::SdfPath>  m_paths;
    std::string                m_description;
};

} // namespace UsdLayerManager
