Skip to content

Commit 681f16e

Browse files
authored
Merge pull request #149 from fredroy/follow_sofa_remove_compat_use
Remove use of compatibility layer (Sofa.Compat)
2 parents 3df667d + 041eb25 commit 681f16e

File tree

12 files changed

+96
-97
lines changed

12 files changed

+96
-97
lines changed

Plugin/src/SofaPython3/DataHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ BaseData* addData(py::object py_self, const std::string& name, py::object value,
554554
data = PythonFactory::createInstance(type);
555555
if (!data)
556556
{
557-
sofa::helper::vector<std::string> validTypes;
557+
sofa::type::vector<std::string> validTypes;
558558
PythonFactory::uniqueKeys(std::back_inserter(validTypes));
559559
std::string typesString = "[";
560560
for (const auto& i : validTypes)

Plugin/src/SofaPython3/PythonFactory.cpp

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -449,25 +449,25 @@ bool PythonFactory::registerDefaultTypes()
449449
PythonFactory::registerType<int>("int");
450450

451451
// vectors
452-
PythonFactory::registerType<sofa::defaulttype::Vec2d>("Vec2d");
453-
PythonFactory::registerType<sofa::defaulttype::Vec3d>("Vec3d");
454-
PythonFactory::registerType<sofa::defaulttype::Vec4d>("Vec4d");
455-
PythonFactory::registerType<sofa::defaulttype::Vec6d>("Vec6d");
456-
PythonFactory::registerType<sofa::defaulttype::Vec2f>("Vec2f");
457-
PythonFactory::registerType<sofa::defaulttype::Vec3f>("Vec3f");
458-
PythonFactory::registerType<sofa::defaulttype::Vec4f>("Vec4f");
459-
PythonFactory::registerType<sofa::defaulttype::Vec6f>("Vec6f");
452+
PythonFactory::registerType<sofa::type::Vec2d>("Vec2d");
453+
PythonFactory::registerType<sofa::type::Vec3d>("Vec3d");
454+
PythonFactory::registerType<sofa::type::Vec4d>("Vec4d");
455+
PythonFactory::registerType<sofa::type::Vec6d>("Vec6d");
456+
PythonFactory::registerType<sofa::type::Vec2f>("Vec2f");
457+
PythonFactory::registerType<sofa::type::Vec3f>("Vec3f");
458+
PythonFactory::registerType<sofa::type::Vec4f>("Vec4f");
459+
PythonFactory::registerType<sofa::type::Vec6f>("Vec6f");
460460

461461
// Matrices
462-
PythonFactory::registerType<sofa::defaulttype::Mat2x2d>("Mat2x2d");
463-
PythonFactory::registerType<sofa::defaulttype::Mat3x3d>("Mat3x3d");
464-
PythonFactory::registerType<sofa::defaulttype::Mat3x4d>("Mat3x4d");
465-
PythonFactory::registerType<sofa::defaulttype::Mat4x4d>("Mat4x4d");
462+
PythonFactory::registerType<sofa::type::Mat2x2d>("Mat2x2d");
463+
PythonFactory::registerType<sofa::type::Mat3x3d>("Mat3x3d");
464+
PythonFactory::registerType<sofa::type::Mat3x4d>("Mat3x4d");
465+
PythonFactory::registerType<sofa::type::Mat4x4d>("Mat4x4d");
466466

467-
PythonFactory::registerType<sofa::defaulttype::Mat2x2f>("Mat2x2f");
468-
PythonFactory::registerType<sofa::defaulttype::Mat3x3f>("Mat3x3f");
469-
PythonFactory::registerType<sofa::defaulttype::Mat3x4f>("Mat3x4f");
470-
PythonFactory::registerType<sofa::defaulttype::Mat4x4f>("Mat4x4f");
467+
PythonFactory::registerType<sofa::type::Mat2x2f>("Mat2x2f");
468+
PythonFactory::registerType<sofa::type::Mat3x3f>("Mat3x3f");
469+
PythonFactory::registerType<sofa::type::Mat3x4f>("Mat3x4f");
470+
PythonFactory::registerType<sofa::type::Mat4x4f>("Mat4x4f");
471471

472472
// Topology
473473
PythonFactory::registerType<sofa::core::topology::Topology::Edge>("Edge");
@@ -486,47 +486,47 @@ bool PythonFactory::registerDefaultTypes()
486486
for (const auto& container : containers)
487487
{
488488
// Scalars
489-
PythonFactory::registerType<sofa::helper::vector<std::string>>(container + "<string>");
490-
PythonFactory::registerType<sofa::helper::vector<float>>(container + "<float>");
491-
PythonFactory::registerType<sofa::helper::vector<double>>(container + "<double>");
492-
PythonFactory::registerType<sofa::helper::vector<bool>>(container + "<bool>");
493-
PythonFactory::registerType<sofa::helper::vector<int>>(container + "<int>");
489+
PythonFactory::registerType<sofa::type::vector<std::string>>(container + "<string>");
490+
PythonFactory::registerType<sofa::type::vector<float>>(container + "<float>");
491+
PythonFactory::registerType<sofa::type::vector<double>>(container + "<double>");
492+
PythonFactory::registerType<sofa::type::vector<bool>>(container + "<bool>");
493+
PythonFactory::registerType<sofa::type::vector<int>>(container + "<int>");
494494

495495
// vectors
496-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Vec2d>>(container + "<Vec2d>");
497-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Vec3d>>(container + "<Vec3d>");
498-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Vec4d>>(container + "<Vec4d>");
499-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Vec6d>>(container + "<Vec6d>");
496+
PythonFactory::registerType<sofa::type::vector<sofa::type::Vec2d>>(container + "<Vec2d>");
497+
PythonFactory::registerType<sofa::type::vector<sofa::type::Vec3d>>(container + "<Vec3d>");
498+
PythonFactory::registerType<sofa::type::vector<sofa::type::Vec4d>>(container + "<Vec4d>");
499+
PythonFactory::registerType<sofa::type::vector<sofa::type::Vec6d>>(container + "<Vec6d>");
500500

501-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Vec2f>>(container + "<Vec2f>");
502-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Vec3f>>(container + "<Vec3f>");
503-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Vec4f>>(container + "<Vec4f>");
504-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Vec6f>>(container + "<Vec6f>");
501+
PythonFactory::registerType<sofa::type::vector<sofa::type::Vec2f>>(container + "<Vec2f>");
502+
PythonFactory::registerType<sofa::type::vector<sofa::type::Vec3f>>(container + "<Vec3f>");
503+
PythonFactory::registerType<sofa::type::vector<sofa::type::Vec4f>>(container + "<Vec4f>");
504+
PythonFactory::registerType<sofa::type::vector<sofa::type::Vec6f>>(container + "<Vec6f>");
505505

506506
// Matrices
507-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Mat2x2d>>(container + "<Mat2x2d>");
508-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Mat3x3d>>(container + "<Mat3x3d>");
509-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Mat3x4d>>(container + "<Mat3x4d>");
510-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Mat4x4d>>(container + "<Mat4x4d>");
507+
PythonFactory::registerType<sofa::type::vector<sofa::type::Mat2x2d>>(container + "<Mat2x2d>");
508+
PythonFactory::registerType<sofa::type::vector<sofa::type::Mat3x3d>>(container + "<Mat3x3d>");
509+
PythonFactory::registerType<sofa::type::vector<sofa::type::Mat3x4d>>(container + "<Mat3x4d>");
510+
PythonFactory::registerType<sofa::type::vector<sofa::type::Mat4x4d>>(container + "<Mat4x4d>");
511511

512-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Mat2x2f>>(container + "<Mat2x2f>");
513-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Mat3x3f>>(container + "<Mat3x3f>");
514-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Mat3x4f>>(container + "<Mat3x4f>");
515-
PythonFactory::registerType<sofa::helper::vector<sofa::defaulttype::Mat4x4f>>(container + "<Mat4x4f>");
512+
PythonFactory::registerType<sofa::type::vector<sofa::type::Mat2x2f>>(container + "<Mat2x2f>");
513+
PythonFactory::registerType<sofa::type::vector<sofa::type::Mat3x3f>>(container + "<Mat3x3f>");
514+
PythonFactory::registerType<sofa::type::vector<sofa::type::Mat3x4f>>(container + "<Mat3x4f>");
515+
PythonFactory::registerType<sofa::type::vector<sofa::type::Mat4x4f>>(container + "<Mat4x4f>");
516516

517517

518518
// Topology
519-
PythonFactory::registerType<sofa::helper::vector<sofa::core::topology::Topology::Edge>>(container + "<Edge>");
520-
PythonFactory::registerType<sofa::helper::vector<sofa::core::topology::Topology::Triangle>>(container + "<Triangle>");
521-
PythonFactory::registerType<sofa::helper::vector<sofa::core::topology::Topology::Quad>>(container + "<Quad>");
522-
PythonFactory::registerType<sofa::helper::vector<sofa::core::topology::Topology::Tetra>>(container + "<Tetra>");
523-
PythonFactory::registerType<sofa::helper::vector<sofa::core::topology::Topology::Hexa>>(container + "<Hexa>");
524-
PythonFactory::registerType<sofa::helper::vector<sofa::core::topology::Topology::Penta>>(container + "<Penta>");
519+
PythonFactory::registerType<sofa::type::vector<sofa::core::topology::Topology::Edge>>(container + "<Edge>");
520+
PythonFactory::registerType<sofa::type::vector<sofa::core::topology::Topology::Triangle>>(container + "<Triangle>");
521+
PythonFactory::registerType<sofa::type::vector<sofa::core::topology::Topology::Quad>>(container + "<Quad>");
522+
PythonFactory::registerType<sofa::type::vector<sofa::core::topology::Topology::Tetra>>(container + "<Tetra>");
523+
PythonFactory::registerType<sofa::type::vector<sofa::core::topology::Topology::Hexa>>(container + "<Hexa>");
524+
PythonFactory::registerType<sofa::type::vector<sofa::core::topology::Topology::Penta>>(container + "<Penta>");
525525
}
526526
return true;
527527
}
528528

529-
void PythonFactory::uniqueKeys(std::back_insert_iterator<sofa::helper::vector<std::string> > it)
529+
void PythonFactory::uniqueKeys(std::back_insert_iterator<sofa::type::vector<std::string> > it)
530530
{
531531
std::transform(s_dataCreationFct.begin(), s_dataCreationFct.end(),
532532
it, [](const auto& item){ return item.first; });

Plugin/src/SofaPython3/PythonFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace sofapython3
7373

7474
static std::map<std::string, componentDowncastingFunction>::iterator searchLowestCastAvailable(const sofa::core::objectmodel::BaseClass* metaclass);
7575

76-
static void uniqueKeys(std::back_insert_iterator<sofa::helper::vector<std::string> > it);
76+
static void uniqueKeys(std::back_insert_iterator<sofa::type::vector<std::string> > it);
7777
private:
7878
static bool registerDefaultEvents();
7979
static bool registerDefaultTypes();

bindings/Modules/src/SofaPython3/SofaBaseTopology/Binding_SparseGridTopology.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void moduleAddSparseGridTopology(pybind11::module& m) {
4646

4747
// findCube (pos)
4848
c.def("findCube", [](SparseGridTopology & self, const py::list & l) {
49-
sofa::defaulttype::Vector3 pos;
49+
sofa::type::Vector3 pos;
5050
pos[0] = l[0].cast<double>();
5151
pos[1] = l[1].cast<double>();
5252
pos[2] = l[2].cast<double>();

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseCamera.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -90,52 +90,52 @@ void moduleAddBaseCamera(py::module &m)
9090
c.def("getOpenGLModelViewMatrix", getOpenGLModelViewMatrix);
9191

9292
c.def("rotate", [](BaseCamera *self, py::list p){
93-
sofa::defaulttype::Quat vec;
94-
vec = sofa::defaulttype::Quat(py::cast<double>(p[0]),py::cast<double>(p[1]),py::cast<double>(p[2]),py::cast<double>(p[3]));
93+
sofa::type::Quat<SReal> vec;
94+
vec = sofa::type::Quat<SReal>(py::cast<double>(p[0]),py::cast<double>(p[1]),py::cast<double>(p[2]),py::cast<double>(p[3]));
9595
self->rotate(vec);
9696
});
9797

9898
c.def("rotateCameraAroundPoint", [](BaseCamera *self, py::list p1, py::list p2) {
99-
sofa::defaulttype::Quat vec1;
100-
sofa::defaulttype::Vec3 vec2;
101-
vec1 = sofa::defaulttype::Quat(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]),py::cast<double>(p1[3]));
102-
vec2 = sofa::defaulttype::Vec3(py::cast<double>(p2[0]),py::cast<double>(p2[1]),py::cast<double>(p2[2]));
99+
sofa::type::Quat<SReal> vec1;
100+
sofa::type::Vec3 vec2;
101+
vec1 = sofa::type::Quat<SReal>(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]),py::cast<double>(p1[3]));
102+
vec2 = sofa::type::Vec3(py::cast<double>(p2[0]),py::cast<double>(p2[1]),py::cast<double>(p2[2]));
103103
self->rotateCameraAroundPoint(vec1, vec2);
104104
});
105105

106106
c.def("getOrientationFromLookAt", [](BaseCamera *self, py::list p1, py::list p2) {
107-
sofa::defaulttype::Vec3 vec1;
108-
sofa::defaulttype::Vec3 vec2;
109-
vec1 = sofa::defaulttype::Vec3(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]));
110-
vec2 = sofa::defaulttype::Vec3(py::cast<double>(p2[0]),py::cast<double>(p2[1]),py::cast<double>(p2[2]));
107+
sofa::type::Vec3 vec1;
108+
sofa::type::Vec3 vec2;
109+
vec1 = sofa::type::Vec3(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]));
110+
vec2 = sofa::type::Vec3(py::cast<double>(p2[0]),py::cast<double>(p2[1]),py::cast<double>(p2[2]));
111111
return (self->getOrientationFromLookAt(vec1, vec2));
112112
});
113113

