Alembic 1.8.11
Loading...
Searching...
No Matches
ApwImpl.h
1//-*****************************************************************************
2//
3// Copyright (c) 2013,
4// Sony Pictures Imageworks, Inc. and
5// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
6//
7// All rights reserved.
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12// * Redistributions of source code must retain the above copyright
13// notice, this list of conditions and the following disclaimer.
14// * Redistributions in binary form must reproduce the above
15// copyright notice, this list of conditions and the following disclaimer
16// in the documentation and/or other materials provided with the
17// distribution.
18// * Neither the name of Sony Pictures Imageworks, nor
19// Industrial Light & Magic nor the names of their contributors may be used
20// to endorse or promote products derived from this software without specific
21// prior written permission.
22//
23// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34//
35//-*****************************************************************************
36
37#ifndef Alembic_AbcCoreOgawa_ApwImpl_h
38#define Alembic_AbcCoreOgawa_ApwImpl_h
39
40#include <Alembic/AbcCoreOgawa/Foundation.h>
41#include <Alembic/AbcCoreOgawa/WrittenSampleMap.h>
42
43namespace Alembic {
44namespace AbcCoreOgawa {
45namespace ALEMBIC_VERSION_NS {
46
47//-*****************************************************************************
48class ApwImpl
49 : public AbcA::ArrayPropertyWriter
50 , public Alembic::Util::enable_shared_from_this<ApwImpl>
51{
52protected:
53 friend class CpwData;
54
55 //-*************************************************************************
56 ApwImpl( AbcA::CompoundPropertyWriterPtr iParent,
57 Ogawa::OGroupPtr iGroup,
58 PropertyHeaderPtr iHeader,
59 size_t iIndex );
60
61 virtual AbcA::ArrayPropertyWriterPtr asArrayPtr();
62
63public:
64 virtual ~ApwImpl();
65
66 // ArrayPropertyWriter overrides
67 virtual void setSample( const AbcA::ArraySample & iSamp );
68 virtual void setFromPreviousSample();
69 virtual size_t getNumSamples();
70 virtual void setTimeSamplingIndex( Util::uint32_t iIndex );
71
72 // BasePropertyWriter overrides
73 virtual const AbcA::PropertyHeader & getHeader() const;
74 virtual AbcA::ObjectWriterPtr getObject();
75 virtual AbcA::CompoundPropertyWriterPtr getParent();
76
77protected:
78 // Previous written array sample identifier!
79 WrittenSampleIDPtr m_previousWrittenSampleID;
80
81private:
82 // The parent compound property writer.
83 AbcA::CompoundPropertyWriterPtr m_parent;
84
85 // The header which defines this property.
86 // And extra data the parent needs to eventually write out
87 PropertyHeaderPtr m_header;
88
89 // for accumulating our hierarchical hash
90 Util::Digest m_hash;
91
92 Ogawa::OGroupPtr m_group;
93
94 AbcA::Dimensions m_dims;
95
96 size_t m_index;
97};
98
99} // End namespace ALEMBIC_VERSION_NS
100
101using namespace ALEMBIC_VERSION_NS;
102
103} // End namespace AbcCoreOgawa
104} // End namespace Alembic
105
106#endif
virtual AbcA::CompoundPropertyWriterPtr getParent()
Definition ApwImpl.cpp:272
virtual AbcA::ObjectWriterPtr getObject()
Definition ApwImpl.cpp:265
virtual void setFromPreviousSample()
Definition ApwImpl.cpp:106
virtual const AbcA::PropertyHeader & getHeader() const
Definition ApwImpl.cpp:258
virtual AbcA::ArrayPropertyWriterPtr asArrayPtr()
Definition ApwImpl.cpp:229
virtual size_t getNumSamples()
Definition ApwImpl.cpp:235
Alembic namespace ...
Definition ArchiveInfo.cpp:39