Skip to content

Commit 86309b6

Browse files
committed
Add test and toolbox from image plugin
1 parent 04a9bb4 commit 86309b6

File tree

14 files changed

+142
-83
lines changed

14 files changed

+142
-83
lines changed

applications/plugins/image/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#cmakedefine01 IMAGE_HAVE_FREENECT
3333
#cmakedefine01 IMAGE_HAVE_SOFA_GL
3434

35+
#cmakedefine SOFA_BUILD_TESTS
36+
#cmakedefine PLUGIN_IMAGE_COMPILE_GUI
37+
3538
#define PLUGIN_IMAGE_COMPILE_SET_NONE 0
3639
#define PLUGIN_IMAGE_COMPILE_SET_STANDARD 1
3740
#define PLUGIN_IMAGE_COMPILE_SET_FULL 2

applications/plugins/image/image_test/TestImageEngine.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ namespace engine
3333
{
3434
using namespace sofa::defaulttype;
3535

36-
int TestImageEngineClass = core::RegisterObject("TestImageEngine to test engine with data image")
37-
36+
void registerTestImageEngine(sofa::core::ObjectFactory* factory)
37+
{
38+
factory->registerObjects(sofa::core::ObjectRegistrationData("TestImageEngine to test engine with data image")
3839
.add<TestImageEngine<ImageUC> >(true)
3940
.add<TestImageEngine<ImageD> >()
4041
#ifdef BUILD_ALL_IMAGE_TYPES
@@ -48,7 +49,9 @@ int TestImageEngineClass = core::RegisterObject("TestImageEngine to test engine
4849
.add<TestImageEngine<ImageF> >()
4950
.add<TestImageEngine<ImageB> >()
5051
#endif
51-
;
52+
);
53+
}
54+
5255

5356
template class TestImageEngine<ImageUC>;
5457
template class TestImageEngine<ImageD>;

applications/plugins/image/imagetoolbox/contour/contourimagetoolbox.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ namespace component
1616
namespace engine
1717
{
1818

19-
int ContourImageToolBox_Class = core::RegisterObject("ContourImageToolBox")
19+
void registerContourImageToolBox(sofa::core::ObjectFactory* factory)
20+
{
21+
factory->registerObjects(sofa::core::ObjectRegistrationData("ContourImageToolBox")
2022
.add<ContourImageToolBox<ImageUC> >()
2123
.add<ContourImageToolBox<ImageD> >(true)
2224
#if PLUGIN_IMAGE_COMPILE_SET == PLUGIN_IMAGE_COMPILE_SET_FULL
@@ -31,7 +33,9 @@ int ContourImageToolBox_Class = core::RegisterObject("ContourImageToolBox")
3133
.add<ContourImageToolBox<ImageB> >()
3234
#endif
3335
.addLicense("LGPL")
34-
.addAuthor("Vincent Majorczyk");
36+
.addAuthor("Vincent Majorczyk")
37+
);
38+
}
3539

3640
template class SOFA_IMAGE_GUI_API ContourImageToolBox<ImageUC>;
3741
template class SOFA_IMAGE_GUI_API ContourImageToolBox<ImageD>;

applications/plugins/image/imagetoolbox/depth/averagecatchallvector.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,29 @@ namespace engine
3333

3434
using namespace defaulttype;
3535

36-
int AverageCatchAllVectorClass = core::RegisterObject("AverageCatchAllVector")
36+
void registerAverageCatchAllVector(sofa::core::ObjectFactory* factory)
37+
{
38+
factory->registerObjects(sofa::core::ObjectRegistrationData("AverageCatchAllVector")
3739
.add<AverageCatchAllVector<float > >(true)
38-
//.add<AverageCatchAllVector<unsigned float> >()
3940
.add<AverageCatchAllVector<short > >()
4041
.add<AverageCatchAllVector<unsigned short > >()
4142
.add<AverageCatchAllVector<int > >()
4243
.add<AverageCatchAllVector<unsigned int > >()
4344
.add<AverageCatchAllVector<double > >()
44-
//.add<AverageCatchAllVector<unsigned double> >()
4545
.add<AverageCatchAllVector<long > >()
4646
.add<AverageCatchAllVector<unsigned long > >()
4747
.add<AverageCatchAllVector<bool > >()
4848
.add<AverageCatchAllVector<sofa::type::Vec3f> >()
4949
.add<AverageCatchAllVector<sofa::type::Vec3d> >()
50-
;
50+
);
51+
}
5152

5253
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<float >;
53-
//template class SOFA_IMAGE_API AverageCatchAllVector<unsigned float >;
5454
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<short >;
5555
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<unsigned short >;
5656
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<int >;
5757
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<unsigned int >;
5858
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<double >;
59-
//template class SOFA_IMAGE_API AverageCatchAllVector<unsigned double >;
6059
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<long >;
6160
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<unsigned long >;
6261
template class SOFA_IMAGE_GUI_API AverageCatchAllVector<bool >;

applications/plugins/image/imagetoolbox/depth/catchallvector.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,37 @@ namespace engine
3434

3535
using namespace defaulttype;
3636

37-
int CatchAllVectorClass = core::RegisterObject("CatchAllVector")
37+
void registerCatchAllVector(sofa::core::ObjectFactory* factory)
38+
{
39+
factory->registerObjects(sofa::core::ObjectRegistrationData("CatchAllVector")
3840
.add<CatchAllVector<float > >(true)
39-
//.add<CatchAllVector<unsigned float> >()
4041
.add<CatchAllVector<short > >()
4142
.add<CatchAllVector<unsigned short > >()
4243
.add<CatchAllVector<int > >()
4344
.add<CatchAllVector<unsigned int > >()
4445
.add<CatchAllVector<double > >()
45-
//.add<CatchAllVector<unsigned double> >()
4646
.add<CatchAllVector<long > >()
4747
.add<CatchAllVector<unsigned long > >()
4848
.add<CatchAllVector<bool > >()
4949
.add<CatchAllVector<sofa::type::Vec3f> >()
5050
.add<CatchAllVector<sofa::type::Vec3d> >()
51-
;
51+
);
52+
}
53+
5254

5355
template class SOFA_IMAGE_GUI_API CatchAllVector<float >;
54-
//template class SOFA_IMAGE_GUI_API CatchAllVector<unsigned float >;
5556
template class SOFA_IMAGE_GUI_API CatchAllVector<short >;
5657
template class SOFA_IMAGE_GUI_API CatchAllVector<unsigned short >;
5758
template class SOFA_IMAGE_GUI_API CatchAllVector<int >;
5859
template class SOFA_IMAGE_GUI_API CatchAllVector<unsigned int >;
5960
template class SOFA_IMAGE_GUI_API CatchAllVector<double >;
60-
//template class SOFA_IMAGE_GUI_API CatchAllVector<unsigned double >;
6161
template class SOFA_IMAGE_GUI_API CatchAllVector<long >;
6262
template class SOFA_IMAGE_GUI_API CatchAllVector<unsigned long >;
6363
template class SOFA_IMAGE_GUI_API CatchAllVector<bool >;
6464
template class SOFA_IMAGE_GUI_API CatchAllVector<sofa::type::Vec3f >;
6565
template class SOFA_IMAGE_GUI_API CatchAllVector<sofa::type::Vec3d >;
6666

6767

68-
69-
7068
} //
7169
} // namespace component
7270
} // namespace sofa

