Back AAM-API documentation The AAM-Site

In file AAMShape.h:

class CAAMShape

Shape container.

Inheritance:

CAAMShape - CAAMObject


Public Methods

[more]void Abs2Rel( const CString hostImagePath )
Converts shape coordinates from absolute to relative by using the hostimage.
[more]void Abs2Rel( const int image_width, const int image_height )
Converts shape coordinates from absolute to relative.
[more]void AddInterior(const int interations)
Adds articifial interior points to the shape.
[more]void AddPath( const CAAMShape &shape, const CAAMPointInfo &pointType )
Adds a path to the shape.
[more]void AddShapeExtends( int nPixels )
Adds an extra border on each outer path.
[more]double AlignTo( const CAAMShape &ref, double* pTheta )
Aligns this to 'ref' with respect to pose.
[more]void AlignTransformation( const CAAMShape &ref, double &scale, double &theta, CAAMPoint &t ) const
Returns the transformation that aligns this to 'ref' with respect to pose.
[more]void AllocateUserFields()
Allocates room for the three user defined fields.
[more]double Area( bool use_covex_hull ) const
Returns the total area of the shape (with holes excluded).
[more] CAAMShape(int nbPoints)
Constructs a shape with 'nbPoints' points.
[more] CAAMShape( const CDVector &v )
Constructs a shape from a vector. Assumes closed path connectivity.
[more] CAAMShape( const CAAMShape &s )
Copy contructor.
[more]void COG( double &x, double &y ) const
Calculates the center of gravity of the shape.
[more]CAAMPoint COG() const
Calculates the center of gravity of the shape.
[more]CAAMShape CalcConvexHull() const
Calculates the convex hull of each path in the shape.
[more]bool ConsistencyCheck()
Tests if any interior points has gone outside outer path of the shape.
[more]void CopyData( const CAAMShape &s )
Copies all data from a shape to this.
[more]void Displace( const CDVector &poseVec )
Displaces the shape around it's center of gravity.
[more]void Expand( int nPixels )
Expands the shape (contraction can be done by using a negative nPixels).
[more]CAAMShape ExtractPath( const int startPosition ) const
Extracts one path from a shape.
[more]void FromFile( FILE* fh )
Reads a shape from a file.
[more]void GetHostImage( CDMultiBand<TAAMPixel> &dest, const CString &path, const int rfactor ) const
Retrives the image connected to the shape.
[more]std::vector<int> GetPaths() const
Extracts the starting positions of each path in the shape.
[more]int GetPoint( int i, double &x, double &y) const
Returns the i'th point.
[more]CAAMPoint GetPoint( int i ) const
Returns the i'th point.
[more]double GetRotation( const CAAMShape &ref ) const
Returns the rotation between ref and this (in radians).
[more]double Height() const
Shape height
[more]inline const CString& HostImage() const
Host image (if any)
[more]bool IsAbs() const
Returns true if the shape is in absolute coordinates
[more]bool IsConvex() const
Tests if the shap is convex w.r.t. each path.
[more]bool IsInside( const CAAMPoint &p, bool bBoundTest ) const
Tests if the point 'p' belongs to the shape.
[more]bool IsInsidePath( const CAAMPoint &p, const int path_start ) const
Tests if the point 'p' is inside the path starting at position 'path_start'. Rarely used.
[more]void MakeBorderShape( int size )
Converts a one path shape into a border shape.
[more]double MaxX() const
Find the maximum x component of the shape.
[more]double MaxY() const
Find the maximum y component of the shape.
[more]double MinX() const
Find the maximum x component of the shape.
[more]double MinY() const
Find the minimum y component of the shape.
[more]inline const int NPoints() const
The number of shape points
[more]void Normal( const int i, CAAMPoint& p1, CAAMPoint& p2, const double dist ) const
Finds the normal to the i'th point on the shape.
[more]void NormalDisplacement( const int i, const double dist )
Displaces the i-th point along the normal.
[more]double Normalize()
Normalize to unit scale and translates COG to origo.
[more]void Param2PoseVec( const double scale, const double theta, const double tx, const double ty, CDVector &poseVec )
Converts pose parameters: scale, theta, tx, ty to a pose vector.
[more]int PathLen( const int startPosition ) const
Returns the length of a path.
[more]const std::vector<CAAMPointInfo> & PointAux() const
Returns the complete point aux vector of the shape
[more]std::vector<CAAMPointInfo> & PointAux()
Returns the complete point aux vector of the shape
[more]void PoseVec2Param( const CDVector &poseVec, double &scale, double &theta, double &tx, double &ty )
Converts a pose vector to pose parameters: scale, theta, tx, ty.
[more]bool ReadASF( const CString &filename )
Reads an ver. 0.90 .asf into relative coordinates.
[more]bool ReadASF0_90( const CString &filename )
Reads an ver. 0.90 .asf into relative coordinates.
[more]void Rel2Abs( const int image_width, const int image_height )
Converts shape coordinates from relative to absolute.
[more]void Rel2Abs( const CString hostImagePath )
Converts shape coordinates from relative to absolute by using the hostimage.
[more]void RemovePoint( const int i )
Removes the i-th point from the shape.
[more]void Resize(int length, double* storage)
Change number of shape points in the shape.
[more]void ReversePointOrder()
Reverses the point point ordering.
[more]void Rotate( const double theta, const bool aroundCOG )
Rotates the shape.
[more]void Scale( const double s, const bool aroundCOG )
Scales the shape.
[more]void SetClosedPathConnectivity()
Sets all point to be connected in one closed path.
[more]void SetHostImage( const CString &hostImageFilename )
Returns the host image (if any).
[more]int SetPoint( int i, const double &x, const double &y)
[more]int SetPoint( const int i, const CAAMPoint &p )
[more]void SetPointInfoFlagsInPath( const int startPosition, const int flags )
Sets all flags in one path to the same value.
[more]double ShapeSize() const
Returns the 2-norm of this shape centralized.
[more]void ToFile( FILE* fh ) const
Write the shape to a binary file.
[more]void Translate( const CAAMPoint &p )
Translates the shape.
[more]void Translate( const double x, const double y )
Translates the shape.
[more]const std::vector<float> & UserField( const int field_nb ) const
Returns the value of a user defined field vector.
[more]std::vector<float> & UserField( const int field_nb )
Returns a reference to a user defined field vector.
[more]double Width() const
Shape width
[more]bool WriteASF( const CString &filename, const int image_width, const int image_height )
Writes the shape to a ASF file.
[more]bool WriteASF0_90( const CString &filename, const int image_width, const int image_height )
ASF writer version 0.90.
[more]CAAMShape operator+(const CVisDVector &v) const
Plus operator.
[more]CAAMShape operator-(const CVisDVector &v) const
Minus operator.
[more]CAAMShape& operator=(const CAAMShape &s)
Assignment operator (CAAMShape).
[more]CDVector& operator=(double value)
Assignment operator (double).
[more]CDVector& operator=(const CVisDVector &vIn)
Assignment operator (CAAMShape).
[more] ~CAAMShape()
Shape destructor.