114114
c.def("getLookAtFromOrientation", [](BaseCamera *self, py::list pos, double distance, py::list quat) {
115-
sofa::defaulttype::Vec3 position;
116-
sofa::defaulttype::Quat orientation;
117-
position = sofa::defaulttype::Vec3(py::cast<double>(pos[0]),py::cast<double>(pos[1]),py::cast<double>(pos[2]));
118-
orientation = sofa::defaulttype::Quat(py::cast<double>(quat[0]),py::cast<double>(quat[1]),py::cast<double>(quat[2]),py::cast<double>(quat[3]));
115+
sofa::type::Vec3 position;
116+
sofa::type::Quat<SReal> orientation;
117+
position = sofa::type::Vec3(py::cast<double>(pos[0]),py::cast<double>(pos[1]),py::cast<double>(pos[2]));
118+
orientation = sofa::type::Quat<SReal>(py::cast<double>(quat[0]),py::cast<double>(quat[1]),py::cast<double>(quat[2]),py::cast<double>(quat[3]));
119119
return (self->getLookAtFromOrientation(position, distance, orientation));
120120
});
121121

122122
c.def("getPositionFromOrientation", [](BaseCamera *self, py::list p1, py::float_ p2, py::list p3) {
123-
sofa::defaulttype::Vec3 vec1;
123+
sofa::type::Vec3 vec1;
124124
double vec2;
125-
sofa::defaulttype::Quat vec3;
126-
vec1 = sofa::defaulttype::Vec3(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]));
125+
sofa::type::Quat<SReal> vec3;
126+
vec1 = sofa::type::Vec3(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]));
127127
vec2 = py::cast<double>(p2);
128-
vec3 = sofa::defaulttype::Quat(py::cast<double>(p3[0]),py::cast<double>(p3[1]),py::cast<double>(p3[2]),py::cast<double>(p3[3]));
128+
vec3 = sofa::type::Quat<SReal>(py::cast<double>(p3[0]),py::cast<double>(p3[1]),py::cast<double>(p3[2]),py::cast<double>(p3[3]));
129129
return(self->getPositionFromOrientation(vec1, vec2, vec3));
130130
});
131131

