Skip to content

Commit 1b149c6

Browse files
committed
fix compilation partially
1 parent 252b6ef commit 1b149c6

8 files changed

Lines changed: 27 additions & 42 deletions

File tree

extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <Shell/config.h>
1+
#include <Shell/Adaptivity/config.h>
22
#include <Shell/Adaptivity/controller/AdaptiveCuttingController.inl>
33
#include <sofa/core/ObjectFactory.h>
44

@@ -20,20 +20,20 @@ SOFA_DECL_CLASS(AdaptiveCuttingController)
2020
int AdaptiveCuttingControllerClass = core::RegisterObject(
2121
"Controller that handles the cutting method based on mesh adaptivity.")
2222
#ifdef SOFA_FLOAT
23-
.add< AdaptiveCuttingController<defaulttype3fTypes> >(true) // default template
23+
.add< AdaptiveCuttingController<defaulttype::Vec3fTypes> >(true) // default template
2424
#else
25-
.add< AdaptiveCuttingController<defaulttype3dTypes> >(true) // default template
25+
.add< AdaptiveCuttingController<defaulttype::Vec3dTypes> >(true) // default template
2626
# ifndef SOFA_DOUBLE
27-
.add< AdaptiveCuttingController<defaulttype3fTypes> >()
27+
.add< AdaptiveCuttingController<defaulttype::Vec3fTypes> >()
2828
# endif
2929
#endif
3030
;
3131

3232
#ifndef SOFA_FLOAT
33-
template class SHELL_ADAPTIVITY_API AdaptiveCuttingController<defaulttype3dTypes>;
33+
template class SHELL_ADAPTIVITY_API AdaptiveCuttingController<defaulttype::Vec3dTypes>;
3434
#endif //SOFA_FLOAT
3535
#ifndef SOFA_DOUBLE
36-
template class SHELL_ADAPTIVITY_API AdaptiveCuttingController<defaulttype3fTypes>;
36+
template class SHELL_ADAPTIVITY_API AdaptiveCuttingController<defaulttype::Vec3fTypes>;
3737
#endif //SOFA_DOUBLE
3838

3939
} // namespace controller

extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class AdaptiveCuttingController : public Controller, public CuttingAdapter
104104
Test2DAdapter<DataTypes>* m_adapter;
105105
sofa::component::topology::container::dynamic::TriangleSetTopologyContainer* m_container;
106106
sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms<DataTypes> *m_algoGeom;
107-
sofa::component::topology::container::dynamic::TriangleSetTopologyAlgorithms<DataTypes> *m_algoTopo;
108107
sofa::core::behavior::MechanicalState<DataTypes>* m_state;
109108

110109
// TODO: This should go to cutting config (maybe?)

extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/AdaptiveCuttingController.inl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
// TODO
55
// - protect/unprotect cut edges (m_cutEdge,m_cutList)
66

7-
#include <Shell/config.h>
7+
#include <Shell/Adaptivity/config.h>
88

99
#include <float.h>
1010
#include <sofa/helper/rmath.h>
1111

1212
#include <Shell/Adaptivity/controller/AdaptiveCuttingController.h>
1313
#include <Shell/misc/PointProjection.h>
14-
#include <SofaMeshCollision/TriangleModel.h>
1514
#include <sofa/component/collision/geometry/TriangleModel.h>
1615

1716
#define OTHER(x, a, b) ((x == a) ? b : a)
@@ -76,12 +75,6 @@ void AdaptiveCuttingController<DataTypes>::init()
7675
return;
7776
}
7877

79-
this->getContext()->get(m_algoTopo);
80-
if (m_algoTopo == NULL) {
81-
msg_error() << "Unable to find TriangleSetTopologyAlgorithms";
82-
return;
83-
}
84-
8578
reinit();
8679
}
8780