Public Members

class CAAMPointInfo
Auxiliary point data.

Private Fields

[more]bool m_bAbsPointCoordinates
Indicates if the point coordinates is in relative or absolute format
[more]int m_iNbPoints
The number of points
[more]CString m_szASFVer
Current ASF version number
[more]CString m_szHostImage
Optional 'host image' filename including full path.
[more]std::vector<CAAMPointInfo> m_vPointAux
Auxillary point data
[more]std::vector<float> m_vUser1
User-defined field 1
[more]std::vector<float> m_vUser2
User-defined field 2
[more]std::vector<float> m_vUser3
User-defined field 3


Inherited from CAAMObject:

Public Methods

ovoid Dump( const char* szPath ) const


Documentation

This class act as a container for a shape. Essentially it's just a set of 2D points stored in a vector in the format xxxyyy.

ostd::vector<CAAMPointInfo> m_vPointAux
Auxillary point data

ostd::vector<float> m_vUser1
User-defined field 1

ostd::vector<float> m_vUser2
User-defined field 2

ostd::vector<float> m_vUser3
User-defined field 3

oCString m_szASFVer
Current ASF version number

oint m_iNbPoints
The number of points

obool m_bAbsPointCoordinates
Indicates if the point coordinates is in relative or absolute format

oCString m_szHostImage
Optional 'host image' filename including full path.

oinline const CString& HostImage() const
Host image (if any)

ovoid SetHostImage( const CString &hostImageFilename )
Returns the host image (if any).

odouble Width() const
Shape width

odouble Height() const
Shape height

oinline const int NPoints() const
The number of shape points

obool IsAbs() const
Returns true if the shape is in absolute coordinates

ostd::vector<CAAMPointInfo> & PointAux()
Returns the complete point aux vector of the shape

oconst std::vector<CAAMPointInfo> & PointAux() const
Returns the complete point aux vector of the shape

