Assimp  v4.1. (December 2018)
Assimp::ImproveCacheLocalityProcess Class Reference

The ImproveCacheLocalityProcess reorders all faces for improved vertex cache locality. More...

Inherits Assimp::BaseProcess.

Public Member Functions

void Execute (aiScene *pScene)
 Executes the post processing step on the given imported data. More...
 
 ImproveCacheLocalityProcess ()
 
bool IsActive (unsigned int pFlags) const
 Returns whether the processing step is present in the given flag. More...
 
void SetupProperties (const Importer *pImp)
 Called prior to ExecuteOnScene(). More...
 
 ~ImproveCacheLocalityProcess ()
 
- Public Member Functions inherited from Assimp::BaseProcess
 BaseProcess () AI_NO_EXCEPT
 Constructor to be privately used by Importer. More...
 
void ExecuteOnScene (Importer *pImp)
 Executes the post processing step on the given imported data. More...
 
SharedPostProcessInfoGetSharedData ()
 Get the shared data that is assigned to the step. More...
 
virtual bool RequireVerboseFormat () const
 Check whether this step expects its input vertex data to be in verbose format. More...
 
void SetSharedData (SharedPostProcessInfo *sh)
 Assign a new SharedPostProcessInfo to the step. More...
 
virtual ~BaseProcess ()
 Destructor, private as well. More...
 

Protected Member Functions

ai_real ProcessMesh (aiMesh *pMesh, unsigned int meshNum)
 Executes the postprocessing step on the given mesh. More...
 

Additional Inherited Members

- Protected Attributes inherited from Assimp::BaseProcess
ProgressHandlerprogress
 Currently active progress handler. More...
 
SharedPostProcessInfoshared
 See the doc of #SharedPostProcessInfo for more details. More...
 

Detailed Description

The ImproveCacheLocalityProcess reorders all faces for improved vertex cache locality.

It tries to arrange all faces to fans and to render faces which share vertices directly one after the other.

Note
This step expects triagulated input data.

Constructor & Destructor Documentation

◆ ImproveCacheLocalityProcess()

ImproveCacheLocalityProcess::ImproveCacheLocalityProcess ( )

◆ ~ImproveCacheLocalityProcess()

ImproveCacheLocalityProcess::~ImproveCacheLocalityProcess ( )

Member Function Documentation

◆ Execute()

void ImproveCacheLocalityProcess::Execute ( aiScene pScene)
virtual

Executes the post processing step on the given imported data.

A process should throw an ImportErrorException* if it fails. This method must be implemented by deriving classes.

Parameters
pSceneThe imported data to work at.

Implements Assimp::BaseProcess.

◆ IsActive()

bool ImproveCacheLocalityProcess::IsActive ( unsigned int  pFlags) const
virtual

Returns whether the processing step is present in the given flag.

Parameters
pFlagsThe processing flags the importer was called with. A bitwise combination of aiPostProcessSteps.
Returns
true if the process is present in this flag fields, false if not.

Implements Assimp::BaseProcess.

◆ ProcessMesh()

ai_real ImproveCacheLocalityProcess::ProcessMesh ( aiMesh pMesh,
unsigned int  meshNum 
)
protected

Executes the postprocessing step on the given mesh.

Parameters
pMeshThe mesh to process.
meshNumIndex of the mesh to process

PSEUDOCODE for the algorithm

A = Build-Adjacency(I) Vertex-triangle adjacency L = Get-Triangle-Counts(A) Per-vertex live triangle counts C = Zero(Vertex-Count(I)) Per-vertex caching time stamps D = Empty-Stack() Dead-end vertex stack E = False(Triangle-Count(I)) Per triangle emitted flag O = Empty-Index-Buffer() Empty output buffer f = 0 Arbitrary starting vertex s = k+1, i = 1 Time stamp and cursor while f >= 0 For all valid fanning vertices N = Empty-Set() 1-ring of next candidates for each Triangle t in Neighbors(A, f) if !Emitted(E,t) for each Vertex v in t Append(O,v) Output vertex Push(D,v) Add to dead-end stack Insert(N,v) Register as candidate L[v] = L[v]-1 Decrease live triangle count if s-C[v] > k If not in cache C[v] = s Set time stamp s = s+1 Increment time stamp E[t] = true Flag triangle as emitted Select next fanning vertex f = Get-Next-Vertex(I,i,k,N,C,s,L,D) return O

◆ SetupProperties()

void ImproveCacheLocalityProcess::SetupProperties ( const Importer pImp)
virtual

Called prior to ExecuteOnScene().

The function is a request to the process to update its configuration basing on the Importer's configuration property list.

Reimplemented from Assimp::BaseProcess.


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