Skip to main content

NAO


NAO Class NARegionBoundedByCurve

Overview


This class represents a two dimensional region that is the interior of a closed curve.


User's Guide


To use this class, you must include the header file
NAO/RgnCrv.h
and link against library
libNAOBase.a
The following constructors are provided:

The following member functions are available in addition to those provided by the abstract interface NARegion:


Programmer's Guide


The class is derived from the NARegion base class. The dimension of the region is 2, and a point (x_0,y_0) is inside the region if the winding number of the point relative to the curve is non-zero.

The winding number is defined to be:

The integral is approximated by integrals along line segments approximating the curve. Some care has to be taken when the point is near the bounding curve.


Example


The example follows a basic pattern for creating a new object. First several include files are used.
NAO/RgnCrv.h
Contains the definition of the NARegionBoundedByCurve. We can tell which file to include from the documentation for the NARegionBoundedByCurve class.
NAO/Ellipse.h
Contains the definition of the NAEllipse. We can tell which file to include from the documentation for the NAEllipse class.
NAO/UTDrMfld.h
Definition of routines for drawing manifolds.
NAO/UTGraph.h
The Utilities for graphics. (Pause, Close).

#include <NAO/RgnCrv.h>
#include <NAO/Ellipse.h>
#include <NAO/UTDrMfld.h>
#include <NAO/UTGraph.h>

int main(int argc, char *argv[])
 {
  NAManifold *e=new NAEllipse(.5,0.,1.,.3,NAPI/3.);
  NARegion *r=new NARegionBoundedByCurve(e);

  NADraw(r,"gold3");
  NAGraphicsPause();
  NAGraphicsClose();

  e->unReference();
  r->unReference();

  return(0);
 }

The first statement calls the constructor for the NABall. The second statement constructs a point in R5. The rest of the example prints the point in R5, and tests to see if it is inside the ball or not.

This is what I see when I run this:

 drawing a 2-Manifold in 2-Space! (RegionBoundedByCurve)
Drawing boundary 0/1
 drawing a 1-Manifold in 2-Space! (Ellipse)
shpause: Hit enter when you are ready to continue. "q" quits.
Shared memory unavailable, using fallback display method.


~NATopLevel: Just deleted the last NATopLevel Object
    total TopLevels allocated 11
          PointOnManifolds     8     smartPtr's  0
          Manifolds            3     smartPtr's  0
          FunctionSpaces       0     smartPtr's  0
          Functions            0     smartPtr's  0
          OperatorSpaces       0     smartPtr's  0
          Operators            0     smartPtr's  0
          Algorithms           0     
          Problems             0     
          Lists                0     


Related Classes and Subroutines


The parent of this class:

Siblings of this class:

Some other classes that might be of interest are:


Created: Fri Oct 9 14:49:18 EDT 1998

[Comments | NAO home page ]

[Research home page]

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