o CAAMShape(int nbPoints)

Constructs a shape with 'nbPoints' points. Defaults to absolute point coordinates and single closed path connectivity.

Parameters:
nbPoints - The number of points the shape should contain.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-8-2000
See Also:
SetClosedPathConnectivity

o CAAMShape( const CDVector &v )

Constructs a shape from a vector. Defaults to absolute point coordinates and single closed path connectivity.

Parameters:
v - The input vector.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-8-2000
See Also:
SetClosedPathConnectivity

o CAAMShape( const CAAMShape &s )

Copy contructor.

Parameters:
s - The input shape.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-8-2000

ovoid SetClosedPathConnectivity()

Manipulates the aux point info such that the shape points is interpreted as one closed outer path defined clock-wise with repect to it's normals.

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-26-2000

oCDVector& operator=(double value)

Sets all x and y compoments of a shape equal to a double. [Actually only used when calculating a mean shape -- since we want to accumulate in an empty shape].

Parameters:
value - The value to set all shape points to.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-26-2000

oCAAMShape& operator=(const CAAMShape &s)

Set one shape equal another.

Parameters:
s - The shape to copy.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-9-2000

ovoid CopyData( const CAAMShape &s )

Copies all data from a shape to this. Called from the assignment operator.

Parameters:
s - Shape to copy data from.
Returns:
Nothing,
Author:
Mikkel B. Stegmann
Version:
10-20-2000

oCDVector& operator=(const CVisDVector &vIn)

Set the shape to be equal an xxx-yyy formatted vector. NOTE: this method does not manipulate any connectivity (i.e. point aux) info. So, if the shape beforehand was empty one should call SetClosedPathConnectivity() afterwards this call to obtain sensible point aux info.

Parameters:
vIn - xxx-yyy formatted vector.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-26-2000

o ~CAAMShape()

Author:
Mikkel B. Stegmann
Version:
5-15-2000

ovoid Rotate( const double theta, const bool aroundCOG )

Rotates the shape 'theta' radians.

Parameters:
theta - Rotation angle in radians.
aroundCOG - If true the rotation is being done around the cog of the shape instead of around the global center.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
3-15-2000

ovoid Translate( const CAAMPoint &p )

Parameters:
p - The offset to translate.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-15-2000

ovoid Translate( const double x, const double y )

Parameters:
- x X-translation.
- y Y-translation.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-15-2000

odouble ShapeSize() const

Returns:
The 2-norm.
Author:
Mikkel B. Stegmann
Version:
5-15-2000

odouble MinX() const

Returns:
The x-maximum.
Author:
Mikkel B. Stegmann
Version:
5-15-2000

odouble MaxX() const

Returns:
The x-maximum.
Author:
Mikkel B. Stegmann
Version:
5-15-2000

odouble MinY() const

Returns:
The y-minimum.
Author:
Mikkel B. Stegmann
Version:
5-15-2000

odouble MaxY() const

Returns:
The y-maximum.
Author:
Mikkel B. Stegmann
Version:
5-15-2000

ovoid Scale( const double s, const bool aroundCOG )

Scales the shape.

Parameters:
s - Scale factor.
aroundCOG - If true the scale is being done around the cog of the shape instead of around the global center.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
3-15-2000

oCAAMPoint COG() const

