Skip to content

Commit

Permalink
TypedObjectPlug : Add Int64VectorDataPlug
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldresser-ie committed Oct 23, 2024
1 parent 6bf521d commit 4c601ac
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/Gaffer/TypeIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ enum TypeId
CollectTypeId = 110108,
Box2fVectorDataPlugTypeId = 110109,
PatternMatchTypeId = 110110,
Int64VectorDataPlugTypeId = 110111,

LastTypeId = 110159,

Expand Down
3 changes: 3 additions & 0 deletions include/Gaffer/TypedObjectPlug.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class IECORE_EXPORT TypedObjectPlug : public ValuePlug
extern template class TypedObjectPlug<IECore::Object>;
extern template class TypedObjectPlug<IECore::BoolVectorData>;
extern template class TypedObjectPlug<IECore::IntVectorData>;
extern template class TypedObjectPlug<IECore::Int64VectorData>;
extern template class TypedObjectPlug<IECore::FloatVectorData>;
extern template class TypedObjectPlug<IECore::StringVectorData>;
extern template class TypedObjectPlug<IECore::InternedStringVectorData>;
Expand All @@ -146,6 +147,7 @@ extern template class TypedObjectPlug<IECore::PathMatcherData>;
using ObjectPlug = TypedObjectPlug<IECore::Object>;
using BoolVectorDataPlug = TypedObjectPlug<IECore::BoolVectorData>;
using IntVectorDataPlug = TypedObjectPlug<IECore::IntVectorData>;
using Int64VectorDataPlug = TypedObjectPlug<IECore::Int64VectorData>;
using FloatVectorDataPlug = TypedObjectPlug<IECore::FloatVectorData>;
using StringVectorDataPlug = TypedObjectPlug<IECore::StringVectorData>;
using InternedStringVectorDataPlug = TypedObjectPlug<IECore::InternedStringVectorData>;
Expand All @@ -166,6 +168,7 @@ using PathMatcherDataPlug = TypedObjectPlug<IECore::PathMatcherData>;
IE_CORE_DECLAREPTR( ObjectPlug );
IE_CORE_DECLAREPTR( BoolVectorDataPlug );
IE_CORE_DECLAREPTR( IntVectorDataPlug );
IE_CORE_DECLAREPTR( Int64VectorDataPlug );
IE_CORE_DECLAREPTR( FloatVectorDataPlug );
IE_CORE_DECLAREPTR( StringVectorDataPlug );
IE_CORE_DECLAREPTR( InternedStringVectorDataPlug );
Expand Down
1 change: 1 addition & 0 deletions python/GafferUI/VectorDataPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def _createRows( self ) :

