Free Electron
Classes | Public Types | Public Member Functions | List of all members
fe::ext::SurfaceI Class Referenceabstract

Spatial boundary. More...

#include <SurfaceI.h>

Inheritance diagram for fe::ext::SurfaceI:
Inheritance graph
[legend]

Classes

class  GaugeI
 calculate surface distances More...
 
class  ImpactI
 results of a surface intersection More...
 

Public Types

enum  SampleMethod {
  e_flat,
  e_linear,
  e_pointNormal,
  e_spline
}
 
enum  Containment {
  e_unknown,
  e_inside,
  e_outside
}
 
enum  Accuracy {
  e_sphere,
  e_triangle
}
 
enum  Triangulation {
  e_existingPoints,
  e_balanced
}
 
enum  Restrictions {
  e_unrestricted = 0x0,
  e_excludeCurves = 0x1,
  e_excludePolygons = 0x2
}
 

Public Member Functions

virtual void bind (Instance a_instance)=0
 associate with model data More...
 
virtual void setSampleMethod (SampleMethod a_sampleMethod)=0
 
virtual void setNodeName (String a_nodeName)=0
 
virtual String nodeName (void) const =0
 
virtual void setRestrictions (Restrictions a_restrictions)=0
 
virtual Restrictions restrictions (void) const =0
 
virtual void setRefinement (U32 a_refinement)=0
 Set limitation of surface improvement, such as subdivision. More...
 
virtual void setAccuracy (Accuracy a_accuracy)=0
 Set what primitive to search down to. More...
 
virtual void setSearchable (BWORD a_searchable)=0
 Set whether this surface may be searched. More...
 
virtual void setSearch (String a_searchName)=0
 Set component to use for searching. More...
 
virtual void setTriangulation (Triangulation a_triangulation)=0
 Set how 4+ vertex polygons break down. More...
 
virtual I32 triangleCount (void)=0
 Number of barycentric elements. More...
 
virtual Color diffuse (void) const =0
 Return the diffuse color. More...
 
virtual Containment containment (const SpatialVector &a_origin)=0
 
virtual Containment containment (const SpatialVector &a_origin) const =0
 
virtual sp< GaugeIgauge (void)=0
 
virtual void partitionWith (String a_attributeName)=0
 
virtual U32 partitionCount (void) const =0
 
virtual String partitionName (U32 a_index) const =0
 
virtual Vector4 partitionSphere (U32 a_index) const =0
 
virtual I32 setPartitionFilter (String a_filterString)=0
 
virtual I32 setPartitionFilter (String a_filterString, PartitionI::FilterMethod a_filterMethod)=0
 
virtual sp< PartitionIcreatePartition (void)=0
 
Return the bounding center
virtual SpatialVector center (void)=0
 
virtual SpatialVector center (void) const =0
 
Return the bounding radius
virtual Real radius (void)=0
 
virtual Real radius (void) const =0
 
Sample local transform on surface

The notion of u and v may have limited sense on some surface types.

The full domain of u and v may not reach the full range of some surfaces.

An implemention is permitted clamp u or v to the range 0 to 1, but may choose to extrapolate in one or both axes.

The const version does not permit caching.

virtual SpatialTransform sample (Vector2 a_uv)=0
 
virtual SpatialTransform sample (Vector2 a_uv) const =0
 
Sample local transform on a surface face

Surfaces that don't have faces may simply return identity.

An implemention is permitted clamp the barycentric coordinates to the range 0 to 1, but may choose to extrapolate instead.

The const version does not permit caching.

virtual SpatialTransform sample (I32 a_triangleIndex, SpatialBary a_barycenter)=0
 
virtual SpatialTransform sample (I32 a_triangleIndex, SpatialBary a_barycenter) const =0
 
virtual SpatialTransform sample (I32 a_triangleIndex, SpatialBary a_barycenter, SpatialVector a_tangent) const =0
 
