HOW TO USE AN MT WITH A CERTAIN SET OF FEATURES

An MT is used for extracting tesselations at variable resolution from it. We have already provided general guidelines for the extraction of tesselations from an MT. Now, we provide more details about the setting of extraction conditions. Typically, in an MT with features, extraction conditions refer to such features. (you can find here guidelines for the definition of feature-based conditions) .

Guidelines

We assume that our MT has feature YYY, i.e., it belongs to a subclass MyClass of WithYYYClass and of MT_MultiTesselationClass.
See also the guidelines for defining MTs with specific features.

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.

An example

In this example, the feature is the tile error. We use an MT of class FieldWithErrorClass (subclass of WithTileErrorClass), a resolution filter of class TileErrFilter and a focus condition of class Box3FocusOnTrianglesClass.
#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 */
   ...
}