Loading...
Searching...
No Matches
IFaceSet.h
Go to the documentation of this file.
//-*****************************************************************************
//
// Copyright (c) 2009-2012,
// Sony Pictures Imageworks, Inc. and
// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Sony Pictures Imageworks, nor
// Industrial Light & Magic nor the names of their contributors may be used
// to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//-*****************************************************************************
#ifndef Alembic_AbcGeom_IFaceSet_h
#define Alembic_AbcGeom_IFaceSet_h
#include <Alembic/Util/Export.h>
#include <Alembic/AbcGeom/Foundation.h>
#include <Alembic/AbcGeom/SchemaInfoDeclarations.h>
#include <Alembic/AbcGeom/IGeomParam.h>
#include <Alembic/AbcGeom/FaceSetExclusivity.h>
#include <Alembic/AbcGeom/IGeomBase.h>
namespace Alembic {
namespace AbcGeom {
namespace ALEMBIC_VERSION_NS {
//-*****************************************************************************
class ALEMBIC_EXPORT IFaceSetSchema : public IGeomBaseSchema<FaceSetSchemaInfo>
{
public:
//-*************************************************************************
// FACESET MESH SCHEMA SAMPLE TYPE
//-*************************************************************************
class Sample
{
public:
typedef Sample this_type;
Sample() { reset(); }
// main stuff
Abc::Int32ArraySamplePtr getFaces() const { return m_faces; }
// bounds
Abc::Box3d getSelfBounds() const { return m_selfBounds; }
bool valid() const
{
return m_faces.get() != 0;
}
void reset()
{
m_faces.reset();
m_selfBounds.makeEmpty();
}
ALEMBIC_OPERATOR_BOOL( valid() );
protected:
friend class IFaceSetSchema;
Abc::Int32ArraySamplePtr m_faces;
// bounds
Abc::Box3d m_selfBounds;
}; // end IFaceSetSchema::Sample
//-*************************************************************************
// FACESET SCHEMA
//-*************************************************************************
public:
typedef IFaceSetSchema this_type;
//-*************************************************************************
// CONSTRUCTION, DESTRUCTION, ASSIGNMENT
//-*************************************************************************
IFaceSetSchema() {}
IFaceSetSchema( const ICompoundProperty &iParent,
const std::string &iName,
const Abc::Argument &iArg0 = Abc::Argument(),
const Abc::Argument &iArg1 = Abc::Argument() )
: IGeomBaseSchema<FaceSetSchemaInfo>( iParent, iName, iArg0, iArg1 )
{
init( iArg0, iArg1 );
}
IFaceSetSchema( const ICompoundProperty &iProp,
const Abc::Argument &iArg0 = Abc::Argument(),
const Abc::Argument &iArg1 = Abc::Argument() )
: IGeomBaseSchema<FaceSetSchemaInfo>( iProp, iArg0, iArg1 )
{
init( iArg0, iArg1 );
}
template <class CPROP_PTR>
IFaceSetSchema( CPROP_PTR iThis,
Abc::WrapExistingFlag iFlag,
const Abc::Argument &iArg0 = Abc::Argument(),
const Abc::Argument &iArg1 = Abc::Argument() )
: IGeomBaseSchema<FaceSetSchemaInfo>( iThis, iFlag, iArg0, iArg1 )
{
init( iArg0, iArg1 );
}
IFaceSetSchema(const IFaceSetSchema& iCopy)
: IGeomBaseSchema<FaceSetSchemaInfo>()
{
*this = iCopy;
}
//-*************************************************************************
// SCHEMA STUFF
//-*************************************************************************
bool isConstant() const { return (m_facesProperty.isConstant ()); }
//-*************************************************************************
// SAMPLE STUFF
//-*************************************************************************
size_t getNumSamples() const;
AbcA::TimeSamplingPtr getTimeSampling() const
{
if ( m_facesProperty.valid() )
return m_facesProperty.getTimeSampling();
return getObject().getArchive().getTimeSampling(0);
}
void get( Sample &iSamp,
const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const;
Sample getValue( const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const
{
Sample smp;
get( smp, iSS );
return smp;
}
FaceSetExclusivity getFaceExclusivity() const;
Abc::IInt32ArrayProperty getFacesProperty() const
{
return m_facesProperty;
}
//-*************************************************************************
// ABC BASE MECHANISMS
// These functions are used by Abc to deal with errors, rewrapping,
// and so on.
//-*************************************************************************
void reset()
{
m_facesProperty.reset();
IGeomBaseSchema<FaceSetSchemaInfo>::reset();
}
bool valid() const
{
return ( IGeomBaseSchema<FaceSetSchemaInfo>::valid() &&
m_facesProperty.valid() );
}
ALEMBIC_OVERRIDE_OPERATOR_BOOL( IFaceSetSchema::valid() );
protected:
void init( const Abc::Argument &iArg0, const Abc::Argument &iArg1 );
Abc::IInt32ArrayProperty m_facesProperty;
};
//-*****************************************************************************
// SCHEMA OBJECT
//-*****************************************************************************
typedef Abc::ISchemaObject<IFaceSetSchema> IFaceSet;
typedef Util::shared_ptr< IFaceSet > IFaceSetPtr;
} // End namespace ALEMBIC_VERSION_NS
using namespace ALEMBIC_VERSION_NS;
} // End namespace AbcGeom
} // End namespace Alembic
#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