applications/plugins/image/imagetoolbox/depth/depthimagetoolbox.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ namespace component
1818
namespace engine
1919
{
2020

21-
int DepthImageToolBox_Class = core::RegisterObject("DepthImageToolBox")
22-
.add< DepthImageToolBox >()
23-
.addLicense("LGPL")
24-
.addAuthor("Vincent Majorczyk");
21+
void registerDepthImageToolBox(sofa::core::ObjectFactory* factory)
22+
{
23+
factory->registerObjects(sofa::core::ObjectRegistrationData("DepthImageToolBox")
24+
.add< DepthImageToolBox >()
25+
.addLicense("LGPL")
26+
.addAuthor("Vincent Majorczyk")
27+
);
28+
}
2529

2630
}}}
2731

applications/plugins/image/imagetoolbox/depth/mergedcatchallvector.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,29 @@ namespace engine
3434

3535
using namespace defaulttype;
3636

37-
int MergedCatchAllVectorClass = core::RegisterObject("MergedCatchAllVector")
37+
void registerMergedCatchAllVector(sofa::core::ObjectFactory* factory)
38+
{
39+
factory->registerObjects(sofa::core::ObjectRegistrationData("MergedCatchAllVector")
3840
.add<MergedCatchAllVector<float > >(true)
39-
//.add<MergedCatchAllVector<unsigned float> >()
4041
.add<MergedCatchAllVector<short > >()
4142
.add<MergedCatchAllVector<unsigned short > >()
4243
.add<MergedCatchAllVector<int > >()
4344
.add<MergedCatchAllVector<unsigned int > >()
4445
.add<MergedCatchAllVector<double > >()
45-
//.add<MergedCatchAllVector<unsigned double> >()
4646
.add<MergedCatchAllVector<long > >()
4747
.add<MergedCatchAllVector<unsigned long > >()
4848
.add<MergedCatchAllVector<bool > >()
4949
.add<MergedCatchAllVector<sofa::type::Vec3f> >()
5050
.add<MergedCatchAllVector<sofa::type::Vec3d> >()
51-
;
51+
);
52+
}
5253

