<commit_before>#ifndef slic3r_TransformationMatrix_hpp_
#define slic3r_TransformationMatrix_hpp_

#include "libslic3r.h"
#include "Point.hpp"

namespace Slic3r {

class TransformationMatrix
{
public:
    TransformationMatrix();

    TransformationMatrix(const std::vector<double> &entries_row_maj);

    TransformationMatrix(
        double m11, double m12, double m13, double m14,
        double m21, double m22, double m23, double m24,
        double m31, double m32, double m33, double m34);

    TransformationMatrix(const TransformationMatrix &other);
    TransformationMatrix& operator= (TransformationMatrix other);
    void swap(TransformationMatrix &other);
<commit_msg>Trafo class description<commit_after>#ifndef slic3r_TransformationMatrix_hpp_
#define slic3r_TransformationMatrix_hpp_

#include "libslic3r.h"
#include "Point.hpp"

namespace Slic3r {

/*

    The TransformationMatrix class was created to keep track of the transformations applied
    to the objects from the GUI. Reloading these objects will now preserve their orientation.

    As usual in engineering vectors are treated as column vectors.
    
    Note that if they are treated as row vectors, the order is inversed:
    (') denotes the transponse and column vectors
    Column:         out' = M1 * M2 * in'
    Row:             out = in * M2' * M1'

    Every vector gets a 4th component w added,
    with positions lying in hyperplane w=1
    and direction vectors lying in hyperplane w=0

    Using this, affine transformations (scaling, rotating, shearing, translating and their combinations)
    can be represented as 4x4 Matri.
    The 4th row equals [0 0 0 1] in order to not alter the w component.
    The other entries are represented by the class properties mij (i-th row [1,2,3], j-th column [1,2,3,4]).
    The 4th row is not explicitly stored, it is hard coded in the multiply function.

    Column vectors have to be multiplied from the right side.

 */


class TransformationMatrix
{
public:
    TransformationMatrix();

    TransformationMatrix(const std::vector<double> &entries_row_maj);

    TransformationMatrix(
        double m11, double m12, double m13, double m14,
        double m21, double m22, double m23, double m24,
        double m31, double m32, double m33, double m34);

    TransformationMatrix(const TransformationMatrix &other);
    TransformationMatrix& operator= (TransformationMatrix other);
    void swap(TransformationMatrix &other);

{'fraction_non_alphanumeric': 0.06634106634106635, 'fraction_numerical': 0.031746031746031744, 'mean_word_length': 3.896414342629482, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3005277', 'n_tokens_mistral': 734, 'n_tokens_neox': 676, 'n_words': 266}