Skip to content

Commit 6b21423

Browse files
committed
adapt code to the new plugin name and latest SOFA changes
1 parent 5b5f48c commit 6b21423

33 files changed

Lines changed: 167 additions & 167 deletions

src/Shell/controller/MeshChangedEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace shell::objectmodel
3232
using namespace sofa::type;
3333

3434
// Sent by MeshInterpolator when the mesh changes
35-
class SOFA_SHELLS_API MeshChangedEvent : public sofa::core::objectmodel::Event
35+
class SOFA_SHELL_API MeshChangedEvent : public sofa::core::objectmodel::Event
3636
{
3737
public:
3838

src/Shell/controller/TriangleSwitchExample.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#define SOFA_COMPONENT_CONTROLLER_TRIANGLESWITCHEXAMPLE_CPP
22

3-
#include <SofaShells/config.h>
4-
#include <SofaShells/controller/TriangleSwitchExample.inl>
3+
#include <Shell/config.h>
4+
#include <Shell/controller/TriangleSwitchExample.inl>
55
#include <sofa/core/ObjectFactory.h>
66

77

@@ -22,7 +22,7 @@ int TriangleSwitchExampleClass = core::RegisterObject("Repeatedly switches topol
2222
.add< TriangleSwitchExample<defaulttype::Rigid3Types> >(true) // default template
2323
;
2424

25-
template class SOFA_SHELLS_API TriangleSwitchExample<defaulttype::Rigid3Types>;
25+
template class SOFA_SHELL_API TriangleSwitchExample<defaulttype::Rigid3Types>;
2626

2727
} // namespace controller
2828

src/Shell/controller/TriangleSwitchExample.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef SOFA_COMPONENT_CONTROLLER_TRIANGLESWITCHEXAMPLE_INL
22
#define SOFA_COMPONENT_CONTROLLER_TRIANGLESWITCHEXAMPLE_INL
33

4-
#include <SofaShells/controller/TriangleSwitchExample.h>
4+
#include <Shell/controller/TriangleSwitchExample.h>
55

66
namespace sofa
77
{
@@ -162,7 +162,7 @@ void TriangleSwitchExample<DataTypes>::onEndAnimationStep(const double /*dt*/)
162162
template<class DataTypes>
163163
void TriangleSwitchExample<DataTypes>::computeTriangleNormal(const Triangle &t, Vec3 &normal)
164164
{
165-
const VecCoord& x = m_state->read(sofa::core::ConstVecCoordId::restPosition())->getValue();
165+
const VecCoord& x = m_state->read(sofa::core::vec_id::read_access::restPosition)->getValue();
166166

167167
//std::cout << "tri: " << t << " n=" << x.size() << std::endl;
168168

src/Shell/engine/FindClosePoints.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#define SOFA_COMPONENT_ENGINE_FINDCLOSEPOINTS_CPP
2-
#include <SofaShells/engine/FindClosePoints.inl>
2+
#include <Shell/engine/FindClosePoints.inl>
33
#include <sofa/core/ObjectFactory.h>
4-
#include <SofaShells/config.h>
4+
#include <Shell/config.h>
55

66
namespace sofa
77
{
@@ -22,11 +22,11 @@ int FindClosePointsClass = core::RegisterObject(
2222
.add< FindClosePoints<defaulttype::Rigid3Types> >()
2323
;
2424

25-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec1Types>;
26-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec2Types>;
27-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec3Types>;
28-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Rigid2Types>;
29-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Rigid3Types>;
25+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec1Types>;
26+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec2Types>;
27+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec3Types>;
28+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Rigid2Types>;
29+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Rigid3Types>;
3030

3131

3232
} // namespace constraint

src/Shell/engine/FindClosePoints.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ class FindClosePoints : public sofa::core::DataEngine
5555
#if defined(WIN32) && !defined(SOFA_COMPONENT_ENGINE_FINDCLOSEPOINTS_CPP)
5656
#pragma warning(disable : 4231)
5757
#ifndef SOFA_FLOAT
58-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec1Types>;
59-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec2Types>;
60-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec3Types>;
61-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Rigid2Types>;
62-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Rigid3Types>;
58+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec1Types>;
59+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec2Types>;
60+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec3Types>;
61+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Rigid2Types>;
62+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Rigid3Types>;
6363
#endif //SOFA_FLOAT
6464
#ifndef SOFA_DOUBLE
65-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec1Types>;
66-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec2Types>;
67-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Vec3Types>;
68-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Rigid2Types>;
69-
template class SOFA_SHELLS_API FindClosePoints<defaulttype::Rigid3Types>;
65+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec1Types>;
66+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec2Types>;
67+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Vec3Types>;
68+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Rigid2Types>;
69+
template class SOFA_SHELL_API FindClosePoints<defaulttype::Rigid3Types>;
7070
#endif //SOFA_DOUBLE
7171

7272

src/Shell/engine/FindClosePoints.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef SOFA_COMPONENT_ENGINE_FINDCLOSEPOINTS_INL
22
#define SOFA_COMPONENT_ENGINE_FINDCLOSEPOINTS_INL
33

4-
#include <SofaShells/engine/FindClosePoints.h>
4+
#include <Shell/engine/FindClosePoints.h>
55

66
namespace sofa
77
{

src/Shell/forcefield/BezierTriangularBendingFEMForceField.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
* Contact information: contact@sofa-framework.org *
2424
******************************************************************************/
2525
#define SOFA_COMPONENT_FORCEFIELD_BEZIER_TRIANGULAR_BENDING_FEM_FORCEFIELD_CPP
26-
#include <SofaShells/forcefield/BezierTriangularBendingFEMForceField.inl>
26+
#include <Shell/forcefield/BezierTriangularBendingFEMForceField.inl>
2727
#include <sofa/core/behavior/ForceField.inl>
2828
#include <sofa/defaulttype/RigidTypes.h>
2929
#include <sofa/component/statecontainer/MechanicalObject.h>
3030
#include <sofa/core/ObjectFactory.h>
31-
#include <SofaShells/config.h>
31+
#include <Shell/config.h>
3232

3333

3434
namespace sofa
@@ -47,7 +47,7 @@ int BezierTriangularBendingFEMForceFieldClass = core::RegisterObject("Triangular
4747
.add< BezierTriangularBendingFEMForceField<Rigid3Types> >()
4848
;
4949

50-
template class SOFA_SHELLS_API BezierTriangularBendingFEMForceField<Rigid3Types>;
50+
template class SOFA_SHELL_API BezierTriangularBendingFEMForceField<Rigid3Types>;
5151

5252
} // namespace forcefield
5353

src/Shell/forcefield/BezierTriangularBendingFEMForceField.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
#include <sofa/core/topology/BaseMeshTopology.h>
3838
#include <sofa/core/topology/TopologyData.h>
3939

40-
#include <SofaShells/controller/MeshInterpolator.h>
41-
#include <SofaShells/engine/JoinMeshPoints.h>
40+
#include <Shell/controller/MeshInterpolator.h>
41+
#include <Shell/engine/JoinMeshPoints.h>
4242

4343

4444
// Uncomment the following to use quaternions instead of matrices for
@@ -251,13 +251,13 @@ class BezierTriangularBendingFEMForceField : public core::behavior::ForceField<D
251251

252252
// Allow transition between rest shapes
253253
SingleLink<BezierTriangularBendingFEMForceField<DataTypes>,
254-
sofa::component::controller::MeshInterpolator<DataTypes>,
254+
shell::controller::MeshInterpolator<DataTypes>,
255255
BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINK> restShape;
256256

257257
// Indirect rest shape indexing (e.g. for "joining" two meshes)
258258
bool mapTopology;
259259
SingleLink<BezierTriangularBendingFEMForceField<DataTypes>,
260-
sofa::component::engine::JoinMeshPoints<DataTypes>,
260+
shell::engine::JoinMeshPoints<DataTypes>,
261261
BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINK> topologyMapper;
262262

263263

src/Shell/forcefield/BezierTriangularBendingFEMForceField.inl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#ifndef SOFA_COMPONENT_FORCEFIELD_BEZIER_TRIANGULAR_BENDING_FEM_FORCEFIELD_INL
2626
#define SOFA_COMPONENT_FORCEFIELD_BEZIER_TRIANGULAR_BENDING_FEM_FORCEFIELD_INL
2727

28-
#include <SofaShells/forcefield/BezierTriangularBendingFEMForceField.h>
28+
#include <Shell/forcefield/BezierTriangularBendingFEMForceField.h>
2929
#include <sofa/core/behavior/ForceField.inl>
3030
#include <sofa/gl/template.h>
3131
#include <sofa/helper/rmath.h>
@@ -38,7 +38,7 @@
3838
#include <sofa/core/topology/TopologyData.inl>
3939
#include <sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.h>
4040
#include <sofa/core/visual/VisualParams.h>
41-
#include <SofaShells/controller/MeshChangedEvent.h>
41+
#include <Shell/controller/MeshChangedEvent.h>
4242

4343
#ifdef _WIN32
4444
#include <windows.h>
@@ -145,7 +145,7 @@ template <class DataTypes>void BezierTriangularBendingFEMForceField<DataTypes>::
145145

146146
if (topologyMapper.get() != nullptr)
147147
{
148-
sofa::component::engine::JoinMeshPoints<DataTypes>* jmp = topologyMapper.get();
148+
shell::engine::JoinMeshPoints<DataTypes>* jmp = topologyMapper.get();
149149
if (jmp->f_output_triangles.getValue().size() == 0)
150150
{
151151
msg_warning() << "Mapped topology must be triangular. No triangles found." ;
@@ -162,7 +162,7 @@ template <class DataTypes>void BezierTriangularBendingFEMForceField<DataTypes>::
162162
// Check if there is same number of nodes
163163
const VecCoord &rx = restShape.get()->f_position.getValue();
164164
if (!mapTopology) {
165-
if (rx.size() != this->mstate->read(sofa::core::ConstVecCoordId::position())->getValue().size()) {
165+
if (rx.size() != this->mstate->read(sofa::core::vec_id::read_access::position)->getValue().size()) {
166166
msg_warning() << "Different number of nodes in rest shape and mechanical state." ;
167167
}
168168
} else if (rx.size() != topologyMapper.get()->f_input_position.getValue().size()) {
@@ -204,7 +204,7 @@ template <class DataTypes>void BezierTriangularBendingFEMForceField<DataTypes>::
204204
// Check normal count
205205
if (normals.getValue().size() == 0) {
206206
msg_warning() << "No normals defined, assuming flat triangles." ;
207-
} else if (normals.getValue().size() != this->mstate->read(sofa::core::ConstVecCoordId::position())->getValue().size()) {
207+
} else if (normals.getValue().size() != this->mstate->read(sofa::core::vec_id::read_access::position)->getValue().size()) {
208208
msg_warning() << "Normals count doesn't correspond with nodes count." ;
209209
return;
210210
}
@@ -243,7 +243,7 @@ void BezierTriangularBendingFEMForceField<DataTypes>::initTriangleOnce(const int
243243
// Store indices of each vertex in rest shape
244244
Index a0=a, b0=b, c0=c;
245245
if (mapTopology) {
246-
sofa::component::engine::JoinMeshPoints<DataTypes>* jmp = topologyMapper.get();
246+
shell::engine::JoinMeshPoints<DataTypes>* jmp = topologyMapper.get();
247247

248248
// Get indices in original topology
249249
a0 = jmp->getSrcNodeFromTri(i, a0);
@@ -282,7 +282,7 @@ void BezierTriangularBendingFEMForceField<DataTypes>::initTriangle(const int i)
282282
// if rest shape is fixed but we have mapped topology use it
283283
? topologyMapper.get()->f_input_position.getValue()
284284
// otherwise just take rest shape in mechanical state
285-
: this->mstate->read(sofa::core::ConstVecCoordId::position())->getValue()
285+
: this->mstate->read(sofa::core::vec_id::read_access::position)->getValue()
286286
);
287287

288288
const type::vector<Vec3>& norms = (restShape.get() != nullptr)
@@ -1545,7 +1545,7 @@ void BezierTriangularBendingFEMForceField<DataTypes>::addBToMatrix(sofa::lineara
15451545
template <class DataTypes>
15461546
void BezierTriangularBendingFEMForceField<DataTypes>::handleEvent(sofa::core::objectmodel::Event *event)
15471547
{
1548-
if ( /*sofa::core::objectmodel::MeshChangedEvent* ev =*/ dynamic_cast<sofa::core::objectmodel::MeshChangedEvent*>(event))
1548+
if ( /*sofa::core::objectmodel::MeshChangedEvent* ev =*/ dynamic_cast<shell::objectmodel::MeshChangedEvent*>(event))
15491549
{
15501550
// Update of the rest shape
15511551
// NOTE: the number of triangles should be the same in all topologies
@@ -1566,7 +1566,7 @@ void BezierTriangularBendingFEMForceField<DataTypes>::draw(const core::visual::V
15661566
{
15671567

15681568
// Gets vertices of rest and initial positions respectively
1569-
const VecCoord& x0 = this->mstate->read(sofa::core::ConstVecCoordId::position())->getValue();
1569+
const VecCoord& x0 = this->mstate->read(sofa::core::vec_id::read_access::position)->getValue();
15701570

15711571

15721572
type::vector<TriangleInformation>& triangleInf = *(triangleInfo.beginEdit());

src/Shell/forcefield/CstFEMForceField.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
* Contact information: contact@sofa-framework.org *
2424
******************************************************************************/
2525

26-
#include <SofaShells/config.h>
27-
#include <SofaShells/forcefield/CstFEMForceField.inl>
26+
#include <Shell/config.h>
27+
#include <Shell/forcefield/CstFEMForceField.inl>
2828
#include <sofa/core/behavior/ForceField.inl>
2929
#include <sofa/type/Vec.h>
3030
#include <sofa/core/ObjectFactory.h>
@@ -46,7 +46,7 @@ int CstFEMForceFieldClass = core::RegisterObject("Constant Strain Triangular mem
4646
.add< CstFEMForceField<Vec3Types> >(true)
4747
;
4848

49-
template class SOFA_SHELLS_API CstFEMForceField<Vec3Types>;
49+
template class SOFA_SHELL_API CstFEMForceField<Vec3Types>;
5050

5151

5252
} // namespace forcefield

0 commit comments

Comments
 (0)