Calculates the center of gravity of the shape (actually it's the center of the centroid).

Parameters:
p - cog output.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
3-15-2000

ovoid COG( double &x, double &y ) const

Calculates the center of gravity of the shape (actually it's the center of the centroid).

Parameters:
- x X cog output.
- y X cog output.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
3-15-2000

odouble Normalize()

Normalizes the shape by translating it's center of gravity to origo and scale by the reciprocal of the 2-norm.

Returns:
The 2-norm of the shape seen as a 2*nbPoint vector after the translation to origo.
Author:
Mikkel B. Stegmann
Version:
02-08-2000

oint SetPoint( int i, const double &x, const double &y)

Overwrites the i'th point.

Returns:
Zero.
Author:
Mikkel B. Stegmann
Version:
02-10-2000

oint SetPoint( const int i, const CAAMPoint &p )

Overwrites the i'th point. If the point doesn't exists, non-zero is returned.

Returns:
Zero on success, non-zero if the point doesn't exists.
Author:
Mikkel B. Stegmann
Version:
02-10-2000

oint GetPoint( int i, double &x, double &y) const

Returns the i'th point.

Returns:
Zero.
Author:
Mikkel B. Stegmann
Version:
02-10-2000

oCAAMPoint GetPoint( int i ) const

Returns the i'th point.

Returns:
The i'th point.
Author:
Mikkel B. Stegmann
Version:
02-10-2000

ovoid Resize(int length, double* storage)

Change number of shape points in the shape. Note: Destroys *all* current point data and point info data.

Parameters:
length -
storage -
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-26-2000
See Also:

ovoid AlignTransformation( const CAAMShape &ref, double &scale, double &theta, CAAMPoint &t ) const

Returns the transformation that aligns this to 'ref' with respect to pose.

Parameters:
ref - The reference shape.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
03-06-2000

odouble AlignTo( const CAAMShape &ref, double* pTheta )

Aligns this to 'ref' with respect to pose.

Parameters:
ref - The reference shape.
pTheta - Optional pointer to return the rotation carried out on this.
Returns:
The 2-norm of the this shape seen as a 2*nbPoint vector after the translation to origo but before the scale done to fit 'ref'.
Author:
Mikkel B. Stegmann
Version:
03-06-2000

odouble GetRotation( const CAAMShape &ref ) const

Get the rotation between two shapes by minimizing the sum of squared point distances, as described by Goodall (and Bookstein) using Singular Value Decomposition (SVD).

Note that both shapes must be normalized with respect to scale and position beforehand. This could be done by using CAAMSAhape::Normalize().

Returns:
The estimated angle, theta, between the two shapes.
Author:
Mikkel B. Stegmann
Version:
02-09-2000

ovoid FromFile( FILE* fh )

Parameters:
fh - An open file handle.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
3-15-2000

ovoid ToFile( FILE* fh ) const

Write the shape to a binary file.

Parameters:
sFilename - Destination filename.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-4-2000
See Also:
FromFile

ovoid Param2PoseVec( const double scale, const double theta, const double tx, const double ty, CDVector &poseVec )

Converts pose parameters: scale, theta, tx, ty to a pose vector. The pose vector will be in the format:

[ s, theta, tx, ty ]

where s = scale-1

Parameters:
scale - Scale input.
theta - Rotational input.
tx - X translation input.
ty - Y translation input.
poseVec - The output pose vector.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
3-15-2000
See Also:
PoseVec2Param, Displace

ovoid PoseVec2Param( const CDVector &poseVec, double &scale, double &theta, double &tx, double &ty )

Converts a pose vector to pose parameters: scale, theta, tx, ty. The pose vector are expected to be in the format:

[ s, theta, tx, ty ]

where s = scale-1

Parameters:
poseVec - The input pose vector.
scale - Scale output.
theta - Rotational output.
tx - X translation output.
ty - Y translation output.
Returns:

Author:
Mikkel B. Stegmann
Version:
3-27-2000
See Also:
Param2PoseVec, Displace

ovoid Displace( const CDVector &poseVec )

Displaces the shape around it's center of gravity using a displacement vector.

Parameters:
poseVec - The input pose vector.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
3-15-2000
See Also:
PoseToParam

obool IsInsidePath( const CAAMPoint &p, const int path_start ) const

Tests if the point 'p' is inside the path starting at position 'path_start'. Rarely used. Primary a helper function to IsInside.

Parameters:
p - The point to test for.
path_start - The point index where a path starts
Returns:
True if 'p' is inside
Author:
Mikkel B. Stegmann
Version:
5-4-2000
See Also:
IsInside

obool IsInside( const CAAMPoint &p, bool bBoundTest ) const

Tests if the point 'p' belongs to the shape. In the current version all shape points are assumes to be ordered points in a n-point polygon with no holes. For example used to clean up the meshes (removing unwanted triangles from the triangulisation).

Parameters:
- 'p' The test point.
bBoundTest - Flags wheather a bounding box test should be performed prior to the exact test.
Returns:
True if 'p' is inside.
Author:
Mikkel B. Stegmann
Version:
4-4-2000

ovoid Expand( int nPixels )

Expands the shape by moving each model point 'nPixels' perperdicular to the shape contour (that is: along the model point normal).

This function will expand each outer (closed) path of the shape.

No tests for crossing contours are being made as of now.

Parameters:
nPixels - The number of pixel to expand the shape with.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-4-2000

ovoid Normal( const int i, CAAMPoint& p1, CAAMPoint& p2, const double dist ) const

Finds the normal to the i'th point on the shape. If the point should be a single point the normal points is defined to be equal to the point it self.

Parameters:
i - Index of point.
p1 - Reference to the outside normal point.
p2 - Reference to the inside normal point.
dist - The desired distance from p[1|2] to the i-th point.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-4-2000

ovoid NormalDisplacement( const int i, const double dist )

Displaces the i-th point along the normal.

Parameters:
i - Index of point.
dist - The distance to move the point (>0 move point outwards, <0 inwards).
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
12-6-2000
See Also:
Normal

obool WriteASF( const CString &filename, const int image_width, const int image_height )

Writes the shape to a ASF file. Remember asf's are always in relative coordinates. Se format description else where.

Parameters:
filename - Output filename.
image_width - The image the coord. is relative to.
image_height - The image the coord. is relative to.
Returns:
true on success, false on errors
Author:
Mikkel B. Stegmann
Version:
4-25-2000
See Also:
ReadASF

obool WriteASF0_90( const CString &filename, const int image_width, const int image_height )

Writes the shape to a ver. 0.90 ASF file. Remember asf's are always in relative coordinates. Se format description else where.

Parameters:
filename - Output filename.
image_width - The image the coord. is relative to.
image_height - The image the coord. is relative to.
Returns:
true on success, false on errors
Author:
Mikkel B. Stegmann
Version:
7-2-2001
See Also:
ReadASF

obool ReadASF( const CString &filename )

Reads an ver. 0.90 .asf into relative coordinates. Se format description else where.

Parameters:
filename - Input filename.
Returns:
true on success, false on errors
Author:
Mikkel B. Stegmann
Version:
4-25-2000
See Also:
WriteASF

obool ReadASF0_90( const CString &filename )

Reads an ver. 0.90 .asf into relative coordinates. Se format description else where.

Parameters:
filename - Input filename.
Returns:
true on success, false on errors
Author:
Mikkel B. Stegmann
Version:
4-25-2000
See Also:
WriteASF

ovoid Abs2Rel( const CString hostImagePath )

Converts shape coordinates from absolute to relative by using the hostimage.

Author:
Mikkel B. Stegmann
Version:
11-15-2000

ovoid Rel2Abs( const CString hostImagePath )

Converts shape coordinates from relative to absolute by using the hostimage.

Author:
Mikkel B. Stegmann
Version:
11-15-2000

ovoid Abs2Rel( const int image_width, const int image_height )

Converts shape coordinates from absolute to relative. Relative coordinates are specified as:

x_relative = x_abs/image_width

y_relative = y_abs/image_height

Parameters:
image_width - The image the coord. should be relative to.
image_height - The image the coord. should be relative to.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-25-2000
See Also:
Rel2Abs

ovoid Rel2Abs( const int image_width, const int image_height )

Converts shape coordinates from relative to absolute. Relative coordinates are specified as:

x_relative = x_abs/image_width

y_relative = y_abs/image_height

Parameters:
image_width - The image the coord. is relative to.
image_height - The image the coord. is relative to.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-25-2000
See Also:
Abs2Rel

ovoid AddPath( const CAAMShape &shape, const CAAMPointInfo &pointType )

Adds a path to the shape. All added point inherits the given pointtype.

Parameters:
shape - A shape containing one path.
pointType - The pointtype of the added points.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
4-26-2000

ovoid ReversePointOrder()

Reverses the point point ordering. Used when a clock-wise outer path shall converted to a counter-clock wise hole.

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-2-2000

ostd::vector<int> GetPaths() const

Extracts the starting positions of each path in the shape by a simple linear search. The starting position is identified by a change in path id (saved in the m_vPointAux member).

Returns:
A vector of path starting positions.
Author:
Mikkel B. Stegmann
Version:
5-3-2000

oint PathLen( const int startPosition ) const

Returns the length of a path.

Parameters:
startPosition - The starting position of the path.
Returns:
The path length.
Author:
Mikkel B. Stegmann
Version:
5-5-2000
See Also:
GetPaths

oCAAMShape ExtractPath( const int startPosition ) const

Extracts one path from a shape into a new shape.

Parameters:
startPosition - The starting position of the path.
Returns:
The path as a new shape.
Author:
Mikkel B. Stegmann
Version:
5-5-2000
See Also:
PathLen, GetPaths

ovoid AddShapeExtends( int nPixels )

Adds an extra outer path on each outer path in the distance of 'nPixels' along the point normal.

This method is primary used in conjunction with the "do not use the convex hull" feature. In such a case one often still wants a certain neighborhood of the shape to be included in the model.

Parameters:
nPixels - The size of the extents.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-5-2000

ovoid SetPointInfoFlagsInPath( const int startPosition, const int flags )

Sets all flags in one path to the same value.

Parameters:
startPosition - Starting position of the path.
flags - The flags.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-9-2000

ovoid AddInterior(const int interations)

Add articifial interior points to the shape by making a Delaunay triangulation and adding the centroid of each triangle. This is done iteratively. Default is one iteration

Parameters:
interations - Controls the number of artificial points. One iteration equals one triangulation.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
12-12-2000

obool ConsistencyCheck()

Tests if any interior points has gone outside outer path of the shape.

Returns:
True if the shape looks ok, false if not.
Author:
Mikkel B. Stegmann
Version:
12-12-2000

ovoid MakeBorderShape( int size )

Converts a one path shape into a border shape by adding two symmetric borders: an inside (a hole) and an outside border.

No checks for folding paths are done as of now.

Parameters:
size - The size of the border in pixels.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
7-27-2000

oCAAMShape operator+(const CVisDVector &v) const

Plus operator.

Parameters:
v - Vector to add.
Returns:
The addition of this and 'v'.
Author:
Mikkel B. Stegmann
Version:
10-20-2000

oCAAMShape operator-(const CVisDVector &v) const

Minus operator.

Parameters:
v - Vector to add.
Returns:
The subtraction of this and 'v'.
Author:
Mikkel B. Stegmann
Version:
10-20-2000

ovoid GetHostImage( CDMultiBand<TAAMPixel> &dest, const CString &path, const int rfactor ) const

Retrives the image connected to the shape. As of now it's loaded from disk using the HostImage() member in the shape.

Parameters:
dest - The destination image.
path - The path to the .asf file.
rfactor - Optional reduction factor. Performs a scaling of the the shape by 1/rfactor. Default 1 i.e. no scaling.
Returns:
Nothing. @throws CVisFileIOError
Author:
Mikkel B. Stegmann
Version:
10-24-2000

odouble Area( bool use_covex_hull ) const

Returns the total area of the shape (with holes excluded).

Parameters:
use_covex_hull - Use the convex hull of the shape for area calculation (default false).
Returns:
The area.
Author:
Mikkel B. Stegmann
Version:
11-15-2000

oCAAMShape CalcConvexHull() const

Calculates the convex hull of each path in the shape. The calulation is built upon the geometrical fact that the homogenous point matrix: [ p1x p2x p3x ; p1y p2y p3y ; 1 1 1 ] is positive if p1, p2, p3 is a convex segment and negative if concave. Note: this holds for a clock-wise ordering of p1,p2,p3.

Any open paths are considered cyclic in the concavity calulation.

Remember that paths should be defined clock-wise in the asf format.

BUG COMMENT: This does not seem to work with multiple paths.

Returns:
A convex version of this shape w.r.t. each path.
Author:
Mikkel B. Stegmann
Version:
5-2-2001
See Also:
IsConvex

obool IsConvex() const

Tests if the shap is convex w.r.t. each path. This call is rather expensive, since it spaws a call to CalcConvexHull().

Returns:
True on convex, false on concave.
Author:
Mikkel B. Stegmann
Version:
5-2-2001
See Also:
CalcConvexHull

ovoid RemovePoint( const int i )

Removes the i-th point from the shape. Since this require massive reordering of the preceeding point connectivity this is actually a very expensive call [a fairly ugly in it's implementation] :-(

Parameters:
i - The index of the point to remove.
Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
5-2-2001

ostd::vector<float> & UserField( const int field_nb )

Returns the reference of the user defined field vector number 'field_nb'.

Parameters:
field_nb - Field number [1-3].
Returns:
A reference to the specified field vector.
Author:
Mikkel B. Stegmann
Version:
7-2-2001
See Also:

oconst std::vector<float> & UserField( const int field_nb ) const

Returns the value of the user defined field vector number 'field_nb'.

Parameters:
field_nb - Field number [1-3].
Returns:
A float holding the value of the field.
Author:
Mikkel B. Stegmann
Version:
7-2-2001
See Also:

ovoid AllocateUserFields()

Allocates room for the three user defined fields.

Notice that the user defined fields is *not* allocated by default.

In order to preserved memory the user must to this explicitly by using AllocateUserFields();

Returns:
Nothing.
Author:
Mikkel B. Stegmann
Version:
7-2-2001


This class has no child classes.
Author:
Mikkel B. Stegmann
Version:
02-08-2000
See Also:
CAAMShapeCollection

Alphabetic index Hierarchy of classes


Back AAM-API documentation The AAM-Site