2626 DEALINGS IN THE SOFTWARE.
2727*/
2828
29- #include < Application/Filters/Actions/ActionRadialBasisFunction .h>
29+ #include < Application/Filters/Actions/ActionImplicitModel .h>
3030
3131#include < Application/Filters/LayerFilter.h>
3232#include < Application/Filters/Actions/ActionThreshold.h>
5454#include < ScatteredData.h>
5555#include < vec3.h>
5656
57- CORE_REGISTER_ACTION ( RadialBasisFunction, RadialBasisFunction )
57+ CORE_REGISTER_ACTION ( ImplicitModel, ImplicitModel )
5858
59- namespace RadialBasisFunction
59+ namespace ImplicitModel
6060{
6161
62- typedef boost::shared_ptr< ActionRadialBasisFunction > ActionRadialBasisFunctionHandle ;
62+ typedef boost::shared_ptr< ActionImplicitModel > ActionImplicitModelHandle ;
6363
6464using namespace ::Seg3D;
6565using namespace ::Core;
@@ -73,15 +73,15 @@ class NotifierRunnable : public Runnable, public ConnectionHandler
7373 std::string layerID_;
7474 ActionContextHandle layerContext_;
7575 NotifierHandle notifier_;
76- ActionRadialBasisFunctionHandle action_;
76+ ActionImplicitModelHandle action_;
7777
78- NotifierRunnable (const std::string& layerID, ActionContextHandle& layerContext, ActionRadialBasisFunctionHandle action) :
78+ NotifierRunnable (const std::string& layerID, ActionContextHandle& layerContext, ActionImplicitModelHandle action) :
7979 layerID_ (layerID),
8080 layerContext_ (layerContext),
8181 action_ (action)
8282 {
8383 this ->add_connection (
84- this ->runThresholdSignal_ .connect ( boost::bind (&ActionRadialBasisFunction ::run_threshold, action_, _1) ) );
84+ this ->runThresholdSignal_ .connect ( boost::bind (&ActionImplicitModel ::run_threshold, action_, _1) ) );
8585 }
8686
8787 ~NotifierRunnable ()
@@ -99,10 +99,10 @@ class NotifierRunnable : public Runnable, public ConnectionHandler
9999 }
100100};
101101
102- class ActionRadialBasisFunctionPrivate
102+ class ActionImplicitModelPrivate
103103{
104104public:
105- ActionRadialBasisFunctionPrivate () :
105+ ActionImplicitModelPrivate () :
106106 normalOffset_ (0 ),
107107 compute2DConvexHull_ (true ),
108108 invertSeedOrder_ (false ),
@@ -120,24 +120,24 @@ class ActionRadialBasisFunctionPrivate
120120 double thresholdValue_;
121121};
122122
123- class RadialBasisFunctionAlgo : public LayerFilter
123+ class ImplicitModelAlgo : public LayerFilter
124124{
125125public:
126- ActionRadialBasisFunctionPrivateHandle actionInternal_;
126+ ActionImplicitModelPrivateHandle actionInternal_;
127127
128- RadialBasisFunctionAlgo ();
129- virtual ~RadialBasisFunctionAlgo ();
128+ ImplicitModelAlgo ();
129+ virtual ~ImplicitModelAlgo ();
130130
131131 SCI_BEGIN_RUN ()
132132 {
133133 DataLayerHandle srcDataLayer = boost::dynamic_pointer_cast<DataLayer>(this ->actionInternal_ ->srcLayer_ );
134134 DataLayerHandle dstDataLayer = boost::dynamic_pointer_cast<DataLayer>(this ->actionInternal_ ->dstLayer_ );
135135 GridTransform srcGridTransform = srcDataLayer->get_grid_transform ();
136136
137- std::vector<vec3> rbfPointData ;
137+ std::vector<vec3> modelPointData ;
138138 for ( auto &vertex : this ->actionInternal_ ->vertices_ )
139139 {
140- rbfPointData .push_back ( vec3 (vertex.x (), vertex.y (), vertex.z ()) );
140+ modelPointData .push_back ( vec3 (vertex.x (), vertex.y (), vertex.z ()) );
141141 }
142142
143143 std::vector<axis_t > axisData;
@@ -164,12 +164,11 @@ class RadialBasisFunctionAlgo : public LayerFilter
164164 }
165165 }
166166
167-
168167 // origin and size from source data layer
169168 Point origin = srcGridTransform.get_origin ();
170- vec3 rbfOrigin (origin.x (), origin.y (), origin.z ());
171- vec3 rbfGridSize (srcGridTransform.get_nx (), srcGridTransform.get_ny (), srcGridTransform.get_nz ());
172- vec3 rbfGridSpacing (srcGridTransform.spacing_x (), srcGridTransform.spacing_y (), srcGridTransform.spacing_z ());
169+ vec3 modelOrigin (origin.x (), origin.y (), origin.z ());
170+ vec3 modelGridSize (srcGridTransform.get_nx (), srcGridTransform.get_ny (), srcGridTransform.get_nz ());
171+ vec3 modelGridSpacing (srcGridTransform.spacing_x (), srcGridTransform.spacing_y (), srcGridTransform.spacing_z ());
173172
174173 // From RBF class. ThinPlate is the default kernel.
175174 Kernel kernel = ThinPlate;
@@ -182,12 +181,12 @@ class RadialBasisFunctionAlgo : public LayerFilter
182181 kernel = MultiQuadratic;
183182 }
184183
185- RBFInterface rbfAlgo ( rbfPointData, rbfOrigin, rbfGridSize, rbfGridSpacing ,
184+ RBFInterface modelAlgo ( modelPointData, modelOrigin, modelGridSize, modelGridSpacing ,
186185 this ->actionInternal_ ->normalOffset_ , axisData,
187186 this ->actionInternal_ ->compute2DConvexHull_ ,
188187 this ->actionInternal_ ->invertSeedOrder_ , kernel );
189188
190- this ->actionInternal_ ->thresholdValue_ = rbfAlgo .getThresholdValue ();
189+ this ->actionInternal_ ->thresholdValue_ = modelAlgo .getThresholdValue ();
191190
192191 Core::DataBlockHandle dstDataBlock = Core::StdDataBlock::New ( srcGridTransform, Core::DataType::DOUBLE_E );
193192 if ( ! dstDataBlock )
@@ -196,7 +195,7 @@ class RadialBasisFunctionAlgo : public LayerFilter
196195 return ;
197196 }
198197
199- const DataStorage rasterData = rbfAlgo .getRasterData ();
198+ const DataStorage rasterData = modelAlgo .getRasterData ();
200199 for (size_t i = 0 ; i < dstDataBlock->get_nx (); ++i)
201200 {
202201 for (size_t j = 0 ; j < dstDataBlock->get_ny (); ++j)
@@ -222,28 +221,28 @@ class RadialBasisFunctionAlgo : public LayerFilter
222221 // The name of the filter, this information is used for generating new layer labels.
223222 virtual std::string get_filter_name () const
224223 {
225- return " RadialBasisFunction Tool" ;
224+ return " ImplicitModel Tool" ;
226225 }
227226
228227 // GET_LAYER_PREFIX:
229228 // This function returns the name of the filter. The latter is prepended to the new layer name,
230229 // when a new layer is generated.
231230 virtual std::string get_layer_prefix () const
232231 {
233- return " RadialBasisFunction " ;
232+ return " ImplicitModel " ;
234233 }
235234};
236235
237- RadialBasisFunctionAlgo::RadialBasisFunctionAlgo ()
236+ ImplicitModelAlgo::ImplicitModelAlgo ()
238237{
239238}
240239
241- RadialBasisFunctionAlgo ::~RadialBasisFunctionAlgo ()
240+ ImplicitModelAlgo ::~ImplicitModelAlgo ()
242241{
243242}
244243
245- ActionRadialBasisFunction::ActionRadialBasisFunction () :
246- private_ ( new ActionRadialBasisFunctionPrivate )
244+ ActionImplicitModel::ActionImplicitModel () :
245+ private_ ( new ActionImplicitModelPrivate )
247246
248247{
249248 this ->add_layer_id ( this ->private_ ->targetLayerID_ );
@@ -256,7 +255,7 @@ ActionRadialBasisFunction::ActionRadialBasisFunction() :
256255 this ->add_parameter ( this ->sandbox_ );
257256}
258257
259- bool ActionRadialBasisFunction ::validate ( ActionContextHandle& context )
258+ bool ActionImplicitModel ::validate ( ActionContextHandle& context )
260259{
261260 if (this ->private_ ->vertices_ .size () < 3 )
262261 {
@@ -282,9 +281,9 @@ bool ActionRadialBasisFunction::validate( ActionContextHandle& context )
282281 return true ;
283282}
284283
285- bool ActionRadialBasisFunction ::run ( ActionContextHandle& context, ActionResultHandle& result )
284+ bool ActionImplicitModel ::run ( ActionContextHandle& context, ActionResultHandle& result )
286285{
287- boost::shared_ptr< RadialBasisFunctionAlgo > algo ( new RadialBasisFunctionAlgo () );
286+ boost::shared_ptr< ImplicitModelAlgo > algo ( new ImplicitModelAlgo () );
288287
289288 // Set up parameters
290289 algo->set_sandbox ( this ->sandbox_ );
@@ -327,14 +326,14 @@ bool ActionRadialBasisFunction::run( ActionContextHandle& context, ActionResultH
327326 NotifierRunnableHandle notifierThread_ (
328327 new NotifierRunnable ( this ->private_ ->dstLayer_ ->get_layer_id (),
329328 layerContext,
330- boost::dynamic_pointer_cast< ActionRadialBasisFunction >(this ->shared_from_this ()) ) );
329+ boost::dynamic_pointer_cast< ActionImplicitModel >(this ->shared_from_this ()) ) );
331330 Runnable::Start ( notifierThread_ );
332331 }
333332
334333 return true ;
335334}
336335
337- bool ActionRadialBasisFunction ::run_threshold ( ActionContextHandle& context )
336+ bool ActionImplicitModel ::run_threshold ( ActionContextHandle& context )
338337{
339338 DataLayerHandle dstDataLayer = boost::dynamic_pointer_cast<DataLayer>( this ->private_ ->dstLayer_ );
340339 double dstMaxValue = dstDataLayer->get_data_volume ()->get_data_block ()->get_max ();
@@ -346,18 +345,18 @@ bool ActionRadialBasisFunction::run_threshold( ActionContextHandle& context )
346345 return true ;
347346}
348347
349- void ActionRadialBasisFunction ::Dispatch (
350- ActionContextHandle context,
351- const std::string& target,
352- const VertexList& vertices,
353- const ViewModeList& viewModes,
354- double normalOffset,
355- bool compute2DConvexHull,
356- bool invertSeedOrder,
357- const std::string& kernel
358- )
348+ void ActionImplicitModel ::Dispatch (
349+ ActionContextHandle context,
350+ const std::string& target,
351+ const VertexList& vertices,
352+ const ViewModeList& viewModes,
353+ double normalOffset,
354+ bool compute2DConvexHull,
355+ bool invertSeedOrder,
356+ const std::string& kernel
357+ )
359358{
360- ActionRadialBasisFunction * action = new ActionRadialBasisFunction ;
359+ ActionImplicitModel * action = new ActionImplicitModel ;
361360 action->private_ ->targetLayerID_ = target;
362361 action->private_ ->vertices_ = vertices;
363362 action->private_ ->view_modes_ = viewModes;
0 commit comments