5354
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<float >;
54-
//template class SOFA_IMAGE_GUI_API MergedCatchAllVector<unsigned float >;
5555
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<short >;
5656
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<unsigned short >;
5757
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<int >;
5858
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<unsigned int >;
5959
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<double >;
60-
//template class SOFA_IMAGE_GUI_API MergedCatchAllVector<unsigned double >;
6160
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<long >;
6261
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<unsigned long >;
6362
template class SOFA_IMAGE_GUI_API MergedCatchAllVector<bool >;

applications/plugins/image/imagetoolbox/labelbox/labelboximagetoolbox.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ namespace component
1313
namespace engine
1414
{
1515

16-
int LabelBoxImageToolBox_Class = core::RegisterObject("LabelBoxImageToolBox")
17-
.add< LabelBoxImageToolBox >()
18-
.addLicense("LGPL")
19-
.addAuthor("Vincent Majorczyk");
16+
void registerLabelBoxImageToolBox(sofa::core::ObjectFactory* factory)
17+
{
18+
factory->registerObjects(sofa::core::ObjectRegistrationData("LabelBoxImageToolBox")
19+
.add< LabelBoxImageToolBox >()
20+
.addLicense("LGPL")
21+
.addAuthor("Vincent Majorczyk")
22+
);
23+
}
2024

2125
}}}
2226

applications/plugins/image/imagetoolbox/labelgrid/labelgridimagetoolbox.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,26 @@ namespace engine
1919

2020
using namespace sofa::defaulttype;
2121

22-
int LabelGridImageToolBox_Class = core::RegisterObject("LabelGridImageToolBox")
23-
.add<LabelGridImageToolBox<ImageUC> >()
24-
.add<LabelGridImageToolBox<ImageD> >(true)
22+
void registerLabelGridImageToolBox(sofa::core::ObjectFactory* factory)
23+
{
24+
factory->registerObjects(sofa::core::ObjectRegistrationData("LabelGridImageToolBox")
25+
.add<LabelGridImageToolBox<ImageUC> >()
26+
.add<LabelGridImageToolBox<ImageD> >(true)
2527
#if PLUGIN_IMAGE_COMPILE_SET == PLUGIN_IMAGE_COMPILE_SET_FULL
26-
.add<LabelGridImageToolBox<ImageC> >()
27-
.add<LabelGridImageToolBox<ImageI> >()
28-
.add<LabelGridImageToolBox<ImageUI> >()
29-
.add<LabelGridImageToolBox<ImageS> >()
30-
.add<LabelGridImageToolBox<ImageUS> >()
31-
.add<LabelGridImageToolBox<ImageL> >()
32-
.add<LabelGridImageToolBox<ImageUL> >()
33-
.add<LabelGridImageToolBox<ImageF> >()
34-
.add<LabelGridImageToolBox<ImageB> >()
28+
.add<LabelGridImageToolBox<ImageC> >()
29+
.add<LabelGridImageToolBox<ImageI> >()
30+
.add<LabelGridImageToolBox<ImageUI> >()
31+
.add<LabelGridImageToolBox<ImageS> >()
32+
.add<LabelGridImageToolBox<ImageUS> >()
33+
.add<LabelGridImageToolBox<ImageL> >()
34+
.add<LabelGridImageToolBox<ImageUL> >()
35+
.add<LabelGridImageToolBox<ImageF> >()
36+
.add<LabelGridImageToolBox<ImageB> >()
3537
#endif
3638
.addLicense("LGPL")
37-
.addAuthor("Vincent Majorczyk");
39+
.addAuthor("Vincent Majorczyk")
40+
);
41+
}
3842

3943
template class SOFA_IMAGE_GUI_API LabelGridImageToolBox<ImageUC>;
4044
template class SOFA_IMAGE_GUI_API LabelGridImageToolBox<ImageD>;

applications/plugins/image/imagetoolbox/labelpoint/labelpointimagetoolbox.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ namespace component
1313
namespace engine
1414
{
1515

16-
int LabelPointImageToolBox_Class = core::RegisterObject("LabelPointImageToolBox")
17-
.add< LabelPointImageToolBox >()
18-
.addLicense("LGPL")
19-
.addAuthor("Vincent Majorczyk");
16+
void registerLabelPointImageToolBox(sofa::core::ObjectFactory* factory)
17+
{
18+
factory->registerObjects(sofa::core::ObjectRegistrationData("LabelPointImageToolBox")
19+
.add< LabelPointImageToolBox >()
20+
.addLicense("LGPL")
21+
.addAuthor("Vincent Majorczyk")
22+
);
23+
}
2024

2125
}}}
2226

0 commit comments

Comments
 (0)