//
// Copyright 2023 Pixar
//
// Licensed under the terms set forth in the LICENSE.txt file available at
// https://openusd.org/license.
//
////////////////////////////////////////////////////////////////////////

/* ************************************************************************** */
/* **                                                                      ** */
/* ** This file is generated by a script.                                  ** */
/* **                                                                      ** */
/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
/* ** Edit hdSchemaDefs.py instead to make changes.                        ** */
/* **                                                                      ** */
/* ************************************************************************** */

#ifndef PXR_IMAGING_HD_SCENE_INDEX_CREATE_ARGS_SCHEMA_H
#define PXR_IMAGING_HD_SCENE_INDEX_CREATE_ARGS_SCHEMA_H

/// \file

#include "pxr/imaging/hd/api.h"

#include "pxr/imaging/hd/schema.h"

// --(BEGIN CUSTOM CODE: Includes)--
// #include "pxr/imaging/hd/renderDelegateInfo.h"
// --(END CUSTOM CODE: Includes)--

PXR_NAMESPACE_OPEN_SCOPE

// --(BEGIN CUSTOM CODE: Declares)--
struct HdRenderDelegateInfo;
using HdRenderDelegateInfoDataSource = HdTypedSampledDataSource<HdRenderDelegateInfo>;
using HdRenderDelegateInfoDataSourceHandle = HdRenderDelegateInfoDataSource::Handle;
// --(END CUSTOM CODE: Declares)--

#define HD_SCENE_INDEX_CREATE_ARGS_SCHEMA_TOKENS \
    (motionBlurSupport) \
    (cameraMotionBlurSupport) \
    (legacyRenderDelegateInfo) \

TF_DECLARE_PUBLIC_TOKENS(HdSceneIndexCreateArgsSchemaTokens, HD_API,
    HD_SCENE_INDEX_CREATE_ARGS_SCHEMA_TOKENS);

//-----------------------------------------------------------------------------


/// \class HdSceneIndexCreateArgsSchema
///
/// Schema for the container data source returned by
/// HdRendererPlugin::GetSceneIndexCreateArgs. The application forwards it
/// (possibly overlayed with its own container data source) to the scene index
/// constructors or scene index plugins. In other words,
/// HdRendererPlugin::GetSceneIndexCreateArgs gives a renderer the opportunity
/// to configure scene indices.
///
/// Examples are: A scene index might use execution which is non-lazy and needs
/// to cache values or even samples for motion blur in advance. The renderer
/// can advertise whether it actually supports motion blur and we need to cache
/// these samples. This similarly applies to the material networks for
/// different render contexts such as glslflx which is understood by Storm but
/// not Prman, for example.
///
class HdSceneIndexCreateArgsSchema : public HdSchema
{
public:
    /// \name Schema retrieval
    /// @{

    HdSceneIndexCreateArgsSchema(HdContainerDataSourceHandle container)
      : HdSchema(container) {}

    /// @}

// --(BEGIN CUSTOM CODE: Schema Methods)--
// --(END CUSTOM CODE: Schema Methods)--

    /// \name Member accessor
    /// @{

    /// Does consumer (most likely HdRenderer) of scene indices need samples
    /// for motion blur? This is relevant, for example, for scene indices
    /// using execution which is non-lazy and needs to know for what times to
    /// cache samples.
    HD_API
    HdBoolDataSourceHandle GetMotionBlurSupport() const;

    /// Does consumer (most likely HdRenderer) of scene indices need samples
    /// for motion blur for cameras? This is a variation of motionBlurSupport.
    /// It is here, for example, for renderers that use an image shader for
    /// camera motion blur.
    HD_API
    HdBoolDataSourceHandle GetCameraMotionBlurSupport() const;

    /// Used for HdRenderIndexAdapterSceneIndex. In particular, this is used
    /// when USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX is false: the
    /// UsdImagingDelegate is querying an emulation render delegate for
    /// information to resolve, for example, the material render contexts
    /// correctly.
    HD_API
    HdRenderDelegateInfoDataSourceHandle GetLegacyRenderDelegateInfo() const; 

    /// @} 

    /// \name Schema construction
    /// @{

    /// \deprecated Use Builder instead.
    ///
    /// Builds a container data source which includes the provided child data
    /// sources. Parameters with nullptr values are excluded. This is a
    /// low-level interface. For cases in which it's desired to define
    /// the container with a sparse set of child fields, the Builder class
    /// is often more convenient and readable.
    HD_API
    static HdContainerDataSourceHandle
    BuildRetained(
        const HdBoolDataSourceHandle &motionBlurSupport,
        const HdBoolDataSourceHandle &cameraMotionBlurSupport,
        const HdRenderDelegateInfoDataSourceHandle &legacyRenderDelegateInfo
    );

    /// \class HdSceneIndexCreateArgsSchema::Builder
    /// 
    /// Utility class for setting sparse sets of child data source fields to be
    /// filled as arguments into BuildRetained. Because all setter methods
    /// return a reference to the instance, this can be used in the "builder
    /// pattern" form.
    class Builder
    {
    public:
        HD_API
        Builder &SetMotionBlurSupport(
            const HdBoolDataSourceHandle &motionBlurSupport);
        HD_API
        Builder &SetCameraMotionBlurSupport(
            const HdBoolDataSourceHandle &cameraMotionBlurSupport);
        HD_API
        Builder &SetLegacyRenderDelegateInfo(
            const HdRenderDelegateInfoDataSourceHandle &legacyRenderDelegateInfo);

        /// Returns a container data source containing the members set thus far.
        HD_API
        HdContainerDataSourceHandle Build();

    private:
        HdBoolDataSourceHandle _motionBlurSupport;
        HdBoolDataSourceHandle _cameraMotionBlurSupport;
        HdRenderDelegateInfoDataSourceHandle _legacyRenderDelegateInfo;

    };

    /// @}
};

PXR_NAMESPACE_CLOSE_SCOPE

#endif