1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
|
//-*****************************************************************************
//
// Copyright (c) 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.
//
//-*****************************************************************************
#include <Foundation.h>
using namespace boost::python;
//-*****************************************************************************
template<class T>
static void register_(const char* iName)
{
// overloads
//
struct Overloads
{
static bool matchesMetaData( const AbcA::MetaData& iMetaData,
Abc::SchemaInterpMatching iMatching )
{
return T::matches( iMetaData, iMatching );
}
static bool matchesHeader( const AbcA::PropertyHeader& iHeader,
Abc::SchemaInterpMatching iMatching )
{
return T::matches( iHeader, iMatching );
}
};
// ITypedScalarProperty
class_<T, bases<Abc::IScalarProperty> >(
iName,
"This class is a typed scalar property reader",
init<>( "Create an empty property" ) )
.def( init<Abc::ICompoundProperty,
const std::string&,
optional<
Abc::Argument,
Abc::Argument> >(
( arg( "parent" ), arg( "name" ),
arg( "argument" ), arg( "argument" ) ),
"Create a new typed property with the given parent "
"OCompoundProperty, name and optional arguments which can "
"be use to override the ErrorHandlingPolicy, to specify "
"MetaData" ) )
.def( "getInterpretation",
&T::getInterpretation,
"Return the interpretation string expected of this property" )
.def( "matches",
Overloads::matchesMetaData,
( arg( "metaData" ),
arg( "matchingSchema" ) = Abc::kStrictMatching ),
"Return True if the given entity (as represented by a metadata) "
"strictly matches the interpretation of this typed property" )
.def( "matches",
Overloads::matchesHeader,
( arg( "propertyHeader" ),
arg( "matchingSchema" ) = Abc::kStrictMatching ),
"Return True if the given entity (as represented by a property "
"header) strictly matches the interepretation of this typed "
"property, as well as the data type" )
.staticmethod( "matches" )
;
}
//-*****************************************************************************
void register_itypedscalarproperty()
{
register_<Abc::IBoolProperty> ( "IBoolProperty" );
register_<Abc::IUcharProperty> ( "IUcharProperty" );
register_<Abc::ICharProperty> ( "ICharProperty" );
register_<Abc::IUInt16Property> ( "IUInt16Property" );
register_<Abc::IInt16Property> ( "IInt16Property" );
register_<Abc::IUInt32Property> ( "IUInt32Property" );
register_<Abc::IInt32Property> ( "IInt32Property" );
register_<Abc::IUInt64Property> ( "IUInt64Property" );
register_<Abc::IInt64Property> ( "IInt64Property" );
register_<Abc::IHalfProperty> ( "IHalfProperty" );
register_<Abc::IFloatProperty> ( "IFloatProperty" );
register_<Abc::IDoubleProperty> ( "IDoubleProperty" );
register_<Abc::IStringProperty> ( "IStringProperty" );
register_<Abc::IWstringProperty>( "IWstringProperty" );
register_<Abc::IV2sProperty>( "IV2sProperty" );
register_<Abc::IV2iProperty>( "IV2iProperty" );
register_<Abc::IV2fProperty>( "IV2fProperty" );
register_<Abc::IV2dProperty>( "IV2dProperty" );
register_<Abc::IV3sProperty>( "IV3sProperty" );
register_<Abc::IV3iProperty>( "IV3iProperty" );
register_<Abc::IV3fProperty>( "IV3fProperty" );
register_<Abc::IV3dProperty>( "IV3dProperty" );
register_<Abc::IP2sProperty>( "IP2sProperty" );
register_<Abc::IP2iProperty>( "IP2iProperty" );
register_<Abc::IP2fProperty>( "IP2fProperty" );
register_<Abc::IP2dProperty>( "IP2dProperty" );
register_<Abc::IP3sProperty>( "IP3sProperty" );
register_<Abc::IP3iProperty>( "IP3iProperty" );
register_<Abc::IP3fProperty>( "IP3fProperty" );
register_<Abc::IP3dProperty>( "IP3dProperty" );
register_<Abc::IBox2sProperty>( "IBox2sProperty" );
register_<Abc::IBox2iProperty>( "IBox2iProperty" );
register_<Abc::IBox2fProperty>( "IBox2fProperty" );
register_<Abc::IBox2dProperty>( "IBox2dProperty" );
register_<Abc::IBox3sProperty>( "IBox3sProperty" );
register_<Abc::IBox3iProperty>( "IBox3iProperty" );
register_<Abc::IBox3fProperty>( "IBox3fProperty" );
register_<Abc::IBox3dProperty>( "IBox3dProperty" );
register_<Abc::IM33fProperty>( "IM33fProperty" );
register_<Abc::IM33dProperty>( "IM33dProperty" );
register_<Abc::IM44fProperty>( "IM44fProperty" );
register_<Abc::IM44dProperty>( "IM44dProperty" );
register_<Abc::IQuatfProperty>( "IQuatfProperty" );
register_<Abc::IQuatdProperty>( "IQuatdProperty" );
register_<Abc::IC3hProperty>( "IC3hProperty" );
register_<Abc::IC3fProperty>( "IC3fProperty" );
register_<Abc::IC3cProperty>( "IC3cProperty" );
register_<Abc::IC4hProperty>( "IC4hProperty" );
register_<Abc::IC4fProperty>( "IC4fProperty" );
register_<Abc::IC4cProperty>( "IC4cProperty" );
register_<Abc::IN2fProperty>( "IN2fProperty" );
register_<Abc::IN2dProperty>( "IN2dProperty" );
register_<Abc::IN3fProperty>( "IN3fProperty" );
register_<Abc::IN3dProperty>( "IN3dProperty" );
}
|