GafferUI.PlugValueWidget.registerType( Gaffer.BoolVectorDataPlug, VectorDataPlugValueWidget )
GafferUI.PlugValueWidget.registerType( Gaffer.IntVectorDataPlug, VectorDataPlugValueWidget )
GafferUI.PlugValueWidget.registerType( Gaffer.Int64VectorDataPlug, VectorDataPlugValueWidget )
GafferUI.PlugValueWidget.registerType( Gaffer.FloatVectorDataPlug, VectorDataPlugValueWidget )
GafferUI.PlugValueWidget.registerType( Gaffer.StringVectorDataPlug, VectorDataPlugValueWidget )
GafferUI.PlugValueWidget.registerType( Gaffer.V2iVectorDataPlug, VectorDataPlugValueWidget )
Expand Down
11 changes: 11 additions & 0 deletions src/Gaffer/PlugAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ ValuePlugPtr createPlugFromData( const std::string &name, Plug::Direction direct
{
return typedObjectValuePlug( name, direction, flags, static_cast<const IntVectorData *>( value ) );
}
case Int64VectorDataTypeId :
{
return typedObjectValuePlug( name, direction, flags, static_cast<const Int64VectorData *>( value ) );
}
case StringVectorDataTypeId :
{
return typedObjectValuePlug( name, direction, flags, static_cast<const StringVectorData *>( value ) );
Expand Down Expand Up @@ -488,6 +492,8 @@ IECore::DataPtr getValueAsData( const ValuePlug *plug )
return static_cast<const FloatVectorDataPlug *>( plug )->getValue()->copy();
case IntVectorDataPlugTypeId :
return static_cast<const IntVectorDataPlug *>( plug )->getValue()->copy();
case Int64VectorDataPlugTypeId :
return static_cast<const Int64VectorDataPlug *>( plug )->getValue()->copy();
case StringVectorDataPlugTypeId :
return static_cast<const StringVectorDataPlug *>( plug )->getValue()->copy();
case InternedStringVectorDataPlugTypeId :
Expand Down Expand Up @@ -1015,6 +1021,7 @@ bool canSetCompoundNumericPlugValue( const Data *value )
case V2iVectorDataTypeId :
case FloatVectorDataTypeId :
case IntVectorDataTypeId :
case Int64VectorDataTypeId :
case BoolVectorDataTypeId :
return IECore::size( value ) == 1;
default :
Expand Down Expand Up @@ -1071,6 +1078,8 @@ bool canSetValueFromData( const ValuePlug *plug, const IECore::Data *value )
return canSetTypedDataPlugValue<FloatVectorDataPlug>( value );
case Gaffer::IntVectorDataPlugTypeId:
return canSetTypedDataPlugValue<IntVectorDataPlug>( value );
case Gaffer::Int64VectorDataPlugTypeId:
return canSetTypedDataPlugValue<Int64VectorDataPlug>( value );
case Gaffer::StringPlugTypeId:
return canSetStringPlugValue( value );
case Gaffer::StringVectorDataPlugTypeId:
Expand Down Expand Up @@ -1145,6 +1154,8 @@ bool setValueFromData( ValuePlug *plug, const IECore::Data *value )
return setTypedDataPlugValue( static_cast<FloatVectorDataPlug *>( plug ), value );
case Gaffer::IntVectorDataPlugTypeId:
return setTypedDataPlugValue( static_cast<IntVectorDataPlug *>( plug ), value );
case Gaffer::Int64VectorDataPlugTypeId:
return setTypedDataPlugValue( static_cast<Int64VectorDataPlug *>( plug ), value );
case Gaffer::StringPlugTypeId:
return setStringPlugValue( static_cast<StringPlug *>( plug ), value );
case Gaffer::StringVectorDataPlugTypeId:
Expand Down
2 changes: 2 additions & 0 deletions src/Gaffer/TypedObjectPlug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace Gaffer
GAFFER_PLUG_DEFINE_TEMPLATE_TYPE( Gaffer::ObjectPlug, ObjectPlugTypeId )
GAFFER_PLUG_DEFINE_TEMPLATE_TYPE( Gaffer::BoolVectorDataPlug, BoolVectorDataPlugTypeId )
GAFFER_PLUG_DEFINE_TEMPLATE_TYPE( Gaffer::IntVectorDataPlug, IntVectorDataPlugTypeId )
GAFFER_PLUG_DEFINE_TEMPLATE_TYPE( Gaffer::Int64VectorDataPlug, Int64VectorDataPlugTypeId )
GAFFER_PLUG_DEFINE_TEMPLATE_TYPE( Gaffer::FloatVectorDataPlug, FloatVectorDataPlugTypeId )
GAFFER_PLUG_DEFINE_TEMPLATE_TYPE( Gaffer::StringVectorDataPlug, StringVectorDataPlugTypeId )
GAFFER_PLUG_DEFINE_TEMPLATE_TYPE( Gaffer::InternedStringVectorDataPlug, InternedStringVectorDataPlugTypeId )
Expand Down Expand Up @@ -153,6 +154,7 @@ void StringVectorDataPlug::setFrom( const ValuePlug *other )
template class TypedObjectPlug<IECore::Object>;
template class TypedObjectPlug<IECore::BoolVectorData>;
template class TypedObjectPlug<IECore::IntVectorData>;
template class TypedObjectPlug<IECore::Int64VectorData>;
template class TypedObjectPlug<IECore::FloatVectorData>;
template class TypedObjectPlug<IECore::StringVectorData>;
template class TypedObjectPlug<IECore::InternedStringVectorData>;
Expand Down
1 change: 1 addition & 0 deletions src/GafferModule/TypedObjectPlugBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void GafferModule::bindTypedObjectPlug()
GafferBindings::TypedObjectPlugClass<Gaffer::ObjectPlug>();
GafferBindings::TypedObjectPlugClass<Gaffer::BoolVectorDataPlug>();
GafferBindings::TypedObjectPlugClass<Gaffer::IntVectorDataPlug>();
GafferBindings::TypedObjectPlugClass<Gaffer::Int64VectorDataPlug>();
GafferBindings::TypedObjectPlugClass<Gaffer::FloatVectorDataPlug>();
GafferBindings::TypedObjectPlugClass<Gaffer::StringVectorDataPlug>();
GafferBindings::TypedObjectPlugClass<Gaffer::InternedStringVectorDataPlug>();
Expand Down

0 comments on commit 4c601ac

Please sign in to comment.