132132
c.def("getLookAtFromOrientation", [](BaseCamera *self, py::list p1, py::float_ p2, py::list p3) {
133-
sofa::defaulttype::Vec3 vec1;
133+
sofa::type::Vec3 vec1;
134134
double vec2;
135-
sofa::defaulttype::Quat vec3;
136-
vec1 = sofa::defaulttype::Vec3(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]));
135+
sofa::type::Quat<SReal> vec3;
136+
vec1 = sofa::type::Vec3(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]));
137137
vec2 = py::cast<double>(p2);
138-
vec3 = sofa::defaulttype::Quat(py::cast<double>(p3[0]),py::cast<double>(p3[1]),py::cast<double>(p3[2]),py::cast<double>(p3[3]));
138+
vec3 = sofa::type::Quat<SReal>(py::cast<double>(p3[0]),py::cast<double>(p3[1]),py::cast<double>(p3[2]),py::cast<double>(p3[3]));
139139
return(self->getLookAtFromOrientation(vec1, vec2, vec3));
140140
});
141141

@@ -152,14 +152,14 @@ void moduleAddBaseCamera(py::module &m)
152152
});
153153

154154
c.def("worldToScreenPoint", [](BaseCamera *self, py::list pos) {
155-
sofa::defaulttype::Vec3 vec1;
156-
vec1 = sofa::defaulttype::Vec3(py::cast<double>(pos[0]), py::cast<double>(pos[1]), py::cast<double>(pos[2]));
155+
sofa::type::Vec3 vec1;
156+
vec1 = sofa::type::Vec3(py::cast<double>(pos[0]), py::cast<double>(pos[1]), py::cast<double>(pos[2]));
157157
return(self->worldToScreenPoint(vec1));
158158
});
159159

