1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 //    names, trademarks, service marks, or product names of the Licensor
11 //    and its affiliates, except as required to comply with Section 4(c) of
12 //    the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 //     http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_USD_PLUGIN_USD_ABC_ALEMBIC_WRITER_H
25 #define PXR_USD_PLUGIN_USD_ABC_ALEMBIC_WRITER_H
26 
27 /// \file usdAbc/alembicWriter.h
28 
29 #include "pxr/pxr.h"
30 #include "pxr/base/tf/staticTokens.h"
31 #include "pxr/base/tf/declarePtrs.h"
32 #include <boost/noncopyable.hpp>
33 #include <boost/scoped_ptr.hpp>
34 #include <set>
35 #include <string>
36 
37 PXR_NAMESPACE_OPEN_SCOPE
38 
39 
40 // Note -- Even though this header is private we try to keep Alembic headers
41 //         out of it anyway for simplicity's sake.
42 
43 TF_DECLARE_WEAK_AND_REF_PTRS(SdfAbstractData);
44 
45 /// \class UsdAbc_AlembicDataWriter
46 ///
47 /// An alembic writer suitable for an SdfAbstractData.
48 ///
49 class UsdAbc_AlembicDataWriter : boost::noncopyable {
50 public:
51     UsdAbc_AlembicDataWriter();
52     ~UsdAbc_AlembicDataWriter();
53 
54     bool Open(const std::string& filePath, const std::string& comment);
55     bool Write(const SdfAbstractDataConstPtr& data);
56     bool Close();
57 
58     bool IsValid() const;
59     std::string GetErrors() const;
60 
61     void SetFlag(const TfToken&, bool set = true);
62 
63 private:
64     boost::scoped_ptr<class UsdAbc_AlembicDataWriterImpl> _impl;
65     std::string _errorLog;
66 };
67 
68 
69 PXR_NAMESPACE_CLOSE_SCOPE
70 
71 #endif
72