|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
VECTOR SET CLASS
-------------------------------------------------------
Name : VecSet.hh
Library : vecsetC
Description: Set of pointers to position vectors
Dependancies: Vector3dC
Modified : 2.95 AH
Created : 8.2.95
Author : Adrian Hilton
-------------------------------------------------------
========================================================
INLINE
========================================================
================== VECTOR SET ==========================
The vector set is a flexible way to access a set of vectors.
The data may be stored in an array or externally in a list/graph
structure, however it is always accessed the same way.
Obviously a small space& time overhead is incurred for array type data.
The vectors themselves may or may not be stored locally.
The array of pointers is always stored locally (the possibility to
store outside was withdrawn)
The usual warnings re: stale data apply. If the data is stored elsehere
and modified or destroyed this routine will crash without warning.
Derived Classes:
Variables:
- int nvector;
-
the number of vector/pointers to vectors
- SArray1dC vector;
-
array of vectors
- SArray1dC pvector;
-
array of pointers to vectors
- BooleanT p_allocated;
-
pointer array IS/IS NOT allocated - always TRUE!
- BooleanT v_allocated;
-
vector array IS/IS NOT allocated
Methods:
- VectorSetC()
-
Constructs an empty VectorSetC
- VectorSetC(int n,BooleanT v_allocate = TRUE)
-
normal constructor, by default both pointer and vector arrays
are allocated, but the option of not allocating the vectors is available
- VectorSetC(SArray1dC<Vector3dC> & vlist)
-
allocates array of pointers to vectors, but not the vector array itself
pointers point to vectors in existing array
- VectorSetC(DListC<Vector3dC> & vlist)
-
allocates array of pointers to vectors, but not the vector array itself
pointers point to vectors in list
- VectorSetC(const VectorSetC & vset)
-
Copy constructor
- VectorSetC & operator=(const VectorSetC & vset)
-
- ~VectorSetC()
-
destructor
VectorSetC(int n,Vector3dC **set);
do not allocate vectors or pointers, use external
===To be withdrawn===
VectorSetC(int n,Vector3dC *set);
do not allocate vectors, use external
allocate and assign pointers
===To be withdrawn===
- VectorSetC(const char * filename)
-
use Load to construct from file
General File loading and saving
-------------------------------
- int SoftLoad(const char * fname)
-
load from any file, if error then return 0 else 1
- void Load(const char * fname)
-
load from any file, if error then exit
- void Save(const char * fname)
-
save to any file
Specific Format File loading and saving
---------------------------------------
- void MultiLoadVec(int n)
-
load n .vec files from 0.vec to n-1.vec
- void Add(VectorSetC v)
-
concatenate the VectorSetC v
- int LoadAsc(const char * fname)
-
load .asc file, if error then return 0 else 1
- void SaveAsc(const char * fname)
-
save .asc file
- int LoadVec(const char * fname)
-
load .vec file, if error then return 0 else 1
- void SaveVec(const char * fname)
-
save .vec file
- int LoadFld(const char * fname)
-
load avs .fld file, if error then return 0 else 1
- void SaveFld(const char * fname)
-
save avs .fld file
Access to vector set
--------------------
- int N()
-
number in set
- int Num()
-
number in set
- unsigned int Size()
-
number in set
- Vector3dC * GetP(const int & n)
-
get pointers to nth vector
- Vector3dC Get(const int & n)
-
get nth vector
returns copy !!
- void Set(int & n,Vector3dC & v)
-
set the nth vector
- void SetP(int & n,Vector3dC * pv)
-
set the nth vector pointer
- Vector3dC & operator[](const int n)
-
access via []
- const Vector3dC & operator[](const int n) const
-
access via []
General functions
-----------------
- VectorSetC operator+(const VectorSetC & v)
-
Memberwise addition
- VectorSetC operator*(const double & d)
-
Memberwise multiplication
- double MaxDiff(const VectorSetC & v)
-
maximum difference of any two members
- VectorSetC Copy(void)
-
Create a copy of the VectorSetC. New pointer AND vector arrays are created
v_allocated is always TRUE in the Copy
- void Transform(RigidTransC rt)
-
Apply the transform rt to all points in the set
- void Limits(Vector3dC & vmin,Vector3dC & vmax)
-
vector xyz limits
- void Print()
-
Print to std output
- void Randomize(int idum = -1)
-
randomize the vectorset
|
Programmer:Andrew Stoddart, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|