SYSTEM EXTENSIONS - CLASS HIERARCHY
Predefined MT Features
WithTileErrorClass
Abstract class.
Meaning
It contains the additional functions that an MT having approximation errors
associated with its tiles must provide.
Functions
- float TileError(MT_INDEX t): return the approximation error
of tile t.
- float MaxTileError(void), float MinTileError(void): return
the maximum and the minimum error among all tiles of the MT.
WithFieldClass
Abstract class.
Meaning
It contains the additional functions that an MT with scalar field values
associated with its vertices must provide.
Functions
- float VertexField(MT_INDEX v): return the field value
at vertex v.
- float MaxVertexField(void), float MinVertexField(void):
return the maximum and the minimum field value among all vertices
of the MT.
WithVertexNormalClass
Abstract class.
Meaning
It contains the additional functions that an MT with normal vectors associated with
its vertices must provide.
The MT must have two-dimensional tiles (triangles) and must be embedded in a
three-dimensional space.
Functions
- void VertexNormal(MT_INDEX v, float *x, float *y, float *z):
return the three components of the normal vector to the
surface at vertex v.
- float VertexNX(MT_INDEX v), float VertexNY(MT_INDEX v),
float VertexNZ(MT_INDEX v): return one component each
of the normal vector to the surface at vertex v.
WithTileErrorTableClass
Subclass of WithTileErrorClass.
Meaning
Class implementing tile errors by storing them in a float
attribute table.
It contains internally a pointer to an object of class
MT_FloatTableClass.
Constructor
The constructor has no parameters. The resulting tile error table is empty.
Functions
- int ReadTileErrors(FILE * fd),
void WriteTileErrors(FILE * fd, int file_encoding = MT_ASCII_ENCODING):
read and write tile errors from / to a file.
- void SetTileErrorDescription(char * s),
void TheTileErrorDescription(char * s):
set and return the textual description used in the tile error file;
string s is at most MT_DESCR_LEN characters long.
WithVertexNormalTableClass
Subclass of WithVertexNormalClass.
Meaning
Class implementing vertex normals by storing them in a float
vector attribute table.
It contains internally a pointer to an object of class
MT_FloatVectorTableClass;
the length of the attribute vectors is 3 elements.
Constructor
The constructor has no parameters. The resulting vertex normal table
is empty.
Functions
- int ReadVertexNormals(FILE * fd),
void WriteVertexNormals(FILE * fd, int file_encoding):
read and write vertex normals from / to a file.
- void SetVertexNormalDescription(char * s),
void TheVertexNormalDescription(char * s):
set and return the textual description used in the vertex
normal file; string s is at most MT_DESCR_LEN
characters long.
Predefined Building Interfaces for MT Features
TileErrorBuildingInterfaceClass
Subclass of
MT_BuildingBaseClass.
Meaning
Building interface for tile errors of an MT.
Constructor
The constructor has no parameters.
Functions
- void MakeTileError(MT_INDEX t, float err): record the error
of a tile during the refinement / coarsening of a tesselation;
t is the MT_INDEX field of the tile.
- void StartTileErrorHistory(void), void EndTileErrorHistory(void):
start and end recording tile errors.
- int ConvertTileErrors(void): convert the tile errors just
recorded into an attribute table; return 1 on success, 0 on failure.
- void SetTargetTileErrorTable(WithTileErrorTable m):
set the internal float attribute table of m as the float
attribute table to be built.
- void SetTileErrorDescription(char * s),
void TheTileErrorDescription(char * s): set and
return the textual description to be used in the file
that will contain the tile error table; string s is at most
MT_DESCR_LEN characters long.
VertexNormalBuildingInterfaceClass
Subclass of
MT_BuildingBaseClass.
Meaning
Building interface for vertex normals of an MT.
Constructor
The constructor has no parameters.
Functions
- void StartVertexNormalHistory(void),
void EndVertexNormalHistory(void):
start and end recording vertex normals.
- int ConvertVertexNormals(void):
build a vertex normal table from the recorded vertex normals.
- void SetTargetVertexNormalTable(WithVertexNormalTable m):
set the internal float vector attribute table of m as
the vertex normal table to be built.
- void SetVertexNormalDescription(char * s),
void TheVertexNormalDescription(char * s): set and
return the textual description to be used in the file
that will contain the vertex normal table; string s is at most
MT_DESCR_LEN characters long.
Predefined MTs With Features
FieldWithErrorClass
Subclass of
MT_MultiTesselationClass,
WithTileErrorTableClass,
WithFieldClass.
Meaning
An MT representing a scalar field with approximation errors associated
with its tiles.
Tile errors are stored into an attribute table.
Field values at the vertices are not stored, but computed by exploiting
the property explained below.
The MT is given embedded in the space containing the graph of the field:
tiles are in (k+1)-dimensions, where the first k
coordinates are the domain and the last one is the field value.
This has several advantages. For instance, it
allows seeing a bivariate field either as a 2D tesselation with field
values or as a surface in 3D.
It implements function VertexField by returning the last
coordinate.
Constructor
Parameters: the dimension of the embedding space and the dimension of tiles
(same as class MT_MultiTesselationClass).
FieldWithErrorBuildingInterfaceClass
Subclass of
MT_BuildingInterfaceClass and
TileErrorBuildingInterfaceClass.
Meaning
Building interface for an MT with errors associated with its tiles.
Constructor
The constructor has no parameters.
SurfaceWithErrorClass
Subclass of
MT_MultiTesselationClass,
WithTileErrorTableClass,
WithVertexNormalTableClass.
Meaning
An MT representing a surface with tile errors and vertex normals.
Both tile errors and vertex normals are stored into attribute tables.
The MT must be embedded in 3D space.
Constructor
The constructor has no parameters: the dimension of tiles is
constrained to be = 2 and the embedding space is constrained
to be 3-dimensional.
SurfaceWithErrorBuildingInterface
Meaning
Building interface for an MT with tile errors associated with its tiles
and normals associated with its vertices.
Subclass of
MT_BuildingInterfaceClass, of
TileErrorBuildingInterfaceClass,
and of
VertexNormalBuildingInterfaceClass.
Constructor
The constructor has no parameters.
Predefined Resolution Filters
ThresholdClass
Abstract class.
Meaning
A class of objects that, given a tile t in an MT, computes a
float value on t.
Functions
- float ThresholdValue(MT_MultiTesselation m, MT_INDEX t):
return the threshold value for a tile.
- int IsGood(MT_MultiTesselation m):
return 1 if this threshold can be applied to MT m,
0 otherwise
(some thresholds may require MTs with tiles of a certain
dimension, or embedded in a space of a certain dimension).
UnifThresholdClass
Subclass of ThresholdClass.
Meaning
A threshold returning the same value on all tiles.
Constructor
Parameter: one float which is the threshold value.
Functions
- float SetThreshold(float v): set a new threshold value.
- float TheValue(void): return the current threshold value.
DepLawClass
Meaning
A class of objects describing the dependency of a float, that we
call value from a float, that we call argument.
The dependency law is described by the following parameters:
- value0: value returned when argument = 0
- arg1: a reference argument
- value1: value returned when argument = arg1
- dep_type: type of dependency, describing the shape of the
curve in the argument-value plane that interpolates
the two points (0,value0), (arg1,value1).
The type of dependency may be linear, quadratic, square root, exponential
(macros MT_LINEAR_DEP, MT_QUADR_DEP, MT_SQRT_DEP, MT_EXPON_DEP,
respectively).
The law is used within a threshold to describe the dependency of
the threshold value from some tile feature.
Constructor
Parameters: the four law parameters listed above.
Functions
- float MT_ComputeValue(float arg):
return the value for an argument; the argument must not be negative.
- void MT_SetLaw(float v0, float a1, float v1, int dep),
void MT_TheLaw(float * v0, float * a1, float * v1, int * dep):
set and return the parameters of this law.
PDist2ThresholdOnTrianglesClass
Subclass of ThresholdClass.
Meaning
Threshold that computes its value by applying a dependency law
on the (squared) distance of a tile from a point.
The distance is computed in two dimensions,
and applies to MTs where tiles are triangles.
If the MT is embedded in more than 2D, only the first two coordinates
of each vertex are considered for computing the distance.
Constructor
Parameters: the coordinates (x,y) of a point, and a dependency law.
PDist3ThresholdOnTrianglesClass
Subclass of ThresholdClass.
Meaning
Threshold that computes its value by applying a dependency law
on the (squared) distance of a tile from a point.
The distance is computed in three dimensions,
and applies to MTs where tiles are triangles.
If the MT is embedded in more than 3D, only the first three coordinates
of each vertex are considered for computing the distance.
Constructor
Parameters: the coordinates (x,y,z) of a point, and a dependency
law.
PDist3ThresholdOnTetrahedraClass
Subclass of ThresholdClass.
Meaning
Threshold that computes its value by applying a dependency law
on the (squared) distance of a tile from a point.
The distance is computed in three dimensions,
and applies to MTs where tiles are tetrahedra.
If the MT is embedded in more than 3D, only the first three coordinates
of each vertex are considered for computing the distance.
Constructor
Parameters: the coordinates (x,y,z) of a point, and a dependency
law.
TileErrFilterClass
Subclass of MT_CondClass.
Meaning
A resolution filter applying a given threshold to tile errors of an MT.
A tile t is considered as feasible if its error is
below the threshold value for t.
This resolution condition can only be applied to MTs that are subclasses
of MT_WithTileErrorClass and implement the function
MT_TileError.
Constructor
Parameters: an object of class WithTileErrorClass (the MT on which
the filter will be applied), and a threshold.
We can create conditions that apply different thresholds to the tile errors.
TriangleArea2FilterClass
Subclass of MT_CondClass.
Meaning
A resolution filter applying a given threshold to tile areas.
The MT must be 2-dimensional (tiles are triangles).
The area is computed in 2D.
If the embedding space has more than two dimensions, only the first
two are considered.
Constructor
Parameters: the threshold to be used.
We can create conditions that apply different thresholds to the tile areas.
TriangleArea3FilterClass
Subclass of MT_CondClass.
Meaning
A resolution filter applying a given threshold to tile areas.
The MT must be 2-dimensional (tiles are triangles).
The area is computed in 3D.
If the embedding space has more than three dimensions, only the first
three are considered.
Constructor
Parameters: the threshold to be used.
We can create conditions that apply different thresholds to the tile areas.
Circumradius2FilterClass
Subclass of MT_CondClass.
Meaning
A resolution filter applying a given threshold to the radius
of the circumcircle of a tile.
The circumcircle is computed in 2D.
This resolution condition can only be applied to MTs with two-dimensional
tiles (i.e., triangles).
If the MT is embedded in more than two dimensions, only the first two
vertex coordinates are considered for computing the circum-circle.
Constructor
Parameters: the threshold to be used.
We can create conditions that apply different thresholds to the curcumradius.
Circumradius3FilterClass
Subclass of MT_CondClass.
Meaning
A resolution filter applying a given threshold to the radius
of the circumcircle of a tile.
The circumcircle is computed in 3D.
This resolution filter condition can only be applied to MTs with
two-dimensional tiles (i.e., triangles) in three or more dimensions.
If the MT is embedded in more than three dimensions, only the first three
vertex coordinates are considered for computing the circum-circle.
Constructor
Parameters: the threshold to be used.
We can create conditions that apply different thresholds to the curcumradius.
FreeBoxClass
Meaning
An axis-parallel box in d dimensions, for generic d,
with a certain size but not a specified location.
Constructor
Parameters:
The dimension of the embedding space and, optionally, an array containing
the box side length along the axes of the embedding space.
If no array is given, all sides have a null length (the resulting box
degenerates to a point).
Functions
- int BoxDim(void): return the dimension of the embedding
space.
- void SetBox (float * side_len): set the dimensions of the
box given an array containing the side length along each axis of
the space.
- void SetEdgeLength (int i, float w): set the side length
along the direction of the i-th coordinate axis;
parameter i must be between 0 and
int BoxDim()-1.
- void SetBox (float lx, float ly),
void SetBox (float lx, float ly, float lz): as above, for
the case of a box in two and three dimensions, respectively.
- void SetLengthX (float wx), void SetLengthY (float wy),
void SetLengthZ (float wz): set the length of the edge
along the first, second, and third axis.
void SetLengthZ (float wz) can only be called if the box
is in 3D.
- void TheBox (float ** side_len):
return a pointer to the array of edge lengths.
- void TheBox (float *lx, float *ly),
void TheBox (float *lx, float *ly, float *lz):
return the edge lengths in the 2D and in the 3D case, respectively.
BoxFilterClass
Subclass of FreeBoxClass
and of MT_CondClass.
Meaning
Resolution filter condition for which a tile is feasible
if it fits in a given axis-parallel box.
Constructor
Parameters:
The dimension of the embedding space and an array containing
the box side length along the axes of the embedding space.
Predefined Focus conditions
PointClass
Meaning
A point in d-dimensional space, for generic d.
Constructor
Parameter: the dimension of the embedding space.
The resulting point is located at the origin.
Functions
- inline int PointDim(void): return the dimension of
the embedding space.
- void SetPoint(float * coord), void ThePoint(float * coord):
set and return the point coordinates as an array of as many floats as
the dimension of the space.
- void SetPoint(float x, float y),
void ThePoint(float *x, float *y):
set and return the point coordinates in the 2D case.
- void SetPoint(float x, float y, float z),
void ThePoint(float *x, float *y, float *z):
set and return the point coordinates in the 3D case.
- void Translate (float * trans_vector): translate the point.
- void Translate (float vectorX, float vectorY),
Translate (float vectorX, float vectorY, float vectorZ):
translate the point in the 2D and 3D case, respectively.
Point2FocusOnTrianglesClass
Subclass of PointClass and of
MT_CondClass.
Meaning
Focus condition considering a tile as active if it contains a point
inside or on its boundary.
The point is in 2D. The MT must have 2-dimensional tiles (triangles).
If the dimension of the embedding space is >2, then the extra coordinates
are not considered. This is equivalent to applying the point-in-tile
test to the projections of the MT tiles on the x-y plane.
Constructor
Parameters: the coordinates (x,y) of a point.
Point3FocusOnTetrahedraClass
Subclass of PointClass and of
MT_CondClass.
Meaning
Focus condition considering a tile as active if it contains a point
inside or on its boundary.
The point is in 3D. The MT must have 3-dimensional tiles (tetrahedra).
If the dimension of the embedding space is >3, then the extra coordinates
are not considered. This is equivalent to applying the point-in-tile
test to the projections of the MT tiles on the x-y-z subspace.
Constructor
Parameters: the coordinates (x,y,z) of a point.
BoxClass
Meaning
An axis-parallel box in d-dimensional space, for generic d.
Constructor
Parameters:
- The dimension of the space,
and min and max coordinates of the box, given
as two arrays of as many floats as the dimension of the embedding space.
- Simply the dimension of the space, the resulting box has
a null size and both max and min coordinates are all zeroes.
Functions
- int BoxDim(void): return the dimension of the
embedding space.
- void SetBox (float * min_coord, float * max_coord),
void TheBox (float ** min_coord, float ** max_coord):
set and return the max and min coordinates of the box,
as arrays of as many floats as the dimension of the space.
- void SetBox (float x1, float y1, float x2, float y2),
void TheBox (float *x1, float *y1, float *x2, float *y2):
set and return the max and min coordinates of the box in the 2D case.
- void SetBox (float x1, float y1, float z1,
float x2, float y2, float z2),
void TheBox (float *x1, float *y1, float *z1,
float *x2, float *y2, float *z2):
set and return the max and min coordinates of the box in the 3D case.
- void SetEdgeLength (int i, float w):
set the length of the box side in the i-th dimension,
the min coordinate is not changed, the max coordinate is recomputed.
- void SetLengthX(float wx), void SetLengthY (float wy),
void SetLengthZ (float wz):
set the length of the box side in the x-, y-, and
z-dimension; the min coordinate is not changed,
the max coordinate is recomputed.
- void MoveTo (float * anchor_point):
move the box in such a way to place its
min coordinates at the specified anchor point.
- void MoveTo (float anchorX, float anchorY),
void MoveTo (float anchorX, float anchorY, float anchorZ):
move the box in such a way to place its
min coordinates at the specified anchor point
in the 2D and 3D case, respectively.
- void Translate (float * trans_vector):
translate the box of the given translation vector.
- void Translate (float vectorX, float vectorY),
void Translate (float vectorX, float vectorY, float vectorZ):
translate the box of the given translation vector
in the 2D and 3D case, respectively.
Box2FocusOnTrianglesClass
Subclass of BoxClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 2-dimensional tiles (triangles).
It considers a tile as active if it intersects a box
in 2 dimensions, i.e., an axis-parallel rectangle.
If the embedding space of the MT has more than 2-dimensions,
just the first two vertex coordinates are considered.
The strict and the loose evaluation are the same.
Constructor
Parameters: the min and max coordinates of the box, specified either as
two arrays of two floats each, or as four floats
(x1,y1), (x2,y2).
Box3FocusOnTrianglesClass
Subclass of BoxClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 2-dimensional tiles (triangles)
embedded in at least 3 dimensions, with errors associated with their tiles.
The MT must belong to a subclass of
MT_WithTileErrorClass
which implements function MT_TileError.
A tile is considered as active if it intersects a box
in 3 dimensions, i.e., an axis-parallel cuboid.
If the embedding space of the MT has more than 3-dimensions,
just the first three vertex coordinates are considered.
The loose evaluation takes tile errors into account.
Constructor
Parameters:
an object of class WithTileErrorClass (the MT on which
the filter will be applied),
the min and max coordinates of the box, specified either as
two arrays of three floats each, or as six floats
(x1,y1,z1), (x2,y2,z2).
Box3FocusOnTetrahedraClass
Subclass of BoxClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 3-dimensional tiles (tetrahedra).
It considers a tile as active if it intersects a box
in 3 dimensions, i.e., an axis-parallel cuboid.
If the embedding space of the MT has more than 3-dimensions,
just the first three vertex coordinates are considered.
The strict and the loose evaluation mode are the same.
Constructor
Parameters:
the min and max coordinates of the box, specified either as
two arrays of three floats each, or as six floats
(x1,y1,z1), (x2,y2,z2).
SegmentClass
Meaning
A straight-line segment embedded in d dimensions, for generic d.
Constructor
Parameter: the dimension of the embedding space.
Both endpoints of the resulting segment
are at the origin (the segment degenerates into a point).
Functions
- int SegmentDim(void):
return the dimension of the embedding space.
- void SetSegment(float * coord1, float * coord2),
void TheSegment(float * coord1, float * coord2):
return and set the segment endpoints, each specified as an
array of as many floats as the dimension of the space.
- void SetSegment(float x1, float y1, float x2, float y2),
void TheSegment(float * x1, float * y1, float * x2, float * y2):
set and return the coordinates of the two segment endpoints
in the 2D case.
- void SetSegment(float x1, float y1, float z1,
float x2, float y2, float z2),
void TheSegment(float * x1, float * y1, float * z1,
float * x2, float * y2, float * z2):
set and return the coordinates of the two segment endpoints
in the 3D case.
Segment2FocusOnTrianglesClass
Subclass of SegmentClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 2-dimensional tiles (triangles).
A triangle is active if it intersects a segment in 2D,
either in its interior or with its boundary.
If the dimension of the embedding space is >2, then the extra coordinates
are not considered. This is equivalent to applying the intersection
test to the projections of the MT tiles on the x-y plane.
Constructor
Parameters: the four coordinates (x1,y1), (x2,y2) of the segment
endpoints.
Segment3FocusOnTriFieldClass
Subclass of SegmentClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 2-dimensional tiles (triangles),
representing scalar fields.
The MT must be a subclass of
WithFieldClass and of
WithTileErrorClass, and implement
functions TileError and Field.
The focus entity is embedded in the 3D space that contains the graph of the
field.
It consists of the locus of points that are located on or above a segment
in 3D (all points (x,y,z) such that a point (x,y,s)
belongs to the segment, with s < = z).
A tile is considered as active if it intersects the above locus of points.
This condition is useful for testing the visibility between two points on a
terrain.
The loose evaluation takes tile errors into account.
Constructor
Parameters: an object of class WithFieldClass, an object of
class WithTileErrorClass (both will be the MT on which the focus
condition must be applied), the six coordinates
(x1,y1,z1), (x2,y2,z2) of the segment endpoints.
LineClass
Meaning
A polygonal line embedded in d-dimensional space, for generic d.
Constructor
Parameters: the dimension of the embedding space.
The resulting polygonal line is empty (it has no points).
Functions
- int LineDim(void): return the dimension of the embedding
space.
- int NumPoints(void): return the number of points defining
the polyline.
- void SetPoint(int i, float * coord),
void ThePoint(int i, float * coord): set and return
the coordinates of the i-th point, given as an array
of as many floats as the dimension of the embedding space.
- void SetPoint(int i, float x, float y),
void ThePoint(int i, float * x, float * y): set and return
the coordinates of the i-th point, in the 2D case.
- void SetPoint(int i, float x, float y, float z),
void ThePoint(int i, float * x, float * y, float * z): set and
return the coordinates of the i-th point, in the 3D case.
Line2FocusOnTrianglesClass
Subclass of LineClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 2-dimensional tiles (triangles).
A tile is active if it intersects a polygonal line in two dimensions,
either in its interior or in its boundary.
If the dimension of the embedding space is >2, then the extra coordinates
are not considered.
The strict and loose evaluation modes are the same.
Constructor
Parameters:
the number of points on the line (= number of segment, plus one), two arrays
containing their x and y coordinates, respectively.
PointDistClass
Subclass of PointClass.
Meaning
A class that computes the (squared) distance of a tile from a point.
Functions
- float
SquaredDistanceTriangle2(MT_MultiTesselation m, MT_INDEX t):
return the exact squared distance for triangles when the reference
point is in 2D.
- float
ApproxSquaredDistanceTriangle3(MT_MultiTesselation m, MT_INDEX t):
return the approximated squared distance for triangles when the
reference point is in 3D.
- float
ApproxSquaredDistanceTetra3(MT_MultiTesselation m, MT_INDEX t):
return the approximated squared distance for tetrahedra when the
reference point is in 3D.
More functions will be added as soon as they are developed.
Approximated functions output the minimum among the
distances from the vertices and from the center of the tile (while the
true minimum distance may occur inside the tile, and be smaller).
RangeClass
Subclass of PointDistClass.
Meaning
The locus of points in d dimensions whose distance from a reference
point, called center, is smaller than a given value, called radius.
Constructor
Parameters: the number of dimensions of the space, and the radius.
The resulting range is centered at the origin.
Functions
- float SetRadius(float r), float TheRadius(void):
set and return the radius of the range.
Range2FocusOnTrianglesClass
Subclass of RangeClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 2-dimensional tiles (triangles).
A tile is active if it intersects a 2D range, i.e., a circle in
the x-y plane.
If the embedding space has more than two dimensions, only the first
two vertex coordinates are considered.
Constructor
Parameters: the two coordinates (x,y) of the center, and the radius.
Functions
Range3FocusOnTrianglesClass
Subclass of RangeClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 2-dimensional tiles (triangles)
embedded in at least 3 dimensions, with approximation errors
associated with their tiles.
The MT must belong to a subclasse of WithTileErrorClass
which implements function TileError.
A tile is active if it intersects a 3D range, i.e., a sphere in
3D space.
If the embedding space has more than three dimensions, only the first
three vertex coordinates are considered.
The loose evaluation mode takes approximation errors into account.
Constructor
Parameters: a pointer to an object of class WithTileErrorClass,
the center (x,y,z) and the radius r of the sphere.
Range3FocusOnTetrahedraClass
Subclass of RangeClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 3-dimensional tiles (tetrahedra).
A tile is active if it intersects a 3D range, i.e., a sphere in
3D space.
If the embedding space has more than three dimensions, only the first
three vertex coordinates are considered.
The strict and loose evaluation mode are the same.
Constructor
Parameters: the center (x,y,z) and the radius
r of the sphere.
WedgeClass
Meaning
A wedge in d dimensions, for generic d. Examples are an
angular sector in 2D, an unbounded pyramid with four sides in 3D.
This is useful in visualization to represent the view frustum: the extracted
tesselation will be restricted to lie inside the view frustum.
Constructor
Parameters: the dimension of the embedding space.
The vertex of the resulting wedge is the origin,
the reference point lies at distance 1 from the
origin in the direction of the last coordinate axis of the space.
The reference directions for the opening angles are undefined.
All opening angles are zero (the wedge is a half-line).
Functions
- int WedgeDim(void): return the number of coordinates of
the embedding space.
- void TheVertex(float * coord),
void SetVertex(float * coord):
return and set the vertex of the wedge. Parameter coord
is an array of as many float as the dimension of the embedding space.
- void TheVertex(float * x, float * y),
void SetVertex(float x, float y):
return and set the vertex of the wedge, in the 2D case.
- void TranslateVertex(float * incr):
translate the vertex of the wedge of a translation vector,
given as an array of as many floats as the dimension of the space.
- void TranslateVertex(float dx, float dy):
translate the vertex of the wedge of a translation vector,
in the 2D case.
- void TheAxisPoint(float * coord, float dist = 1.0):
return a point lying on the medial axis of the wedge,
the point lies at distance dist from the vertex of the wedge.
- void SetAxisDir(float * dir),
void TheAxisDir(float * dir): set / return
the medial axis of the
wedge by means of the directional coefficients,
given as an array of as many floats as the dimension of the space.
- void SetAxisPoint(float * coord):
set the medial axis of the wedge by
means of a point, the medial axis is defined as the half-line joining
the vertex of the wedge to such point;
the point is given as an array of as many floats as the dimension of
the space.
- void TheAxisPoint(float * x, float * y, float dist = 1.0),
void SetAxisPoint(float x, float y),
void TheAxisDir(float * dx, float * dy)
void SetAxisDir(float dx, float dy):
shortcuts for wedges in 2D.
- inline float TheAngle(int i), void SetAngle(int i, float a):
return and set the i-th opening angle,
the angle must be between 0 and PI/2.
- void TheLeftPoint(float * x, float * y, float dist = 1.0),
void TheRightPoint(float * x, float * y, float dist = 1.0):
for wedges in 2D, return a point lying on the left and on the right
side of the wedge at distance dist from the vertex.
Wedge2FocusOnTrianglesClass
Subclass of WedgeClass and of
MT_CondClass.
Meaning
Focus condition for MTs with 2-dimensional tiles (triangles).
A tile is active if it intersects a 2-dimensional wedge, i.e.,
an angular sector in 2D.
If the dimension of the embedding space is >2, then the extra coordinates
are not considered.
The strict and loose evaluation modes are the same.
Constructor
Parameters: the coordinates (xv,yv) of the vertex,
the coordinates (xr,yr) of a reference point, and the opening angle.
The medial axis of resulting wegde is the line joining
(xv,yv) to (xr,yr).
FieldValClass
Meaning
A set of field values.
Constructor
Parameters:
- One float, the resulting set contains just one field value.
- A counter and an array containing as many floats as the counter.
- A counter, an initial value and an increment,
the resulting set has as many values as the counter, starting from
the initial value and equally spaced according to the increment.
Functions
- int FieldValNum(void): return the number of values in the set.
- void SetFieldVal(int num, float * val):
fill the set with num values
contained in the given array.
- void SetFieldVal(int num, float val0, float step):
fill the set with num values,
where the first one is val0,
and the i-th one is val0 + (i*step).
- void SetFieldVal(int i, float val),
float TheFieldVal(int i): set and return the i-th
value in the set.
FieldValFocusClass
Subclass of FieldValClass and of
MT_CondClass.
Meaning
Focus condition for MTs representing scalar fields, with approximation
errors associated with their tiles.
The MT must belong to a subclass of
WithFieldClass and
WithTileErrorClass, which implements
functions TileError and VertexField.
A tile is active if it contains at least one of a set of field
values.
The field values of the vertices are interpolated linearly within
the tile.
The loose evaluation mode takes approximation errors of tiles into
account.
Constructor
Parameters:
a pointer to an object of class WithFieldClass,
and one to an object of class WithTileErrorClass
(both will be the MT on which the condition must be evaluated),
plus the same parameters accepted by the
constructors of class FieldValClass.
Utility Functions
The following utility function is defined at top-level and
it is useful in conjuction with the use of a FieldValFocusClass
on WithFieldClass with two-dimensional tiles.
- int HeightSegment (MT_MultiTesselation m, WithFieldClass * mf,
MT_INDEX t, float val,
float *x1, float *y1, float * x2, float *y2):
compute the segment (x1,y1)-(x2,y2)
intersection of triangle t with plane at field value equal to
val;
return 1 if the intersection is a segment (the intersection
exists and does not degenerate into a point), 0 otherwise.
Parameters m and mf point to the same object, seen under
its two relevant superclasses.