RDKit: RDGeom::Transform2D Class Reference

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
RDGeom::Transform2D Class Reference

`#include <Transform2D.h>`

Inheritance diagram for RDGeom::Transform2D:

## Public Member Functions
| Transform2D ()
| Constructor. More...
void | setToIdentity ()
void | TransformPoint (Point2D &pt) const
void | SetTranslation (const Point2D &pt)
void | SetTransform (const Point2D &ref1, const Point2D &ref2, const Point2D &pt1, const Point2D &pt2)
| Set the tranform so that the specified points are aligned. More...
void | SetTransform (const Point2D &pt, double angle)
| Set the trans form to counterclock wise rotation by the specified value around point. More...
Public Member Functions inherited from RDNumeric::SquareMatrix< double >
| SquareMatrix ()
| brief Square matrix of size N More...
| SquareMatrix (unsigned int N)
| SquareMatrix (unsigned int N, doubleval)
| SquareMatrix (unsigned int N, typename Matrix< double >::DATA_SPTR data)
virtual SquareMatrix< double > & | operator*= (doublescale)
| Multiplication by a scalar. More...
virtual SquareMatrix< double > & | operator*= (const SquareMatrix< double > &B)
| In place matrix multiplication. More...
virtual SquareMatrix< double > & | transposeInplace ()
| In place matrix transpose. More...
Public Member Functions inherited from RDNumeric::Matrix< double >
| Matrix (unsigned int nRows, unsigned int nCols)
| Initialize with a size. More...
| Matrix (unsigned int nRows, unsigned int nCols, doubleval)
| Initialize with a size and default value. More...
| Matrix (unsigned int nRows, unsigned int nCols, DATA_SPTR data)
| Initialize from a pointer. More...
| Matrix (const Matrix< double > &other)
| copy constructor More...
virtual | ~Matrix ()
unsigned int | numRows () const
| returns the number of rows More...
unsigned int | numCols () const
| returns the number of columns More...
unsigned int | getDataSize () const
virtual double | getVal (unsigned int i, unsigned int j) const
| returns a particular element of the matrix More...
virtual void | setVal (unsigned int i, unsigned int j, doubleval)
| sets a particular element of the matrix More...
virtual void | getRow (unsigned int i, Vector< double > &row) const
| returns a copy of a row of the matrix More...
virtual void | getCol (unsigned int i, Vector< double > &col) const
| returns a copy of a column of the matrix More...
double * | getData ()
| returns a pointer to our data array More...
const double * | getData () const
| returns a const pointer to our data array More...
Matrix< double > & | assign (const Matrix< double > &other)
| Copy operator. More...
virtual Matrix< double > & | operator+= (const Matrix< double > &other)
| Matrix addition. More...
virtual Matrix< double > & | operator-= (const Matrix< double > &other)
| Matrix subtraction. More...
virtual Matrix< double > & | operator/= (doublescale)
| division by a scalar More...
virtual Matrix< double > & | transpose (Matrix< double > &transpose) const
| copies the transpose of this Matrix into another, returns the result More...

## Additional Inherited Members
Public Types inherited from RDNumeric::Matrix< double >
typedef boost::shared_array< double > | DATA_SPTR
Protected Member Functions inherited from RDNumeric::Matrix< double >
| Matrix ()
Protected Attributes inherited from RDNumeric::Matrix< double >
unsigned int | d_nRows
unsigned int | d_nCols
unsigned int | d_dataSize
DATA_SPTR | d_data

## Detailed Description

Definition at line 20 of file Transform2D.h.

## Constructor & Destructor Documentation

RDGeom::Transform2D::Transform2D | ( |  | ) |
| inline

Constructor.

Initialize to an identity matrix transformation This is a 3x3 matrix that includes the rotation and translation parts see Foley's "Introduction to Computer Graphics" for the representation

Operator *= and = are provided by the parent class square matrix. Operator *= needs some explanation, since the order matters. This transform gets set to the combination other and the current state of this transform If this_old and this_new are the states of this object before and after this function we have this_new(point) = this_old(other(point))

Definition at line 37 of file Transform2D.h.

References RDNumeric::Matrix< double >::d_data, RDGeom::DIM_2D, RDGeom::operator*(), setToIdentity(), SetTransform(), SetTranslation(), and TransformPoint().

## Member Function Documentation

void RDGeom::Transform2D::setToIdentity | ( |  | ) |

Referenced by Transform2D().

void RDGeom::Transform2D::SetTransform | ( | const Point2D & | ref1,
|  | const Point2D & | ref2,
|  | const Point2D & | pt1,
|  | const Point2D & | pt2
| ) |  |

Set the tranform so that the specified points are aligned.

The resulting tranformation will align pt1 with ref1, and rotation pt2 such that the line betweem (pt1, pt2) will align with with the line (ref1, ref2)

Referenced by Transform2D().

void RDGeom::Transform2D::SetTransform | ( | const Point2D & | pt,
|  | double | angle
| ) |  |

Set the trans form to counterclock wise rotation by the specified value around point.

ARGUMENTS:

- pt : point about which to rotate
- angle : the angle byt which to rotate

void RDGeom::Transform2D::SetTranslation | ( | const Point2D & | pt | ) |

Referenced by Transform2D().

void RDGeom::Transform2D::TransformPoint | ( | Point2D & | pt | ) | const

Referenced by RDDepict::EmbeddedAtom::Transform(), and Transform2D().

The documentation for this class was generated from the following file:

- Transform2D.h