Ignore:
Timestamp:
11/16/15 16:21:45 (8 years ago)
Author:
rlacroix
Message:

Add a new field attribute grid_path to allow chaining spatial transformations.

Intermediate grids must be separated by comma and the source/destination grids must not be listed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/filter/spatial_transform_filter.cpp

    r709 r790  
    1818            "Impossible to build the filter graph if either the source or the destination grid are null."); 
    1919 
    20     // TODO: Implement the real path finding algorithm after a solution has been found 
    21     //       to support initializing grid transformations during parsing. 
    22     CSpatialTransformFilterEngine* engine = CSpatialTransformFilterEngine::get(destGrid->getTransformations()); 
    23     boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine)); 
     20    boost::shared_ptr<CSpatialTransformFilter> firstFilter, lastFilter; 
     21    // Note that this loop goes from the last transformation to the first transformation 
     22    do 
     23    { 
     24      CGridTransformation* gridTransformation = destGrid->getTransformations(); 
     25      CSpatialTransformFilterEngine* engine = CSpatialTransformFilterEngine::get(destGrid->getTransformations()); 
     26      boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine)); 
    2427 
    25     return std::make_pair(filter, filter); 
     28      if (!lastFilter) 
     29        lastFilter = filter; 
     30      else 
     31        filter->connectOutput(firstFilter, 0); 
     32 
     33      firstFilter = filter; 
     34      destGrid = gridTransformation->getGridSource(); 
     35    } 
     36    while (destGrid != srcGrid); 
     37 
     38    return std::make_pair(firstFilter, lastFilter); 
    2639  } 
    2740 
Note: See TracChangeset for help on using the changeset viewer.