160160
c.def("screenToWorldPoint", [](BaseCamera *self, py::list pos) {
161-
sofa::defaulttype::Vec3 vec1;
162-
vec1 = sofa::defaulttype::Vec3(py::cast<double>(pos[0]), py::cast<double>(pos[1]), py::cast<double>(pos[2]));
161+
sofa::type::Vec3 vec1;
162+
vec1 = sofa::type::Vec3(py::cast<double>(pos[0]), py::cast<double>(pos[1]), py::cast<double>(pos[2]));
163163
return(self->screenToWorldPoint(vec1));
164164
});
165165
}

bindings/Sofa/src/SofaPython3/Sofa/Core/Data/Binding_DataContainer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using sofa::core::objectmodel::BaseNode;
3838
#include "Binding_DataContainer.h"
3939
#include "Binding_DataContainer_doc.h"
4040

41-
#include <sofa/defaulttype/BoundingBox.h>
41+
#include <sofa/type/BoundingBox.h>
4242

4343
namespace sofapython3
4444
{

bindings/Sofa/src/SofaPython3/Sofa/Helper/Binding_Vector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "Binding_Vector.h"
2222

23-
#include <sofa/helper/vector.h>
23+
#include <sofa/type/vector.h>
2424
#include <sofa/core/objectmodel/BaseData.h>
2525

2626
#include <pybind11/stl.h>
@@ -30,7 +30,7 @@ namespace py { using namespace pybind11; }
3030

3131

3232
/**
33-
* To add sofa::helper::vector types, follow the 2 steps below
33+
* To add sofa::type::vector types, follow the 2 steps below
3434
*/
3535

3636
// ------------------------------------
@@ -51,7 +51,7 @@ void declareVector(py::module &m, const std::string &typestr) {
5151

5252
std::string pyclass_name = std::string("Vector") + typestr;
5353

54-
py::class_<sofa::helper::vector<T>> (m, pyclass_name.c_str(), v);
54+
py::class_<sofa::type::vector<T>> (m, pyclass_name.c_str(), v);
5555
}
5656

5757
namespace sofapython3 {

bindings/Sofa/src/SofaPython3/Sofa/Types/Binding_BoundingBox.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
#include <sofa/core/objectmodel/BaseData.h>
2424
#include <sofa/core/objectmodel/Data.h>
25-
#include <sofa/defaulttype/BoundingBox.h>
25+
#include <sofa/type/BoundingBox.h>
2626
#include <SofaPython3/PythonFactory.h>
2727

28-
using sofa::defaulttype::BoundingBox;
28+
using sofa::type::BoundingBox;
2929
using sofa::core::objectmodel::BaseData;
3030

3131
namespace py { using namespace pybind11; }
@@ -66,7 +66,7 @@ void moduleAddBoundingBox(py::module& m)
6666
}, "sets the max bbox position from a python list");
6767