@@ -118,7 +111,7 @@ void AdaptiveCuttingController<DataTypes>::onEndAnimationStep(const double /*dt*
118111
}
119112
// Then perform the incision
120113
bool bReachedBorder;
121-
m_algoTopo->InciseAlongEdgeList(m_cutList, newList, endList,
114+
m_algoGeom->InciseAlongEdgeList(m_cutList, newList, endList,
122115
bReachedBorder);
123116
//m_algoTopo->InciseAlongEdge(m_cutList[0], NULL);
124117
m_cutList.clear();
@@ -212,7 +205,7 @@ void AdaptiveCuttingController<DataTypes>::setTrackedPoint(
212205
Real d2 = (x[ e[1] ] - m_point).norm2();
213206
m_pointId = (d1 < d2 ? e[0] : e[1]);
214207
} else*/
215-
if(dynamic_cast<geometry::TriangleCollisionModel *>(picked.body)) {
208+
if(dynamic_cast<geometry::TriangleCollisionModel<DataTypes> *>(picked.body)) {
216209

217210
Index newId = InvalidID;
218211
Index newCutEdge = InvalidID;
@@ -351,7 +344,7 @@ template<class DataTypes>
351344
void AdaptiveCuttingController<DataTypes>::addCuttingPoint()
352345
{
353346
if (!m_adapter) return;
354-
if (!m_algoTopo || !m_algoGeom) return;
347+
if (!m_algoGeom) return;
355348

356349
if (m_pointId == InvalidID) {
357350
msg_error() << "BUG! Attempted cutting with no point tracked.";

extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <Shell/config.h>
1+
#include <Shell/Adaptivity/config.h>
22
#include <Shell/Adaptivity/controller/Test2DAdapter.inl>
33
#include <sofa/core/ObjectFactory.h>
44

@@ -19,20 +19,20 @@ SOFA_DECL_CLASS(Test2DAdapter)
1919
// Register in the Factory
2020
int Test2DAdapterClass = core::RegisterObject("Adaptive mesh improvement component for 2D triangular meshes (for testing)")
2121
#ifdef SOFA_FLOAT
22-
.add< Test2DAdapter<defaulttype3fTypes> >(true) // default template
22+
.add< Test2DAdapter<defaulttype::Vec3fTypes> >(true) // default template
2323
#else
24-
.add< Test2DAdapter<defaulttype3dTypes> >(true) // default template
24+
.add< Test2DAdapter<defaulttype::Vec3dTypes> >(true) // default template
2525
# ifndef SOFA_DOUBLE
26-
.add< Test2DAdapter<defaulttype3fTypes> >()
26+
.add< Test2DAdapter<defaulttype::Vec3fTypes> >()
2727
# endif
2828
#endif
2929
;
3030

3131
#ifndef SOFA_FLOAT
32-
template class SHELL_ADAPTIVITY_API Test2DAdapter<defaulttype3dTypes>;
32+
template class SHELL_ADAPTIVITY_API Test2DAdapter<defaulttype::Vec3dTypes>;
3333
#endif //SOFA_FLOAT
3434
#ifndef SOFA_DOUBLE
35-
template class SHELL_ADAPTIVITY_API Test2DAdapter<defaulttype3fTypes>;
35+
template class SHELL_ADAPTIVITY_API Test2DAdapter<defaulttype::Vec3fTypes>;
3636
#endif //SOFA_DOUBLE
3737

3838
} // namespace controller

extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ class Test2DAdapter : public Controller
334334
sofa::component::topology::container::dynamic::TriangleSetTopologyContainer* m_container;
335335
sofa::component::topology::container::dynamic::TriangleSetTopologyModifier* m_modifier;
336336
sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms<DataTypes> *m_algoGeom;
337-
sofa::component::topology::container::dynamic::TriangleSetTopologyAlgorithms<DataTypes> *m_algoTopo;
338337
sofa::core::behavior::MechanicalState<DataTypes>* m_state;
339338

340339
/// List of nodes that have to be rechecked if they are on the boundry.
@@ -437,10 +436,10 @@ class Test2DAdapter : public Controller
437436

438437
protected:
439438

440-
topology::PointData< sofa::type::vector<PointInformation> > pointInfo;
439+
sofa::core::topology::PointData< sofa::type::vector<PointInformation> > pointInfo;
441440
PointInfoHandler* pointHandler;
442441

443-
topology::TriangleData< sofa::type::vector<TriangleInformation> > triInfo;
442+
sofa::core::topology::TriangleData< sofa::type::vector<TriangleInformation> > triInfo;
444443
TriangleInfoHandler* triHandler;
445444

446445
};

extensions/Shell.Adaptivity/src/Shell/Adaptivity/controller/Test2DAdapter.inl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#ifndef SOFA_COMPONENT_CONTROLLER_TEST2DADAPTER_INL
3939
#define SOFA_COMPONENT_CONTROLLER_TEST2DADAPTER_INL
4040

41-
#include <Shell/config.h>
41+
#include <Shell/Adaptivity/config.h>
4242

4343
#include <map>
4444
#include <float.h>
@@ -255,12 +255,6 @@ void Test2DAdapter<DataTypes>::init()
255255
return;
256256
}
257257

258-
this->getContext()->get(m_algoTopo);
259-
if (m_algoTopo == NULL) {
260-
msg_error() << "Unable to find TriangleSetTopologyAlgorithms" ;
261-
return;
262-
}
263-
264258
pointInfo.createTopologicalEngine(m_container, pointHandler);
265259
pointInfo.registerTopologicalData();
266260

extensions/Shell.Adaptivity/src/Shell/Adaptivity/cutting/AdaptiveCutting.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ namespace collision
3434
#ifndef SOFA_DOUBLE
3535
helper::Creator<
3636
InteractionPerformer::InteractionPerformerFactory,
37-
AdaptiveCuttingPerformer<defaulttype3fTypes> >
37+
AdaptiveCuttingPerformer<defaulttype::Vec3fTypes> >
3838
AdaptiveCuttingPerformerVec3fClass("AdaptiveCutting", true);
3939
#endif
4040
#ifndef SOFA_FLOAT
4141
helper::Creator<gui::component::performer::InteractionPerformer::InteractionPerformerFactory,
42-
AdaptiveCuttingPerformer<defaulttype3dTypes> >
42+
AdaptiveCuttingPerformer<defaulttype::Vec3dTypes> >
4343
AdaptiveCuttingPerformerVec3dClass("AdaptiveCutting", true);
4444
#endif
4545

@@ -62,7 +62,7 @@ template class SHELL_ADAPTIVITY_API AdaptiveCuttingPerformer<defaulttype::Vec3d
6262
namespace gui
6363
{
6464

65-
int AdaptiveCuttingOperationReg = sofa::gui::RegisterOperation("AdaptiveCutting")
65+
int AdaptiveCuttingOperationReg = sofa::gui::common::RegisterOperation("AdaptiveCutting")
6666
.add< AdaptiveCuttingOperation >();
6767

6868
void AdaptiveCuttingOperation::start()
@@ -90,7 +90,7 @@ void AdaptiveCuttingOperation::wait()
9090
{
9191
// Update the position in the adaptivity component
9292
if (!pickHandle) return;
93-
sofa::component::collision::BodyPicked *picked = pickHandle->getLastPicked();
93+
sofa::gui::component::performer::BodyPicked *picked = pickHandle->getLastPicked();
9494
if (!picked) return;
9595

9696
CuttingAdapter *ca = getAdapter();
@@ -99,14 +99,14 @@ void AdaptiveCuttingOperation::wait()
9999
}
100100
}
101101

102-
component::controller::CuttingAdapter* AdaptiveCuttingOperation::getAdapter()
102+
sofa::component::controller::CuttingAdapter* AdaptiveCuttingOperation::getAdapter()
103103
{
104104
if (!pickHandle) return NULL;
105105

106-
sofa::component::collision::BodyPicked *picked = pickHandle->getLastPicked();
106+
sofa::gui::component::performer::BodyPicked *picked = pickHandle->getLastPicked();
107107
if (!picked) return NULL;
108108

109-
component::controller::CuttingAdapter *ca = NULL;
109+
sofa::component::controller::CuttingAdapter *ca = NULL;
110110
if (picked->body) {
111111
if (!picked->body->getContext()) std::cout << "no context!\n";
112112
picked->body->getContext()->get(ca);

extensions/Shell.Adaptivity/src/Shell/Adaptivity/misc/Optimize2DSurface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ template class SHELL_ADAPTIVITY_API Optimize2DSurface<defaulttype::Vec3dTypes>;
1515
#endif //SOFA_FLOAT
1616
#ifndef SOFA_DOUBLE
1717
//template class SHELL_ADAPTIVITY_API Optimize2DSurface<float>;
18-
template class SHELL_ADAPTIVITY_API Optimize2DSurface<defaulttype3fTypes>;
18+
template class SHELL_ADAPTIVITY_API Optimize2DSurface<defaulttype::Vec3fTypes>;
1919
#endif //SOFA_DOUBLE
2020

2121
}

0 commit comments

Comments
 (0)