golib
0.5
|
Point cloud. More...
#include <gopointcloud.h>
Public Member Functions | |
goPointCloud (goSize_t dim=2) | |
goPointCloud (const goPointCloud< T > &) | |
goPointCloud (const goList< goMath::Vector< T > > &) | |
goPointCloud (const goMath::Matrix< T > &) | |
goPointCloud< T > & | operator= (const goPointCloud< T > &) |
bool | operator!= (const goPointCloud< T > &other) const |
bool | operator== (const goPointCloud< T > &other) const |
goIndex_t | getPointCount () const |
Get number of points. More... | |
goList< goMath::Vector< T > > & | getPoints () |
Get list of points. More... | |
const goList< goMath::Vector< T > > & | getPoints () const |
Get list of points. More... | |
virtual bool | setPoints (const goList< goMath::Vector< T > > &) |
Set the point list. More... | |
virtual bool | setPoints (const goMath::Matrix< T > &) |
Set points from the rows of a configuration matrix. More... | |
void | addPoint (const goMath::Vector< T > &p) |
Adds point to this cloud. More... | |
void | setChanged () |
goSize_t | getDim () const |
bool | getCenterOfMass (goMath::Vector< T > &comRet) const |
Calculates the center of mass of the point cloud. More... | |
bool | translate (const goMath::Vector< T > &d) |
Translate all points. More... | |
bool | scale (T s) |
Scale all points. More... | |
void | getConfigurationMatrix (goMath::Matrix< T > &cmRet) const |
Get matrix containing the point coordinates. More... | |
void | getConfigurationVector (goMath::Vector< T > &cvRet) const |
Get configuration vector. More... | |
bool | getPrincipalAxes2D (goMath::Vectorf &a1, goMath::Vectorf &a2, const goArray< goFloat > *weights=0) const |
Calculate 2 principal axes. More... | |
bool | getPrincipalAxes (goMath::Matrix< T > &axes) const |
bool | unitScale (goFloat factor=1.0f) |
template<class matrixT > | |
bool | transform (const matrixT &m) |
void | affineTransform (const goMath::Matrix< T > &m) |
virtual bool | writeObjectFile (FILE *) const |
DO NOT USE Write the point cloud to a file. More... | |
virtual bool | readObjectFile (FILE *) |
DO NOT USE Read the point cloud from a file. More... | |
virtual bool | callObjectMethod (int methodID, goObjectMethodParameters *param=NULL) |
Call an object method by identifier. More... | |
![]() | |
goObjectBase () | |
Constructor. | |
virtual | ~goObjectBase () |
Destructor. More... | |
const char * | getClassName () const |
Returns the class name. More... | |
int | getClassID () const |
virtual goSize_t | memoryUsage () const |
Returns the size of this object or some measure of its memory consumption. More... | |
void | setObjectName (const char *name) |
Set name string for an object. More... | |
void | setObjectName (const goString &name) |
Set name string for an object. More... | |
const goString & | getObjectName () const |
Get the object name. More... | |
void | connectObject (goObjectBase *object) |
Connects an object to this object. More... | |
void | disconnectObject (const goObjectBase *object) |
Disconnects an object from this object. | |
virtual bool | queueObjectMethod (int methodID, goObjectMethodParameters *param=NULL, bool blocking=false) |
Enqueue a method call to an internal list of methods. More... | |
bool | callQueuedMethods () |
Call all queued methods. More... | |
Static Public Member Functions | |
static bool | getCenterOfMass (const goFixedArray< goMath::Vector< T > > &, goMath::Vector< T > &comRet) |
static bool | getPrincipalAxes (const goFixedArray< goMath::Vector< T > > &, goMath::Matrix< T > &axes) |
static bool | readASCII (const char *filename, goSize_t dimension, goList< goMath::Vector< T > > &pointList) |
Protected Member Functions | |
virtual void | receiveObjectMessage (const goObjectMessage &message) |
Receive a message. More... | |
![]() | |
void | setClassID (int id) |
Sets the class name. | |
void | printClassMessage (const char *msg) |
Sets the class name. More... | |
void | printClassMessage (goString &msg) |
Prints an informational message to the calling console. More... | |
void | sendObjectMessage (int messageID, void *data=NULL) |
Sends a message to all connected objects. | |
void | sendObjectMessage (goObjectBase *object, int messageID, void *data=NULL) |
Sends a message to a specific object. | |
Point cloud.
Points are represented using goMath::Vector<T> objects.
void goPointCloud< T >::addPoint | ( | const goMath::Vector< T > & | p | ) |
Adds point to this cloud.
p | Point to be added. |
|
virtual |
Call an object method by identifier.
See the file goobjectmessage.h for messages and add messages there if needed. External applications building on this class should use identifiers starting with GO_OBJECTMETHOD_USER.
methodID | ID of the method. See goobjectmethod.h |
param | Pointer to parameters for the method, if any. |
Reimplemented from goObjectBase.
Reimplemented in goCurve< T >.
bool goPointCloud< T >::getCenterOfMass | ( | goMath::Vector< T > & | comRet | ) | const |
Calculates the center of mass of the point cloud.
No weights are used, all points are weighted with the factor 1.
comRet | Center of mass. |
void goPointCloud< T >::getConfigurationMatrix | ( | goMath::Matrix< T > & | cmRet | ) | const |
Get matrix containing the point coordinates.
Fill a matrix , where with the k points of dimension n from this point cloud.
cmRet | Configuration matrix. Resized if necessary. |
void goPointCloud< T >::getConfigurationVector | ( | goMath::Vector< T > & | cvRet | ) | const |
Get configuration vector.
Get a vector containing the coordinates of all k points p of dimension n in this point cloud concatenated.
cvRet | Configuration vector. Resized if necessary. |
goIndex_t goPointCloud< T >::getPointCount | ( | ) | const |
Get number of points.
goList< goMath::Vector< T > > & goPointCloud< T >::getPoints | ( | ) |
Get list of points.
const goList< goMath::Vector< T > > & goPointCloud< T >::getPoints | ( | ) | const |
Get list of points.
bool goPointCloud< T >::getPrincipalAxes2D | ( | goMath::Vectorf & | a1, |
goMath::Vectorf & | a2, | ||
const goArray< goFloat > * | weights = 0 |
||
) | const |
Calculate 2 principal axes.
Works only with x and y coordinates of the points.
Points must be moved to their center of mass prior to this method.
a1 | Contains the major principal axis (the one with the higher eigenvalue). |
a2 | Contains the minor principal axis. |
|
virtual |
DO NOT USE Read the point cloud from a file.
Reads all 4 coordinates and the point value from the file.
f | Valid, open file. |
Reimplemented from goObjectBase.
Reimplemented in goCurve< T >.
|
protectedvirtual |
Receive a message.
This function gets called each time another object "sends" a message to this object. Reimplement this in order to allow derived classes to react to messages.
Reimplemented from goObjectBase.
Reimplemented in goCurve< T >.
bool goPointCloud< T >::scale | ( | T | s | ) |
Scale all points.
s | Scale factor. |
|
virtual |
Set the point list.
points | List of points. This list will be deep-copied into the internal list. |
Reimplemented in goCurve< T >.
|
virtual |
Set points from the rows of a configuration matrix.
m | Matrix, each row containing one point. |
Reimplemented in goCurve< T >.
bool goPointCloud< T >::translate | ( | const goMath::Vector< T > & | d | ) |
Translate all points.
d | Translation. |
|
virtual |
DO NOT USE Write the point cloud to a file.
Writes all 4 coordinates and the point value to the file.
f | Valid, open file. |
Reimplemented from goObjectBase.
Reimplemented in goCurve< T >.