3ds Max USD API Reference
Loading...
Searching...
No Matches
SceneBuilderOptions.h
1#pragma once
2
3//**************************************************************************/
4// Copyright (c) 1998-2019 Autodesk, Inc.
5// All rights reserved.
6//
7// These coded instructions, statements, and computer programs contain
8// unpublished proprietary information written by Autodesk, Inc., and are
9// protected by Federal copyright law. They may not be disclosed to third
10// parties or copied or duplicated in any form, in whole or in part, without
11// the prior written consent of Autodesk, Inc.
12//**************************************************************************/
13// DESCRIPTION: Base class for builder options
14// AUTHOR: Autodesk Inc.
15//***************************************************************************/
16
17#include <pxr/usd/sdf/path.h>
18#include <pxr/base/vt/dictionary.h>
19
20#include "MaxUsd/Utilities/Logging.h"
21#include "USDIOCallback.h"
22
23namespace MAXUSD_NS_DEF {
24
25// \brief Merges all the jobContext arguments dictionaries found while exploring the jobContexts into a
26// single one. Also checks for conflicts and errors.
27//
28// \param[in] isExport if we are calling the import or the export jobContext callback.
29// \param[in] contexts jobContexts to merge.
30//
31// \param[out] allContextArgs dictionary of all extra jobContext arguments merged together.
32// \return true if the merge was successful, false if a conflict or an error was detected.
33MaxUSDAPI bool MergeJobContexts(bool isExport, const std::set<std::string>& contexts, pxr::VtDictionary& allContextArgs);
34
39{
40public:
41 MaxUSDAPI virtual ~SceneBuilderOptions() = default;
47 // Const version
48 MaxUSDAPI const Log::Options& GetLogOptions() const;
49
55 MaxUSDAPI void GetCallBacks(USDIOEventType type, std::vector<std::shared_ptr<USDIOCallback>>& eventCallbacks) const;
56
61 MaxUSDAPI const std::map<USDIOEventType, std::map<std::wstring, std::shared_ptr<USDIOCallback>>>& GetCallBacks()
62 const;
63
73 MaxUSDAPI void RemoveCallbacks(USDIOEventType type = USDIOEventType::None, const std::wstring& id = L"");
74
81 MaxUSDAPI void AddCallback(USDIOEventType type, const std::wstring& id, std::shared_ptr<USDIOCallback> callback);
82
83protected:
87 std::map<USDIOEventType, std::map<std::wstring, std::shared_ptr<USDIOCallback>>> callbacks;
88};
89}
Class for getting and setting builder options.
Definition: SceneBuilderOptions.h:39
MaxUSDAPI Log::Options & GetLogOptions()
Returns the builder's logging options.
MaxUSDAPI void GetCallBacks(USDIOEventType type, std::vector< std::shared_ptr< USDIOCallback > > &eventCallbacks) const
Gets all registered callbacks for the given event type.
MaxUSDAPI const std::map< USDIOEventType, std::map< std::wstring, std::shared_ptr< USDIOCallback > > > & GetCallBacks() const
Returns all registered callbacks organized by event types and callback Id.
MaxUSDAPI void RemoveCallbacks(USDIOEventType type=USDIOEventType::None, const std::wstring &id=L"")
Removes callbacks by event type and/or id.
MaxUSDAPI void AddCallback(USDIOEventType type, const std::wstring &id, std::shared_ptr< USDIOCallback > callback)
Registers a new callback.
Log::Options logOptions
Logging options.
Definition: SceneBuilderOptions.h:85
std::map< USDIOEventType, std::map< std::wstring, std::shared_ptr< USDIOCallback > > > callbacks
Registered callbacks.
Definition: SceneBuilderOptions.h:87
Definition: Logging.h:63