Our resolution filter and focus condition belong to a subclass
MyFilterClass and MyFocusClass, respectively, of
MT_CondClass that uses feature YYY.
Therefore, the constructors of class MyFilterClass and
MT_CondClass have an argument of class WithYYYClass.
See also the guidelines for the definition
of feature-based conditions.
With respect to the template already given for extraction of tesselation from a plane MT, now we simply have to create the resolution filter and the focus condition by passing the MT to the constructors of classes MyFilterClass and MyFocusClass, respectively.
#include "mt_extra.h"
#include "t_misc..h" /* for class TileErrFilterClass */
#include "f_box.h" /* for class Box3FocusOnTrianglesClass */
....
FieldWithError mt; /* the MT to be used */
MT_StaticExtractor ex /* the extractor */
TileErrFilter flt; /* the resolution filter condition */
Box3FocusOnTriangles fcs; /* the focus condition */
/* create mt as a 2-dimensional field in 3D */
mt = new FieldWithErrorClass(3,2);
/* read the MT and its tile errors */
mt->MT_Read(... a file ...);
mt->ReadTileErrors(... another file ...);
/* create the resolution filter and the focus condition */
flt = new TileErrFilterClass(mt,... some threshold ...);
fcs = new Box3FocusOnTrianglesClass(mt, ... box parameters ...);
/* create the extractor */
ex = new MT_StaticExtractorClass(mt);
/* associate the conditions with the extractor */
ex->MT_SetFilter(flt);
ex->MT_SetFocus(fcs);
/* main loop */
while (... we want to continue ...)
{
/* extract a tesselation */
ex->MT_ExtractTesselation();
/* do something with the extracted tesselation */
...
/* prepare for next extraction, if desired */
...
}