Sample surface face as ImpactI

This method is similar to sample(), but populates an ImpactI.

Not all value may be populated.

The const version does not permit caching.

virtual sp< ImpactIsampleImpact (I32 a_triangleIndex, SpatialBary a_barycenter)=0
 
virtual sp< ImpactIsampleImpact (I32 a_triangleIndex, SpatialBary a_barycenter) const =0
 
virtual sp< ImpactIsampleImpact (I32 a_triangleIndex, SpatialBary a_barycenter, SpatialVector a_tangent) const =0
 
Sample location on surface

An implemention may just use the translation from the result of sample(), but is encouraged to provide a more efficient limited evaluation, if reasonable.

The const version does not permit caching.

virtual SpatialVector samplePoint (const SpatialTransform &a_transform, Vector2 a_uv)=0
 
virtual SpatialVector samplePoint (Vector2 a_uv)=0
 
virtual SpatialVector samplePoint (const SpatialTransform &a_transform, Vector2 a_uv) const =0
 
virtual SpatialVector samplePoint (Vector2 a_uv) const =0
 
Sample direction from surface

An implemention may just use the up vector from the result of sample(), but is encouraged to provide a more efficient limited evaluation, if reasonable.

The const version does not permit caching.

virtual SpatialVector sampleNormal (const SpatialTransform &a_transform, Vector2 a_uv)=0
 
virtual SpatialVector sampleNormal (Vector2 a_uv)=0
 
virtual SpatialVector sampleNormal (const SpatialTransform &a_transform, Vector2 a_uv) const =0
 
virtual SpatialVector sampleNormal (Vector2 a_uv) const =0
 
Build data required for searching

This may need to be called at least once before using a const version of nearestPoint or rayImpact.

The non-const versions will call it automatically.

virtual void prepareForSample (void)=0
 
virtual void prepareForSearch (void)=0
 
virtual void prepareForUVSearch (void)=0
 
Find the closest point(s) on the surface from given point

Surfaces are not required to support point searches.

Any surface is allowed to return a NULL ImpactI.

const versions do not permit caching.

virtual sp< ImpactInearestPoint (const SpatialTransform &a_transform, const SpatialVector &a_point, Real a_maxDistance)=0
 
virtual sp< ImpactInearestPoint (const SpatialTransform &a_transform, const SpatialVector &a_point, Real a_maxDistance) const =0
 
virtual sp< ImpactInearestPoint (const SpatialVector &a_point, Real a_maxDistance, BWORD a_anyHit)=0
 
virtual sp< ImpactInearestPoint (const SpatialVector &a_point, Real a_maxDistance, BWORD a_anyHit) const =0
 
virtual sp< ImpactInearestPoint (const SpatialVector &a_point, Real a_maxDistance)=0
 
virtual sp< ImpactInearestPoint (const SpatialVector &a_point, Real a_maxDistance) const =0
 
virtual sp< ImpactInearestPoint (const SpatialVector &a_point)=0
 
virtual sp< ImpactInearestPoint (const SpatialVector &a_point) const =0
 
virtual sp< ImpactInearestPoint (const Vector2 &a_uv)=0
 
virtual sp< ImpactInearestPoint (const Vector2 &a_uv) const =0
 
virtual Array< sp< SurfaceI::ImpactI > > nearestPoints (const Vector2 &a_uv, Real a_maxDistance, U32 a_hitLimit)=0
 
virtual Array< sp< SurfaceI::ImpactI > > nearestPoints (const Vector2 &a_uv, Real a_maxDistance, U32 a_hitLimit) const =0
 
virtual Array< sp< SurfaceI::ImpactI > > nearestPoints (const SpatialVector &a_origin, Real a_maxDistance, U32 a_hitLimit)=0
 
virtual Array< sp< SurfaceI::ImpactI > > nearestPoints (const SpatialVector &a_origin, Real a_maxDistance, U32 a_hitLimit) const =0
 
