- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# DopTree Class Reference

DOP-tree collision check algorithm. More...

## Detailed Description

DOP-tree collision check algorithm.

For an extensive explanation of the algorithms, please see my dissertation at http://www.gabrielzachmann.org/ .

The construction of a DopTree uses the FaceIterator to retrieve a list of all polygons of an OSG geometry.

Author:
  Gabriel Zachmann, written May 1997, ported to OSG Jan 2001.

Compile-Time Flags:
  - `LEAFHANDLER` - if set, each DOPtree can have it's own function for handling leaves; if not set, leaves will always be handled by intersectpoly. Setting this will cost a little memory and performance, but is useful for testing.
  - `SECOND_ITERATION_FOR_DIAMETER` - does another iteration in order to find the pair of elementary DOPs furthes apart from each other.
  - `KRITERIUM` - defines the algorithm for splitting a set of elementary DOPs.
  - `DOPTREE_NUM_ORI` - number of orientations; always = class variable NumOri; needed for ifdef's in init().

Todo:
  - Creation of DOP trees is very slow!
  - Resolve all the TODO's in the code.
  - Check if SECOND_ITERATION_FOR_DIAMETER really helps.
  - Keine virtual methods (dtor)! (wg. Speicherplatz fuer vtable)
  - DOP tree in 1 grosses Array speichern!
  - Does performance increase, if all local variables are doubles?
  - Zwei verschiedene DopNode's? eine Klasse fuer innere Knoten, eine fuer Blaetter; wg. Speicher fuer pgon, der in inneren Knoten nicht gebraucht wird! Evtl. kann man das auch durch union { d; pgon } machen.
  - Instanzvariable index braucht man nicht, da das in child[1] gespeichert werden kann; Instanzvariable nvertices braucht man nicht, wenn man festlegt, dass sowieso nur 3- oder 4-ecke gespeichert werden koennen, und man pgon[3] fuer 3-ecke einfach auf MAX_UINT setzt.
  - Klasse DopTree in Klasse DopNode mergen (oder umgekehrt).
  - Verschiedene Farben bei DOP-Tree-Visualisierung.
  - Code den Naming-Konventionen anpassen! (besonders m_var und M_Var)

Implementation:
  The affine transformation for re-aligning DOPs is a separate struct, and not a bunch of instance variables of DopTree, so that the intersection test function can be made thread-safe.

Implementation:
  See also vd2/y/oripoly.c for the original version of this code. Some of that has been omitted here, because it was experimental and has not proven to improve performance.

Bug:

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

- ColDopTree.cpp