|
21 | 21 | ******************************************************************************/ |
22 | 22 | #pragma once |
23 | 23 |
|
| 24 | +#include <sofa/component/mass/RigidMassType.h> |
| 25 | +#include <sofa/component/mass/VecMassType.h> |
24 | 26 | #include <sofa/component/mass/config.h> |
25 | | - |
26 | | -#include <sofa/type/vector.h> |
27 | | -#include <sofa/type/Vec.h> |
28 | | -#include <sofa/defaulttype/VecTypes.h> |
29 | | -#include <sofa/defaulttype/RigidTypes.h> |
30 | 27 | #include <sofa/core/behavior/Mass.h> |
31 | | -#include <sofa/core/topology/TopologyData.h> |
| 28 | +#include <sofa/core/behavior/TopologyAccessor.h> |
32 | 29 | #include <sofa/core/objectmodel/DataFileName.h> |
33 | | - |
34 | | -#include <sofa/component/mass/VecMassType.h> |
35 | | -#include <sofa/component/mass/RigidMassType.h> |
| 30 | +#include <sofa/core/topology/TopologyData.h> |
| 31 | +#include <sofa/defaulttype/RigidTypes.h> |
| 32 | +#include <sofa/defaulttype/VecTypes.h> |
| 33 | +#include <sofa/type/Vec.h> |
| 34 | +#include <sofa/type/vector.h> |
36 | 35 |
|
37 | 36 | #include <type_traits> |
38 | 37 |
|
@@ -60,10 +59,10 @@ public : |
60 | 59 | * @tparam GeometricalTypes type of the geometry, i.e type of the state associated with the topology (if the topology and the mass relates to the same state, this will be the same as DataTypes) |
61 | 60 | */ |
62 | 61 | template <class DataTypes, class GeometricalTypes = DataTypes> |
63 | | -class DiagonalMass : public core::behavior::Mass<DataTypes> |
| 62 | +class DiagonalMass : public core::behavior::Mass<DataTypes>, public virtual sofa::core::behavior::TopologyAccessor |
64 | 63 | { |
65 | 64 | public: |
66 | | - SOFA_CLASS(SOFA_TEMPLATE2(DiagonalMass,DataTypes, GeometricalTypes), SOFA_TEMPLATE(core::behavior::Mass,DataTypes)); |
| 65 | + SOFA_CLASS2(SOFA_TEMPLATE2(DiagonalMass,DataTypes, GeometricalTypes), SOFA_TEMPLATE(core::behavior::Mass,DataTypes), sofa::core::behavior::TopologyAccessor); |
67 | 66 |
|
68 | 67 | using TMassType = typename sofa::component::mass::MassType<DataTypes>::type; |
69 | 68 |
|
@@ -113,8 +112,6 @@ class DiagonalMass : public core::behavior::Mass<DataTypes> |
113 | 112 | /// value defining the initialization process of the mass (0 : totalMass, 1 : massDensity, 2 : vertexMass) |
114 | 113 | int m_initializationProcess; |
115 | 114 |
|
116 | | - /// Link to be set to the topology container in the component graph. |
117 | | - SingleLink<DiagonalMass<DataTypes, GeometricalTypes>, sofa::core::topology::BaseMeshTopology, BaseLink::FLAG_STOREPATH | BaseLink::FLAG_STRONGLINK> l_topology; |
118 | 115 | /// Link to be set to the MechanicalObject associated with the geometry |
119 | 116 | SingleLink<DiagonalMass<DataTypes, GeometricalTypes>, sofa::core::behavior::MechanicalState<GeometricalTypes>, BaseLink::FLAG_STOREPATH | BaseLink::FLAG_STRONGLINK> l_geometryState; |
120 | 117 |
|
|
0 commit comments