virtual Array< sp< SurfaceI::ImpactI > > nearestPoints (const SpatialVector &a_origin, Real a_maxDistance, U32 a_hitLimit, sp< PartitionI > a_spPartition)=0
 
virtual Array< sp< SurfaceI::ImpactI > > nearestPoints (const SpatialVector &a_origin, Real a_maxDistance, U32 a_hitLimit, sp< PartitionI > a_spPartition) const =0
 
Trace distance(s) to surface in given direction from the originating point

Surfaces are not required to support ray casting.

Any surface is allowed to return a NULL ImpactI.

const versions do not permit caching.

virtual sp< ImpactIrayImpact (const SpatialTransform &a_transform, const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, BWORD a_anyHit)=0
 
virtual sp< ImpactIrayImpact (const SpatialTransform &a_transform, const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, BWORD a_anyHit) const =0
 
virtual sp< ImpactIrayImpact (const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, BWORD a_anyHit)=0
 
virtual sp< ImpactIrayImpact (const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, BWORD a_anyHit) const =0
 
virtual sp< ImpactIrayImpact (const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance)=0
 
virtual sp< ImpactIrayImpact (const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance) const =0
 
virtual Array< sp< SurfaceI::ImpactI > > rayImpacts (const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, U32 a_hitLimit)=0
 
virtual Array< sp< SurfaceI::ImpactI > > rayImpacts (const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, U32 a_hitLimit) const =0
 
virtual sp< ImpactIconeImpact (const SpatialTransform &a_transform, const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, Real a_coneAngle, sp< DrawI > a_spDrawI)=0
 
virtual sp< ImpactIconeImpact (const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, Real a_coneAngle, sp< DrawI > a_spDrawI)=0
 
virtual sp< ImpactIcapsuleImpact (const SpatialTransform &a_transform, const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, Real a_radius, BWORD a_anyHit, sp< DrawI > a_spDrawI, sp< ImpactI > a_spLastImpact)=0
 
virtual sp< ImpactIcapsuleImpact (const SpatialVector &a_origin, const SpatialVector &a_direction, Real a_maxDistance, Real a_radius, BWORD a_anyHit, sp< DrawI > a_spDrawI, sp< ImpactI > a_spLastImpact)=0
 
- Public Member Functions inherited from fe::Component
const Stringname (void) const
 Return the components chosen name. More...
 
const String verboseName (void) const
 Return the annotated chosen name. More...
 
void setName (const String &name)
 Rename the component to anything you want. More...
 
hp< Registryregistry (void) const
 Get the Registry that created this component. More...
 
void adjoin (sp< Component > spComponent)
 Tie this component's lifetime to another. More...
 
sp< Componentcreate (const String &implementation, BWORD quiet=FALSE) const
 Convienience function to registry()->create() More...
 
void disjoin (void)
 Untie component from Hub, if connected. More...
 
String factoryName (void)
 
void setLibrary (sp< Library > spLibrary)
 Store a reference to the library used to instantiate this component. More...
 
sp< Librarylibrary (void)
 Get the library that created the component. More...
 
void setFactoryIndex (I32 a_factoryIndex)
 Set the library's factory index. More...
 
I32 factoryIndex (void)
 Get the library's factory index. More...
 
void setSingleton (BWORD set)
 Specify whether component is a singleton. More...
 
BWORD isSingleton (void)
 Return whether component is a singleton. More...
 
virtual void acquire (void)
 Specialized reference increment. More...
 
virtual void release (void)
 Specialized reference decrement. More...
 
- Public Member Functions inherited from fe::Handled< Component >
const hp< Component > & getHandle (void) const
 Get a safe handle to this object. More...
 
- Public Member Functions inherited from fe::Protectable
virtual I32 protection (void) const
 
virtual void protect (void)
 
virtual void unprotect (void)
 
