Alembic Version 1.1

Loading...
Searching...
No Matches
IFaceSet.h
Go to the documentation of this file.
1//-*****************************************************************************
2//
3// Copyright (c) 2009-2012,
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_AbcGeom_IFaceSet_h
38#define Alembic_AbcGeom_IFaceSet_h
39
40#include <Alembic/Util/Export.h>
41#include <Alembic/AbcGeom/Foundation.h>
42#include <Alembic/AbcGeom/SchemaInfoDeclarations.h>
43#include <Alembic/AbcGeom/IGeomParam.h>
44#include <Alembic/AbcGeom/FaceSetExclusivity.h>
45#include <Alembic/AbcGeom/IGeomBase.h>
46
47 namespace Alembic {
48 namespace AbcGeom {
49 namespace ALEMBIC_VERSION_NS {
50
51//-*****************************************************************************
52 class ALEMBIC_EXPORT IFaceSetSchema : public IGeomBaseSchema<FaceSetSchemaInfo>
53{
54 public:
55 //-*************************************************************************
56 // FACESET MESH SCHEMA SAMPLE TYPE
57 //-*************************************************************************
58 class Sample
59 {
60 public:
61 typedef Sample this_type;
62
64 Sample() { reset(); }
65
66 // main stuff
67 Abc::Int32ArraySamplePtr getFaces() const { return m_faces; }
68
69 // bounds
70 Abc::Box3d getSelfBounds() const { return m_selfBounds; }
71
72 bool valid() const
73 {
74 return m_faces.get() != 0;
75 }
76
77 void reset()
78 {
79 m_faces.reset();
80
81 m_selfBounds.makeEmpty();
82 }
83
84 ALEMBIC_OPERATOR_BOOL( valid() );
85
86 protected:
87 friend class IFaceSetSchema;
88
89 Abc::Int32ArraySamplePtr m_faces;
90
91
92 // bounds
93 Abc::Box3d m_selfBounds;
94
95 }; // end IFaceSetSchema::Sample
96
97 //-*************************************************************************
98 // FACESET SCHEMA
99 //-*************************************************************************
100 public:
103 typedef IFaceSetSchema this_type;
104
105 //-*************************************************************************
106 // CONSTRUCTION, DESTRUCTION, ASSIGNMENT
107 //-*************************************************************************
108
111 IFaceSetSchema() {}
112
119 IFaceSetSchema( const ICompoundProperty &iParent,
120 const std::string &iName,
121
122 const Abc::Argument &iArg0 = Abc::Argument(),
123 const Abc::Argument &iArg1 = Abc::Argument() )
124 : IGeomBaseSchema<FaceSetSchemaInfo>( iParent, iName, iArg0, iArg1 )
125 {
126 init( iArg0, iArg1 );
127 }
128
133 IFaceSetSchema( const ICompoundProperty &iProp,
134 const Abc::Argument &iArg0 = Abc::Argument(),
135 const Abc::Argument &iArg1 = Abc::Argument() )
136 : IGeomBaseSchema<FaceSetSchemaInfo>( iProp, iArg0, iArg1 )
137 {
138 init( iArg0, iArg1 );
139 }
140
142 template <class CPROP_PTR>
143 IFaceSetSchema( CPROP_PTR iThis,
144 Abc::WrapExistingFlag iFlag,
145
146 const Abc::Argument &iArg0 = Abc::Argument(),
147 const Abc::Argument &iArg1 = Abc::Argument() )
148 : IGeomBaseSchema<FaceSetSchemaInfo>( iThis, iFlag, iArg0, iArg1 )
149 {
150 init( iArg0, iArg1 );
151 }
152
154 IFaceSetSchema(const IFaceSetSchema& iCopy)
155 : IGeomBaseSchema<FaceSetSchemaInfo>()
156 {
157 *this = iCopy;
158 }
159
161
162 //-*************************************************************************
163 // SCHEMA STUFF
164 //-*************************************************************************
165
166
168 bool isConstant() const { return (m_facesProperty.isConstant ()); }
169
170 //-*************************************************************************
171 // SAMPLE STUFF
172 //-*************************************************************************
173
176 size_t getNumSamples() const;
177
179 AbcA::TimeSamplingPtr getTimeSampling() const
180 {
181 if ( m_facesProperty.valid() )
182 return m_facesProperty.getTimeSampling();
183 return getObject().getArchive().getTimeSampling(0);
184 }
185
186 void get( Sample &iSamp,
187 const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const;
188
189 Sample getValue( const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const
190 {
191 Sample smp;
192 get( smp, iSS );
193 return smp;
194 }
195
196 FaceSetExclusivity getFaceExclusivity() const;
197
198 Abc::IInt32ArrayProperty getFacesProperty() const
199 {
200 return m_facesProperty;
201 }
202
203 //-*************************************************************************
204 // ABC BASE MECHANISMS
205 // These functions are used by Abc to deal with errors, rewrapping,
206 // and so on.
207 //-*************************************************************************
208
211 void reset()
212 {
213 m_facesProperty.reset();
214
215 IGeomBaseSchema<FaceSetSchemaInfo>::reset();
216 }
217
220 bool valid() const
221 {
222 return ( IGeomBaseSchema<FaceSetSchemaInfo>::valid() &&
223 m_facesProperty.valid() );
224 }
225
228 ALEMBIC_OVERRIDE_OPERATOR_BOOL( IFaceSetSchema::valid() );
229
230 protected:
231 void init( const Abc::Argument &iArg0, const Abc::Argument &iArg1 );
232
233 Abc::IInt32ArrayProperty m_facesProperty;
234};
235
236//-*****************************************************************************
237// SCHEMA OBJECT
238//-*****************************************************************************
239 typedef Abc::ISchemaObject<IFaceSetSchema> IFaceSet;
240
241 typedef Util::shared_ptr< IFaceSet > IFaceSetPtr;
242
243} // End namespace ALEMBIC_VERSION_NS
244
245 using namespace ALEMBIC_VERSION_NS;
246
247} // End namespace AbcGeom
248} // End namespace Alembic
249
250#endif
Foundation.h
SchemaInfoDeclarations.h
Export.h
ALEMBIC_EXPORT
#define ALEMBIC_EXPORT
Definition Export.h:51
FaceSetExclusivity.h
IGeomBase.h
IGeomParam.h
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample
Definition IFaceSet.h:59
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::IFaceSetSchema
friend class IFaceSetSchema
Definition IFaceSet.h:87
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::reset
void reset()
Definition IFaceSet.h:77
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::Sample
Sample()
Users never create this data directly.
Definition IFaceSet.h:64
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::ALEMBIC_OPERATOR_BOOL
ALEMBIC_OPERATOR_BOOL(valid())
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::m_faces
Abc::Int32ArraySamplePtr m_faces
Definition IFaceSet.h:89
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::m_selfBounds
Abc::Box3d m_selfBounds
Definition IFaceSet.h:93
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::getSelfBounds
Abc::Box3d getSelfBounds() const
Definition IFaceSet.h:70
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::this_type
Sample this_type
Definition IFaceSet.h:61
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::valid
bool valid() const
Definition IFaceSet.h:72
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::Sample::getFaces
Abc::Int32ArraySamplePtr getFaces() const
Definition IFaceSet.h:67
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::IFaceSetSchema
IFaceSetSchema()
Definition IFaceSet.h:111
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::IFaceSetSchema
IFaceSetSchema(const IFaceSetSchema &iCopy)
Copy constructor. (explicit copy ctor for msvc bug workaround)
Definition IFaceSet.h:154
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::getValue
Sample getValue(const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
Definition IFaceSet.h:189
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::getTimeSampling
AbcA::TimeSamplingPtr getTimeSampling() const
Return the time sampling.
Definition IFaceSet.h:179
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::ALEMBIC_OVERRIDE_OPERATOR_BOOL
ALEMBIC_OVERRIDE_OPERATOR_BOOL(IFaceSetSchema::valid())
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::valid
bool valid() const
Definition IFaceSet.h:220
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::isConstant
bool isConstant() const
Default assignment operator used.
Definition IFaceSet.h:168
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::IFaceSetSchema
IFaceSetSchema(const ICompoundProperty &iParent, const std::string &iName, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition IFaceSet.h:119
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::reset
void reset()
Definition IFaceSet.h:211
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::IFaceSetSchema
IFaceSetSchema(CPROP_PTR iThis, Abc::WrapExistingFlag iFlag, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
wrap an existing schema object
Definition IFaceSet.h:143
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::init
void init(const Abc::Argument &iArg0, const Abc::Argument &iArg1)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::getFacesProperty
Abc::IInt32ArrayProperty getFacesProperty() const
Definition IFaceSet.h:198
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::getNumSamples
size_t getNumSamples() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::get
void get(Sample &iSamp, const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::IFaceSetSchema
IFaceSetSchema(const ICompoundProperty &iProp, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition IFaceSet.h:133
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::this_type
IFaceSetSchema this_type
Definition IFaceSet.h:103
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::getFaceExclusivity
FaceSetExclusivity getFaceExclusivity() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetSchema::m_facesProperty
Abc::IInt32ArrayProperty m_facesProperty
Definition IFaceSet.h:233
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IGeomBaseSchema::reset
virtual void reset()
Definition IGeomBase.h:147
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IGeomBaseSchema::valid
virtual bool valid() const
Definition IGeomBase.h:156
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IGeomBaseSchema< FaceSetSchemaInfo >::IGeomBaseSchema
IGeomBaseSchema()
Definition IGeomBase.h:76
Alembic::Abc::ALEMBIC_VERSION_NS::Argument
Definition Argument.h:120
Alembic::Abc::ALEMBIC_VERSION_NS::IBasePropertyT< AbcA::CompoundPropertyReaderPtr >::getObject
IObject getObject() const
Definition IBaseProperty.h:207
Alembic::Abc::ALEMBIC_VERSION_NS::ICompoundProperty
Definition ICompoundProperty.h:53
Alembic::Abc::ALEMBIC_VERSION_NS::ISampleSelector
Definition ISampleSelector.h:49
Alembic::Abc::ALEMBIC_VERSION_NS::ISchemaObject
Definition ISchemaObject.h:56
Alembic::AbcGeom::ALEMBIC_VERSION_NS
Definition ArchiveBounds.h:45
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSetPtr
Util::shared_ptr< IFaceSet > IFaceSetPtr
Definition IFaceSet.h:241
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IFaceSet
Abc::ISchemaObject< IFaceSetSchema > IFaceSet
Definition IFaceSet.h:239
Alembic::AbcGeom::ALEMBIC_VERSION_NS::FaceSetExclusivity
FaceSetExclusivity
Hint to indicate face membership is mutally exclusive. Some structures that group faces only allow a ...
Definition FaceSetExclusivity.h:49
Alembic::AbcGeom
Definition ArchiveBounds.h:44
Alembic::Abc::ALEMBIC_VERSION_NS::IInt32ArrayProperty
ITypedArrayProperty< Int32TPTraits > IInt32ArrayProperty
Definition ITypedArrayProperty.h:221
Alembic::Abc::ALEMBIC_VERSION_NS::Int32ArraySamplePtr
Alembic::Util::shared_ptr< Int32ArraySample > Int32ArraySamplePtr
Definition TypedArraySample.h:224
Alembic::Abc::ALEMBIC_VERSION_NS::WrapExistingFlag
WrapExistingFlag
Definition Foundation.h:94
Alembic
Alembic namespace ...
Definition ArchiveInfo.h:46