Skip to content

Commit

Permalink
Separate FeatureStyleSorter into its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Jan 7, 2025
1 parent 1664e86 commit bb525fc
Show file tree
Hide file tree
Showing 8 changed files with 420 additions and 376 deletions.
2 changes: 2 additions & 0 deletions src/osgEarth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ SET(TARGET_H
FeatureSDFLayer
FeatureSource
FeatureSourceIndexNode
FeatureStyleSorter
FileUtils
Fill
Filter
Expand Down Expand Up @@ -564,6 +565,7 @@ set(TARGET_SRC
FeatureSDFLayer.cpp
FeatureSource.cpp
FeatureSourceIndexNode.cpp
FeatureStyleSorter.cpp
FileGDBFeatureSource.cpp
FileUtils.cpp
Fill.cpp
Expand Down
1 change: 1 addition & 0 deletions src/osgEarth/FeatureImageLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <osgEarth/Progress>
#include <osgEarth/LandCover>
#include <osgEarth/Metrics>
#include <osgEarth/FeatureStyleSorter>

using namespace osgEarth;

Expand Down
63 changes: 1 addition & 62 deletions src/osgEarth/FeatureRasterizer
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef OSGEARTH_FEATURE_RASTERIZER
#define OSGEARTH_FEATURE_RASTERIZER 1
#pragma once

#include <osgEarth/StyleSheet>
#include <osgEarth/Session>
Expand Down Expand Up @@ -102,65 +101,5 @@ namespace osgEarth
const FeatureProfile* profile,
const StyleSheet* sheet);
};

class OSGEARTH_EXPORT FeatureStyleSorter
{
public:
FeatureStyleSorter();

using Function = std::function<void(
const Style& style,
FeatureList& features,
ProgressCallback* progress
)>;

void sort(
const TileKey& key,
const Distance& buffer,
Session* session,
const FeatureFilterChain& filters,
Function processFeaturesForStyle,
ProgressCallback* progress) const;

protected:
void getFeatures(
Session* session,
const Query& query,
const Distance& buffer,
const GeoExtent& extent,
const FeatureFilterChain& filters,
FeatureList& output,
ProgressCallback* progress) const;

void sort_usingEmbeddedStyles(
const TileKey& key,
const Distance& buffer,
const FeatureFilterChain& filters,
Session* session,
Function processFeaturesForStyle,
ProgressCallback* progress) const;

void sort_usingSelectors(
const TileKey& key,
const Distance& buffer,
const FeatureFilterChain& filters,
Session* session,
Function processFeaturesForStyle,
ProgressCallback* progress) const;

void sort_usingOneStyle(
const Style& style,
const TileKey& key,
const Distance& buffer,
const FeatureFilterChain& filters,
Session* session,
Function processFeaturesForStyle,
ProgressCallback* progress) const;


};
}
}


#endif
Loading

0 comments on commit bb525fc

Please sign in to comment.