44// TODO
55// - protect/unprotect cut edges (m_cutEdge,m_cutList)
66
7- #include < SofaShells /config.h>
7+ #include < Shell /config.h>
88
99#include < float.h>
1010#include < sofa/helper/rmath.h>
1111
12- #include < SofaShells/misc/PointProjection .h>
13- #include < SofaShells/controller/AdaptiveCuttingController .h>
12+ #include < Shell/Adaptivity/controller/AdaptiveCuttingController .h>
13+ #include < Shell/misc/PointProjection .h>
1414#include < SofaMeshCollision/TriangleModel.h>
15+ #include < sofa/component/collision/geometry/TriangleModel.h>
1516
1617#define OTHER (x, a, b ) ((x == a) ? b : a)
1718
@@ -105,7 +106,7 @@ void AdaptiveCuttingController<DataTypes>::onEndAnimationStep(const double /*dt*
105106 if (m_gracePeriod > 0 ) m_gracePeriod--;
106107
107108 const VecCoord& x0 = m_state->read (
108- sofa::core::ConstVecCoordId:: restPosition () )->getValue ();
109+ sofa::core::vec_id::read_access:: restPosition)->getValue ();
109110
110111 // Perform the (delayed) cutting
111112 if ((m_cutList.size () > 0 ) && (m_cutPoints > 2 ) ) {
@@ -161,10 +162,10 @@ void AdaptiveCuttingController<DataTypes>::draw(
161162 return ;
162163
163164 if (!m_state) return ;
164- const VecCoord& x = m_state->read (sofa::core::ConstVecCoordId:: position () )->getValue ();
165+ const VecCoord& x = m_state->read (sofa::core::vec_id::read_access:: position)->getValue ();
165166
166167 if (m_cutList.size () > 0 ) {
167- type::vector<type::Vector3 > points;
168+ type::vector<type::Vec3 > points;
168169 for (VecIndex::const_iterator i=m_cutList.begin ();
169170 i != m_cutList.end (); i++) {
170171 const Edge &e = m_container->getEdge (*i);
@@ -177,7 +178,7 @@ void AdaptiveCuttingController<DataTypes>::draw(
177178
178179 if (m_cutEdge != InvalidID) {
179180 const Edge &e = m_container->getEdge (m_cutEdge);
180- type::vector<type::Vector3 > points;
181+ type::vector<type::Vec3 > points;
181182 points.push_back (x[ e[0 ] ]);
182183 points.push_back (x[ e[1 ] ]);
183184 vparams->drawTool ()->drawLines (points, 4 ,
@@ -188,16 +189,16 @@ void AdaptiveCuttingController<DataTypes>::draw(
188189
189190template <class DataTypes >
190191void AdaptiveCuttingController<DataTypes>::setTrackedPoint(
191- const collision ::BodyPicked &picked)
192+ const sofa::gui::component::performer ::BodyPicked &picked)
192193{
193194 if (!m_adapter) return ;
194195
195196 using namespace sofa ::component::collision;
196197
197198 // const VecCoord& x0 = m_state->read(
198- // sofa::core::ConstVecCoordId:: restPosition() )->getValue();
199+ // sofa::core::vec_id::read_access:: restPosition)->getValue();
199200 const VecCoord& x = m_state->read (
200- sofa::core::ConstVecCoordId:: position () )->getValue ();
201+ sofa::core::vec_id::read_access:: position)->getValue ();
201202
202203
203204 // Support only trianglular model! The others don't give any added value.
@@ -211,7 +212,7 @@ void AdaptiveCuttingController<DataTypes>::setTrackedPoint(
211212 Real d2 = (x[ e[1] ] - m_point).norm2();
212213 m_pointId = (d1 < d2 ? e[0] : e[1]);
213214 } else*/
214- if (dynamic_cast <TriangleModel *>(picked.body )) {
215+ if (dynamic_cast <geometry::TriangleCollisionModel *>(picked.body )) {
215216
216217 Index newId = InvalidID;
217218 Index newCutEdge = InvalidID;
@@ -358,9 +359,9 @@ void AdaptiveCuttingController<DataTypes>::addCuttingPoint()
358359 }
359360
360361 const VecCoord& x = m_state->read (
361- sofa::core::ConstVecCoordId:: position () )->getValue ();
362+ sofa::core::vec_id::read_access:: position)->getValue ();
362363 // const VecCoord& xrest = m_state->read(
363- // sofa::core::ConstVecCoordId:: restPosition() )->getValue();
364+ // sofa::core::vec_id::read_access:: restPosition)->getValue();
364365 Coord oldpos = x[m_pointId];
365366
366367 bool bFirst = !cutting ();
0 commit comments