All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
matrixData.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_BASE_GF_MATRIX_DATA_H
8#define PXR_BASE_GF_MATRIX_DATA_H
9
10#include "pxr/pxr.h"
11#include "pxr/base/gf/api.h"
12
13PXR_NAMESPACE_OPEN_SCOPE
14
18template <class T, int Rows, int Columns>
20public:
21
23 T *operator[](int row) {
24 return _data + (row * Columns);
25 }
26
28 T const *operator[](int row) const {
29 return _data + (row * Columns);
30 }
31
33 T *GetData() {
34 return _data;
35 }
36
38 T const *GetData() const {
39 return _data;
40 }
41
42private:
43
44 T _data[Rows * Columns];
45};
46
47PXR_NAMESPACE_CLOSE_SCOPE
48
49#endif // PXR_BASE_GF_MATRIX_DATA_H
A class template used by GfMatrixXX to store values.
Definition: matrixData.h:19
T * operator[](int row)
Return a pointer to a row of data.
Definition: matrixData.h:23
T const * operator[](int row) const
Return a const pointer to a row of data.
Definition: matrixData.h:28
T * GetData()
Return a pointer to the start of all the data.
Definition: matrixData.h:33
T const * GetData() const
Return a const pointer to the start of all the data.
Definition: matrixData.h:38