virtual Protectableclone (Protectable *pInstance=NULL)
 
- Public Member Functions inherited from fe::Counted
virtual void acquire (int &rCount)
 Increment the reference count (and get the count) More...
 
virtual void abandon (void)
 Decrement the reference count. More...
 
int count (void) const
 Return the count of references. More...
 
void setName (const String &)
 
void trackReference (void *pReference, String what)
 
void untrackReference (void *pReference)
 
void registerRegion (void *pT, U32 bytes)
 
- Public Member Functions inherited from fe::Initialized
void initializeAll (void)
 
void setActive (bool a_active)
 

Additional Inherited Members

- Static Public Member Functions inherited from fe::Counted
static String reportTracker (void)
 
static U32 trackerCount (void)
 
- Protected Types inherited from fe::Initialized
typedef void(* InitializeFunction) (Initialized *)
 
- Protected Member Functions inherited from fe::Handled< Component >
void abandonHandle (void)
 
- Protected Member Functions inherited from fe::Counted
int releaseInternal (void)
 Decrement the reference count. More...
 
void suppressReport (void)
 
- Protected Member Functions inherited from fe::Initialized
void addInitializer (InitializeFunction function)
 

Detailed Description

Spatial boundary.

Member Function Documentation

◆ bind()

virtual void fe::ext::SurfaceI::bind ( Instance  a_instance)
pure virtual

associate with model data

Implemented in fe::ext::SurfaceBase, and fe::ext::SurfaceVDB.

◆ diffuse()

virtual Color fe::ext::SurfaceI::diffuse ( void  ) const
pure virtual

Return the diffuse color.

Implemented in fe::ext::SurfaceBase, and fe::ext::SurfaceSphere.

◆ setAccuracy()

virtual void fe::ext::SurfaceI::setAccuracy ( Accuracy  a_accuracy)
pure virtual

Set what primitive to search down to.

Using sphere accuracy will only resolve to the lowest bounding sphere.

Implemented in fe::ext::SurfaceSearchable, and fe::ext::SurfaceBase.

◆ setRefinement()

virtual void fe::ext::SurfaceI::setRefinement ( U32  a_refinement)
pure virtual

Set limitation of surface improvement, such as subdivision.

Refinement may be fixed or adaptive and is not necessarily uniformly applied.

Some surfaces may ignore this setting.

Implemented in fe::ext::SurfaceSearchable, and fe::ext::SurfaceBase.

◆ setSearch()

virtual void fe::ext::SurfaceI::setSearch ( String  a_searchName)
pure virtual

Set component to use for searching.

This is presumed to be an implementation of SpatialTreeI. Leave blank for default.

Implemented in fe::ext::SurfaceSearchable, and fe::ext::SurfaceBase.

◆ setSearchable()

virtual void fe::ext::SurfaceI::setSearchable ( BWORD  a_searchable)
pure virtual

Set whether this surface may be searched.

Turning this off may allow some implementations to make optimization.

An implemention is permitted to remain searchable regardless.

Implemented in fe::ext::SurfaceSearchable, and fe::ext::SurfaceBase.

◆ setTriangulation()

virtual void fe::ext::SurfaceI::setTriangulation ( Triangulation  a_triangulation)
pure virtual

Set how 4+ vertex polygons break down.

Using balanced triangulation may add new points that did not already exist on the mesh.

Some implementations may drop 5+ vertex polygons.

Implemented in fe::ext::SurfaceBase, and fe::ext::SurfaceTriangles.

◆ triangleCount()

virtual I32 fe::ext::SurfaceI::triangleCount ( void  )
pure virtual

Number of barycentric elements.

Use this for barycentric sampling. For surfaces converted into triangles, this is the number of triangle. For curves, this is really the curve count. If unknown, an implementation may return -1.

Implemented in fe::ext::SurfaceSearchable, and fe::ext::SurfaceBase.


The documentation for this class was generated from the following file: