|
| IE_CORE_DECLARERUNTIMETYPED (PrimitiveEvaluator, RunTimeTyped) |
|
| IE_CORE_DECLAREPTR (Result) |
|
virtual ResultPtr | createResult () const =0 |
| Create a result instance which is suitable for passing to one of the query methods.
|
|
virtual ConstPrimitivePtr | primitive () const =0 |
| Returns the primitive which we're currently evaluating.
|
|
virtual void | validateResult (Result *result) const =0 |
| Throws an exception if the passed result type is not compatible with the current evaluator.
|
|
|
The Result passed to each of the methods below must previously have been created by a call to the createResult() method on the same evaluator instance as is being called - passing any other result will cause undefined behaviour. - Threading:
- Query implementations should ensure that they may be called from multiple concurrent threads provided that a unique Result instance is used per thread. This implies that all query data must be stored in the Result and not in the PrimitiveEvaluator itself.
|
virtual bool | signedDistance (const Imath::V3f &p, float &distance, Result *result) const |
|
virtual float | surfaceArea () const =0 |
| Computes the surface area of the primitive.
|
|
virtual float | volume () const =0 |
| Computes the volume of the primitive. The result is undefined if the primitive is not closed, or self intersects.
|
|
virtual Imath::V3f | centerOfGravity () const =0 |
| Computes the primitive's center of gravity. The result is undefined if the primitive is not closed, or self intersects.
|
|
virtual bool | closestPoint (const Imath::V3f &p, Result *result) const =0 |
|
virtual bool | pointAtUV (const Imath::V2f &uv, Result *result) const =0 |
| Find the point on the primitive at the given query UV. Returns true on success.
|
|
virtual bool | intersectionPoint (const Imath::V3f &origin, const Imath::V3f &direction, Result *result, float maxDistance=Imath::limits< float >::max()) const =0 |
|
virtual int | intersectionPoints (const Imath::V3f &origin, const Imath::V3f &direction, std::vector< ResultPtr > &results, float maxDistance=Imath::limits< float >::max()) const =0 |
|
| IE_CORE_DECLAREMEMBERPTR (RunTimeTyped) |
|
virtual TypeId | typeId () const |
|
virtual const char * | typeName () const |
|
virtual bool | isInstanceOf (TypeId typeId) const |
|
virtual bool | isInstanceOf (const char *typeName) const |
|
| IE_CORE_DECLAREMEMBERPTR (RefCounted) |
|
void | addRef () const |
| Add a reference to the current object.
|
|
void | removeRef () const |
| Remove a reference from the current object.
|
|
RefCount | refCount () const |
| Returns the current reference count.
|
|
|
typedef std::map< TypeId, TypeId > | BaseTypeRegistryMap |
|
typedef std::map< TypeId, std::vector< TypeId > > | BaseTypesRegistryMap |
|
typedef std::map< TypeId, std::set< TypeId > > | DerivedTypesRegistryMap |
|
typedef tbb::spin_rw_mutex | Mutex |
|
typedef std::map< TypeId, std::string > | TypeIdsToTypeNamesMap |
|
typedef std::map< std::string, TypeId > | TypeNamesToTypeIdsMap |
|
static BaseTypeRegistryMap & | baseTypeRegistry () |
|
static DerivedTypesRegistryMap & | derivedTypesRegistry () |
|
static BaseTypesRegistryMap & | completeBaseTypesRegistry () |
|
static DerivedTypesRegistryMap & | completeDerivedTypesRegistry () |
|
static void | derivedTypeIdsWalk (TypeId typeId, std::set< TypeId > &) |
|
static TypeIdsToTypeNamesMap & | typeIdsToTypeNames () |
|
static TypeNamesToTypeIdsMap & | typeNamesToTypeIds () |
|
static Mutex | g_baseTypeIdsMutex |
|
static Mutex | g_derivedTypeIdsMutex |
|
Primitive evaluators permit spatial queries on primitives, such as determing the closest point, or retrieving the position from a given UV coordinate, etc. Individual primitive types derive their own evaluators from this interface, and register them by creating static instances of PrimitiveEvaluator::Description. The evaluator takes an internal copy of the primitive, so subsequent changes to it will not be reflected in the evaluator's results.