17#ifndef BIFROST_GEOMETRY_GEO_PROPERTY_H
18#define BIFROST_GEOMETRY_GEO_PROPERTY_H
213 Amino::newClassPtr<Amino::Array<Amino::String>>(0);
231template <
typename DataType>
260 Amino::Any propVal =
object.getProperty(property);
261 auto dataObj = Amino::any_cast<Amino::Ptr<Bifrost::Object>>(&propVal);
262 if (!dataObj || dataObj->get() ==
nullptr || !(*dataObj)->hasProperty(
Geometry::sData)) {
267 auto data = Amino::any_cast<Amino::Ptr<Amino::Array<T>>>(&dataVal);
268 return data ? std::move(*data) :
nullptr;
278template <
typename DataType>
282 Amino::Any val =
object.getProperty(property);
283 auto dataObj = Amino::any_cast<Amino::Ptr<Bifrost::Object>>(&val);
284 if (!dataObj || dataObj->get() ==
nullptr || !(*dataObj)->hasProperty(
Geometry::sData)) {
288 auto dataObj2 = dataObj->toMutable();
290 object.setProperty(property, std::move(dataObj2));
String view class (similar to std::string_view)
Definition of macros for symbol visibility.
#define BIFROST_GEOMETRY_DECL
Geometry related types that flow in the graph that are defined in C++.
Geo Property key strings declaration. Used as keys in Geometry Objects.
Bifrost object interface declaration.
Amino::String BIFROST_GEOMETRY_DECL getTargetComponent(const Bifrost::Object &object, Amino::StringView geoProp)
Determines the topological component that the specified geometry property is defined over.
Amino::Array< Amino::String > BIFROST_GEOMETRY_DECL getTargetChain(const Bifrost::Object &object, Amino::StringView geoProp)
Walks the target chain from the given geo property to the terminal geo component property.
Amino::Ptr< Bifrost::Object > BIFROST_GEOMETRY_DECL getGeoPropTarget(const Bifrost::Object &object, const Bifrost::Object &geoProp)
Get referenced counted pointer of the target of a specified geometry property.
Amino::String BIFROST_GEOMETRY_DECL getGeoPropTargetName(const Bifrost::Object &object, Amino::StringView geoProp)
Get the name of the target for the specified geo property.
void BIFROST_GEOMETRY_DECL populateComponentGeoProperty(Amino::uint_t elementCount, Bifrost::Object &object)
Populate a Geometry object with the required properties to conform to the component geometry property...
Amino::Ptr< Bifrost::Object > BIFROST_GEOMETRY_DECL getComponentGeoPropPrototype()
Returns the prototypical component geometry property object.
Amino::uint_t BIFROST_GEOMETRY_DECL getElementCount(const Bifrost::Object &object, Amino::StringView component)
Get the number of elements in a component of a geometry.
bool BIFROST_GEOMETRY_DECL setElementCount(Amino::StringView component, Amino::uint_t elementCount, Bifrost::Object &object)
Set the number of elements in a component of a geometry.
void populateDataGeoProperty(T defaultValue, Bifrost::Object &object)
Populate a Geometry object with the required properties to conform to the data geometry property sche...
Amino::Ptr< Bifrost::Object > BIFROST_GEOMETRY_DECL getDataGeoPropPrototype(Amino::StringView property=Geometry::sGenericDataGeoProp)
Returns the prototypical data geometry property object.
Amino::Ptr< Amino::Array< T > > getDataGeoPropValues(const Bifrost::Object &object, Amino::StringView property)
Get the actual data array from a data geometry property.
Amino::Ptr< Bifrost::Object > BIFROST_GEOMETRY_DECL getDataGeoProperty(const Bifrost::Object &object, Amino::StringView property)
Get a geo property from an object, with the specified name.
bool BIFROST_GEOMETRY_DECL isOffsetDataGeoProp(const Bifrost::Object &object, Amino::StringView property)
Queries if the specified property is an offset array.
bool setDataGeoPropValues(Amino::StringView property, Amino::Ptr< Amino::Array< DataType > > dataPropValues, Bifrost::Object &object)
Sets the actual data array in a data geometry property.
Amino::String BIFROST_GEOMETRY_DECL getGeoPropRangeName(Amino::StringView geoProp)
Gets the name of a data geo property's corresponding range geo property.
Amino::Ptr< Amino::Array< Index > > BIFROST_GEOMETRY_DECL getRangeGeoPropIndices(const Bifrost::Object &object, Amino::StringView property)
Get the indices for the specified range geometry property.
Amino::Ptr< Bifrost::Object > BIFROST_GEOMETRY_DECL getRangeGeoProperty(const Bifrost::Object &object, Amino::StringView property)
Get a range geo property from an object.
bool BIFROST_GEOMETRY_DECL setRangeGeoPropIndices(Amino::StringView property, Amino::Ptr< Amino::Array< Index > > indices, Bifrost::Object &object)
Get the indices for the specified range geometry property.
void BIFROST_GEOMETRY_DECL populateRangeGeoProperty(Bifrost::Object &object)
Populate a Geometry object with the required properties to conform to the range geometry property sch...
void BIFROST_GEOMETRY_DECL populateTrivialRangeIndices(size_t count, Amino::Array< Index > &indices)
Creates a trivial indexing with the specified size.
Amino::Ptr< Bifrost::Object > BIFROST_GEOMETRY_DECL getRangeGeoPropPrototype()
Returns the prototypical range geometry property object.
Amino::Array< Amino::String > BIFROST_GEOMETRY_DECL getGeoPropNamesByTarget(Bifrost::Object const &object, Amino::StringView target)
Given a target string, return an array of property keys that have that target.
Amino::Array< Amino::Ptr< Bifrost::Object > > BIFROST_GEOMETRY_DECL getGeoPropsByTarget(Bifrost::Object const &object, Amino::StringView target)
Given a target string, return an array of geo prop objects that have that target.
Amino::Array< Amino::String > BIFROST_GEOMETRY_DECL getGeoPropNamesByPrototype(Bifrost::Object const &object, Bifrost::Object const &prototype)
Given a prototype, ex.: a geo property prototype (component, range, or data), return an array of prop...
Amino::Array< Amino::Ptr< Bifrost::Object > > BIFROST_GEOMETRY_DECL getGeoPropsByPrototype(Bifrost::Object const &object, Bifrost::Object const &prototype)
Given a prototype, ex.: a geo property prototype (component, range, or data), return an array of obje...
Amino::Array< Amino::String > BIFROST_GEOMETRY_DECL getGeoPropsByName(Bifrost::Object const &object, Amino::StringView pattern)
Given a pattern, return an array of property keys that have that pattern.
Amino::String BIFROST_GEOMETRY_DECL getUniqueGeoPropName(Amino::StringView propertyName, Bifrost::Object const &object)
Given a name, return a name that is similar but unique to the specified object.
unsigned int uint_t
Type alias for Amino's uint type, an unsigned 32-bit integer.
BIFROST_GEOMETRY_DECL Amino::String const sGenericDataGeoProp
BIFROST_GEOMETRY_DECL Amino::String const sNullString
BIFROST_GEOMETRY_DECL Amino::String const sInterp
BIFROST_GEOMETRY_DECL Amino::String const sData
BIFROST_GEOMETRY_DECL Amino::String const sDependsOn
BIFROST_GEOMETRY_DECL Amino::String const sTarget
BIFROST_GEOMETRY_DECL Amino::String const sDefault
@ Linear
Linear interpolation.
Generic value class that allows for storage of a value of any type.
Define a Amino array of elements of type T.
The string class used by Amino.
String view class (similar to std::string_view).
An interface for dictionary-like objects.
bool setProperty(Amino::StringView key, T &&value) noexcept
Set a property. Replace or add depending on if the property already exists or not in the object.