Skip to main content

NAO


NAO Interface Class NARegion

Overview


A region is a piece of a flat space, such as the line, plane or three space. They are determined by providing (at minimum) a dimension (the member function getBaseSpaceDimension(), and a routine which test a point to determine whether it is inside the region or not (the member function isitinChart(NAPointOnManifold*). A set of three other member functions must be provided, which together provide a bounding box and some idea of the scale of the region within the box. These are The first argument to these is used for manifolds, and should be zero for regions. The second argument is the direction in which to return the size of the bounding box. E.g. x is 0, y is 1.

Regions are a simple form of the more general Manifold. They are manifolds with a single chart, and the mapping for the only chart is the identity. Except for the member functions above, the NARegion class implements all of the member functions of the manifold. A region may be discrete (it is always differential, and the implementor of subclasses should feel free to override the member functions of the NAManifold base class which are associated with meshes. The other member function may be changed, but it is not recommended. If they need to be changed, it would be better to derive from the slightly more general NAMappedRegion, or the completely general NAManifold.

For a complete introduction to the NARegion, please refer to the Primer on NARegions.


User's Guide


To use this class, include the header file
NAO/NARegion.h
and link against library
libNAOBase.a
The following member functions are available when classes are derived from this interface class, in addition to those provided by the parent class NAManifold.

Pure Virtual Member Functions, which must be provided by derived classes:

Virtual Member Functions, which may or may not be provided by derived classes:
non Virtual Member Functions, which are provided by this base class and may not be replaced by a derived class:
The following classes are children of this base class:

Programmer's Guide


The NARegion provides most of the required member functions of the NAManifold interface. It is intended as a convenience, supplying default values for the more "manifold-ish" things that simple geometrical regions simply do not have. With the exception of the interface for Discrete Regions, the only member functions that a Region must implement are the dimension (getBaseSpaceDimension), and the test for a point being in the region (isitinChart).

For a region the base and target spaces are identical, and the chart mapping (getPoint) is the identity mapping. There is only one chart, so getNumberOfChartsInAtlas always returns 1. The routines dealing with the list of overlapping charts do nothing.

A region may or may not have a Boundary. The region inherits the simple boundary list that the NAManifold provides.

Regions have a differential structure, which is just that of the Euclidean Base (and Target) space.


Example


It is not easy to give an example of an NARegion. All of it's interface is contained in that of the NAManifold. Here, however is a very simple use of a region, creating a point and testing for inclusion:

#include <NAO/NARegion.h>
#include <NAO/NADblPt.h>
#include <NAO/UTPrMtMf.h>

int i,n;
NARegion *Omega;


n=Omega->getBaseSpaceDimension();
NAPointOnManifold *x=new NADoublePointOnManifold(n);

for(i=0;i<n;i++)
 {
  x->setCoordinate(i,sin(NAPI*i/n));
 }

if(Omega->isitinChart(x))
 {
  cout << "The point ";
  NAPrint(x);
  cout << is inside Omega." << endl;
 }else{
  cout << "The point ";
  NAPrint(x);
  cout << is not inside Omega." << endl;
 }


Related Classes and Subroutines


The parent of this Interface class:

Siblings of this Interface class:

Children of this Interface class:


Created: Fri Oct 9 13:16:18 EDT 1998

[Comments | NAO home page ]

[Research home page]

[ IBM home page | Order | Privacy | ContactIBM | Legal ]