6868
bbox.def("getCenter", [](sofa::Data<BoundingBox>& bbox) {
69-
const sofa::defaulttype::Vec3 val = bbox.getValue().maxBBox() - bbox.getValue().maxBBox();
69+
const auto val = bbox.getValue().maxBBox() - bbox.getValue().maxBBox();
7070
py::list list;
7171
list.append(val[0]);
7272
list.append(val[1]);

bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Mat.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define BINDING_MAT_MAKE_NAME(R, C) \
2626
std::string(std::string("Mat") + std::to_string(R) + "x" + std::to_string(C))
2727

28-
using namespace sofa::defaulttype;
28+
using namespace sofa::type;
2929

3030
namespace pyMat {
3131
template <sofa::Size R, sofa::Size C>
@@ -188,7 +188,7 @@ template <> struct MATRIX<1, 1> {
188188

189189
py::class_<MatClass> p(m, BINDING_MAT_MAKE_NAME(1, 1).c_str());
190190
p.def(py::init([](py::list l) {
191-
MatClass *mat = new MatClass(NOINIT);
191+
MatClass *mat = new MatClass(sofa::type::NOINIT);
192192
if (py::isinstance<py::list>(l[0])) // 2D array
193193
{
194194
for (sofa::Size i = 0; i < MatClass::nbLines; ++i) {
@@ -217,7 +217,7 @@ template <> struct MATRIX<2, 2> {
217217
py::class_<MatClass> p(m, BINDING_MAT_MAKE_NAME(2, 2).c_str());
218218
p.def(py::init<Row, Row>());
219219
p.def(py::init([](py::list l) {
220-
MatClass *mat = new MatClass(NOINIT);
220+
MatClass *mat = new MatClass(sofa::type::NOINIT);
221221
if (py::isinstance<py::list>(l[0])) // 2D array
222222
{
223223
for (sofa::Size i = 0; i < MatClass::nbLines; ++i) {
@@ -246,7 +246,7 @@ template <> struct MATRIX<3, 3> {
246246
py::class_<MatClass> p(m, BINDING_MAT_MAKE_NAME(3, 3).c_str());
247247
p.def(py::init<Row, Row, Row>());
248248
p.def(py::init([](py::list l) {
249-
MatClass *mat = new MatClass(NOINIT);
249+
MatClass *mat = new MatClass(sofa::type::NOINIT);
250250
if (py::isinstance<py::list>(l[0])) // 2D array
251251
{
252252
for (sofa::Size i = 0; i < MatClass::nbLines; ++i) {
@@ -275,7 +275,7 @@ template <> struct MATRIX<4, 4> {
275275
py::class_<MatClass> p(m, BINDING_MAT_MAKE_NAME(4, 4).c_str());
276276
p.def(py::init<Row, Row, Row, Row>());
277277
p.def(py::init([](py::list l) {
278-
MatClass *mat = new MatClass(NOINIT);
278+
MatClass *mat = new MatClass(sofa::type::NOINIT);
279279
if (py::isinstance<py::list>(l[0])) // 2D array
280280
{
281281
for (sofa::Size i = 0; i < MatClass::nbLines; ++i) {
@@ -304,7 +304,7 @@ template <> struct MATRIX<3, 4> {
304304
py::class_<MatClass> p(m, BINDING_MAT_MAKE_NAME(3, 4).c_str());
305305
p.def(py::init<Row, Row, Row>());
306306
p.def(py::init([](py::list l) {
307-
MatClass *mat = new MatClass(NOINIT);
307+
MatClass *mat = new MatClass(sofa::type::NOINIT);
308308
if (py::isinstance<py::list>(l[0])) // 2D array
309309
{
310310
for (sofa::Size i = 0; i < MatClass::nbLines; ++i) {

0 commit comments

Comments
 (0)