LibreOffice Module basegfx (master) 1
Public Member Functions | List of all members
basegfx::B2IVector Class Reference

Base Point class with two sal_Int32 values. More...

#include <b2ivector.hxx>

Inheritance diagram for basegfx::B2IVector:
[legend]
Collaboration diagram for basegfx::B2IVector:
[legend]

Public Member Functions

 B2IVector ()
 Create a 2D Vector. More...
 
 B2IVector (sal_Int32 nX, sal_Int32 nY)
 Create a 2D Vector. More...
 
 B2IVector (const ::basegfx::B2ITuple &rTuple)
 constructor with tuple to allow copy-constructing from B2ITuple-based classes More...
 
B2IVectoroperator*= (const B2IVector &rPnt)
 *=operator to allow usage from B2IVector, too More...
 
B2IVectoroperator*= (sal_Int32 t)
 *=operator to allow usage from B2IVector, too More...
 
B2IVectoroperator= (const ::basegfx::B2ITuple &rVec)
 assignment operator to allow assigning the results of B2ITuple calculations More...
 
B2IVectorsetLength (double fLen)
 Set the length of this 2D Vector. More...
 
double scalar (const B2IVector &rVec) const
 Calculate the Scalar with another 2D Vector. More...
 
B2IVectoroperator*= (const B2DHomMatrix &rMat)
 Transform vector by given transformation matrix. More...
 
- Public Member Functions inherited from basegfx::B2ITuple
 B2ITuple ()
 Create a 2D Tuple. More...
 
 B2ITuple (sal_Int32 nX, sal_Int32 nY)
 Create a 2D Tuple. More...
 
B2ITuple operator- (void) const
 
- Public Member Functions inherited from basegfx::Tuple2D< sal_Int32 >
 Tuple2D (sal_Int32 x, sal_Int32 y)
 Create a 2D Tuple. More...
 
double get (Axis2D eAxis)
 
void set (Axis2D eAxis, sal_Int32 fValue)
 
sal_Int32 getX () const
 Get X-Coordinate of 2D Tuple. More...
 
sal_Int32 getY () const
 Get Y-Coordinate of 2D Tuple. More...
 
void setX (sal_Int32 fX)
 Set X-Coordinate of 2D Tuple. More...
 
void setY (sal_Int32 fY)
 Set Y-Coordinate of 2D Tuple. More...
 
void adjustX (sal_Int32 fX)
 Adjust X-Coordinate of 2D Tuple. More...
 
void adjustY (sal_Int32 fY)
 Adjust Y-Coordinate of 2D Tuple. More...
 
bool equal (const Tuple2D< sal_Int32 > &rTup) const
 
bool equal (const Tuple2D< sal_Int32 > &rTup) const
 
bool equalZero () const
 
bool equalZero () const
 
Tuple2D< sal_Int32 > & operator+= (const Tuple2D< sal_Int32 > &rTup)
 
Tuple2D< sal_Int32 > & operator-= (const Tuple2D< sal_Int32 > &rTup)
 
Tuple2D< sal_Int32 > & operator/= (const Tuple2D< sal_Int32 > &rTup)
 
Tuple2D< sal_Int32 > & operator/= (sal_Int32 t)
 
Tuple2D< sal_Int32 > & operator*= (const Tuple2D< sal_Int32 > &rTup)
 
Tuple2D< sal_Int32 > & operator*= (sal_Int32 t)
 
Tuple2D< sal_Int32 > operator- (void) const
 
bool operator== (const Tuple2D< sal_Int32 > &rTup) const
 
bool operator!= (const Tuple2D< sal_Int32 > &rTup) const
 

Additional Inherited Members

- Public Attributes inherited from basegfx::Tuple2D< sal_Int32 >
sal_Int32 mnX
 
sal_Int32 mnY
 
sal_Int32 mfX
 
sal_Int32 mfY
 
- Protected Attributes inherited from basegfx::Tuple2D< sal_Int32 >
union {
   struct {
      TYPE   mnX
 
      TYPE   mnY
 
   } 
 
   struct {
      TYPE   mfX
 
      TYPE   mfY
 
   } 
 
}; 
 

Detailed Description

Base Point class with two sal_Int32 values.

This class derives all operators and common handling for a 2D data class from B2ITuple. All necessary extensions which are special for 2D Vectors are added here.

See also
B2ITuple

Definition at line 39 of file b2ivector.hxx.

Constructor & Destructor Documentation

◆ B2IVector() [1/3]

basegfx::B2IVector::B2IVector ( )
inline

Create a 2D Vector.

The vector is initialized to (0, 0)

Definition at line 46 of file b2ivector.hxx.

◆ B2IVector() [2/3]

basegfx::B2IVector::B2IVector ( sal_Int32  nX,
sal_Int32  nY 
)
inline

Create a 2D Vector.

Parameters
nXThis parameter is used to initialize the X-coordinate of the 2D Vector.
nYThis parameter is used to initialize the Y-coordinate of the 2D Vector.

Definition at line 59 of file b2ivector.hxx.

◆ B2IVector() [3/3]

basegfx::B2IVector::B2IVector ( const ::basegfx::B2ITuple rTuple)
inline

constructor with tuple to allow copy-constructing from B2ITuple-based classes

Definition at line 66 of file b2ivector.hxx.

Member Function Documentation

◆ operator*=() [1/3]

B2IVector & basegfx::B2IVector::operator*= ( const B2DHomMatrix rMat)

Transform vector by given transformation matrix.

Since this is a vector, translational components of the matrix are disregarded.

Definition at line 33 of file b2ivector.cxx.

References basegfx::fround(), basegfx::B2DHomMatrix::get(), basegfx::Tuple2D< sal_Int32 >::mnX, and basegfx::Tuple2D< sal_Int32 >::mnY.

◆ operator*=() [2/3]

B2IVector & basegfx::B2IVector::operator*= ( const B2IVector rPnt)
inline

*=operator to allow usage from B2IVector, too

Definition at line 72 of file b2ivector.hxx.

References basegfx::Tuple2D< TYPE >::mnX, and basegfx::Tuple2D< TYPE >::mnY.

◆ operator*=() [3/3]

B2IVector & basegfx::B2IVector::operator*= ( sal_Int32  t)
inline

*=operator to allow usage from B2IVector, too

Definition at line 81 of file b2ivector.hxx.

References t.

◆ operator=()

B2IVector & basegfx::B2IVector::operator= ( const ::basegfx::B2ITuple rVec)

assignment operator to allow assigning the results of B2ITuple calculations

Definition at line 26 of file b2ivector.cxx.

References basegfx::Tuple2D< sal_Int32 >::mnX, and basegfx::Tuple2D< sal_Int32 >::mnY.

◆ scalar()

double basegfx::B2IVector::scalar ( const B2IVector rVec) const
inline

Calculate the Scalar with another 2D Vector.

Parameters
rVecThe second 2D Vector
Returns
The Scalar value of the two involved 2D Vectors

Definition at line 108 of file b2ivector.hxx.

References basegfx::Tuple2D< TYPE >::mnX, and basegfx::Tuple2D< TYPE >::mnY.

Referenced by setLength().

◆ setLength()

B2IVector & basegfx::B2IVector::setLength ( double  fLen)

Set the length of this 2D Vector.

Parameters
fLenThe to be achieved length of the 2D Vector

Definition at line 43 of file b2ivector.cxx.

References basegfx::fTools::equalZero(), basegfx::fround(), basegfx::Tuple2D< sal_Int32 >::mnX, basegfx::Tuple2D< sal_Int32 >::mnY, and scalar().


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