Skip to content

Commit

Permalink
remove deprecated MapInfo from build, and update various comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Oct 10, 2023
1 parent 01e14e0 commit 0beac2b
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 215 deletions.
2 changes: 0 additions & 2 deletions src/osgEarth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ SET(LIB_PUBLIC_HEADERS
MapboxGLImageLayer
MapboxGLGlyphManager
MapCallback
MapInfo
MapModelChange
MapNode
MapNodeObserver
Expand Down Expand Up @@ -616,7 +615,6 @@ set(TARGET_SRC
MapboxGLImageLayer.cpp
MapboxGLGlyphManager.cpp
MapCallback.cpp
MapInfo.cpp
MapNode.cpp
MaterialLoader.cpp
MemCache.cpp
Expand Down
1 change: 0 additions & 1 deletion src/osgEarth/FeatureModelGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <osgEarth/FeatureSourceIndexNode>
#include <osgEarth/FilterContext>

#include <osgEarth/MapInfo>
#include <osgEarth/Capabilities>
#include <osgEarth/CullingUtils>
#include <osgEarth/ElevationLOD>
Expand Down
1 change: 0 additions & 1 deletion src/osgEarth/Map
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ namespace osgEarth
void uninstallLayerCallbacks(Layer*);

void init();
friend class MapInfo;
Options _optionsConcrete;
Options& options() { return _optionsConcrete; }
};
Expand Down
5 changes: 0 additions & 5 deletions src/osgEarth/MapCallback
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ namespace osgEarth
class Layer;
struct MapModelChange;

namespace Util
{
class MapInfo;
}

/**
* Callback that the Map object uses to notify listeners of map data model changes.
*/
Expand Down
80 changes: 0 additions & 80 deletions src/osgEarth/MapInfo

This file was deleted.

56 changes: 0 additions & 56 deletions src/osgEarth/MapInfo.cpp

This file was deleted.

12 changes: 6 additions & 6 deletions src/osgEarth/MapNode
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,18 @@ namespace osgEarth

public: // osg::Object

virtual const char* libraryName() const { return "osgEarth"; }
virtual const char* className() const { return "MapNode"; }
const char* libraryName() const override { return "osgEarth"; }
const char* className() const override { return "MapNode"; }

public: //override osg::Node

virtual osg::BoundingSphere computeBound() const;
osg::BoundingSphere computeBound() const override;

virtual void traverse( class osg::NodeVisitor& nv );
void traverse(class osg::NodeVisitor& nv) override;

virtual void resizeGLObjectBuffers(unsigned maxSize);
void resizeGLObjectBuffers(unsigned maxSize) override;

virtual void releaseGLObjects(osg::State* state) const;
void releaseGLObjects(osg::State* state) const override;

protected:

Expand Down
49 changes: 25 additions & 24 deletions src/osgEarth/TerrainConstraintLayer
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
namespace osgEarth
{
/**
* Provides feature data to the terrain engine to use for
* customizing the surface mesh.
* Provides data to the terrain engine to use for customizing the surface mesh.
* This layer type is used to constrain the terrain surface based on either
* a collection of features OR tiled model data.
*/
class OSGEARTH_EXPORT TerrainConstraintLayer : public VisibleLayer
{
public: // serialization
class OSGEARTH_EXPORT Options : public VisibleLayer::Options
struct OSGEARTH_EXPORT Options : public VisibleLayer::Options
{
public:
META_LayerOptions(osgEarth, Options, VisibleLayer::Options);
OE_OPTION_LAYER(FeatureSource, featureSource);
OE_OPTION_LAYER(TiledModelLayer, model);
Expand All @@ -47,18 +47,23 @@ namespace osgEarth
OE_OPTION(bool, removeExterior);
OE_OPTION(bool, hasElevation);
OE_OPTION(unsigned, minLevel);
virtual Config getConfig() const;
private:
Config getConfig() const override;
void fromConfig( const Config& conf );
};

public:
META_Layer(osgEarth, TerrainConstraintLayer, Options, VisibleLayer, TerrainConstraint);

//! Source of the feature data
//! Feature data to use for creating terrain constraints
//! Use this OR setModelLayer, but not both.
void setFeatureSource(FeatureSource* features);
FeatureSource* getFeatureSource() const;

//! Model data to use for creating terrain constraints
//! Use this OR setFeatureSource(), but not both.
void setModelLayer(TiledModelLayer* model);
TiledModelLayer* getModelLayer() const;

//! Whether the terrain should remove geometry that is interior to polygons
bool getRemoveInterior() const { return options().removeInterior().get(); }
void setRemoveInterior(bool value);
Expand All @@ -76,29 +81,32 @@ namespace osgEarth
unsigned getMinLevel() const { return options().minLevel().get(); }
void setMinLevel(unsigned value);

//! Geospatial extent of this layer's data
virtual const GeoExtent& getExtent() const override;
//! Geospatial extent of this layer's data, if known.
const GeoExtent& getExtent() const override;

//! Visibility toggle from VisibleLayer
virtual void setVisible(bool value) override;
void setVisible(bool value) override;

FeatureFilterChain* getFilters() const {
return _filterchain.get();
}
//! Feature filters to use when querying the feature source, if applicable.
FeatureFilterChain* getFilters() const { return _filterchain.get(); }

//! Return a constraint object
//! Return a constraint object for a given tile key.
//! @param key The tile key
//! @param context The filter context, or nullptr if not applicable
//! @param progress A progress callback to check for user cancellation
//! @return A constraint object
MeshConstraint getConstraint(
const TileKey& key,
FilterContext* context,
ProgressCallback* progress) const;

protected:

virtual Status openImplementation() override;
Status openImplementation() override;

virtual void addedToMap(const Map*) override;
void addedToMap(const Map*) override;

virtual void removedFromMap(const Map*) override;
void removedFromMap(const Map*) override;

protected:

Expand All @@ -123,13 +131,6 @@ namespace osgEarth
ProgressCallback* progress) const;
};

//! A single constraint (set of features from a given layer with properties)
struct TerrainConstraint
{
FeatureList features;
osg::ref_ptr<TerrainConstraintLayer> layer;
};

/**
* Object you can use to query the map for constraints that
* intersect a tile key.
Expand Down
18 changes: 18 additions & 0 deletions src/osgEarth/TerrainConstraintLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,24 @@ TerrainConstraintLayer::getFeatureSource() const
return options().featureSource().getLayer();
}

void
TerrainConstraintLayer::setModelLayer(TiledModelLayer* value)
{
if (value != getModelLayer())
{
bool is_open = isOpen();
if (is_open) close();
options().model().setLayer(value);
if (is_open) open();
}
}

TiledModelLayer*
TerrainConstraintLayer::getModelLayer() const
{
return options().model().getLayer();
}

Status
TerrainConstraintLayer::openImplementation()
{
Expand Down
5 changes: 4 additions & 1 deletion src/osgEarth/TileMesher
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@

namespace osgEarth
{
// Represents a single edit operation driven by a feature collection
/**
* Represents a single edit operation driven by a feature collection
*/
struct MeshConstraint
{
FeatureList features;
Expand All @@ -46,6 +48,7 @@ namespace osgEarth
MeshConstraint(MeshConstraint&& rhs) = default;
};

//! Collection of mesh constraints
using MeshConstraints = std::vector<MeshConstraint>;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/osgEarth/TileMesher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ TileMesher::createMeshWithConstraints(

weemesh::mesh_t mesh;


// if we have an input mesh, use it. Otherwise, build a regular gridded mesh.
if (input_mesh.verts.valid())
{
load_mesh(mesh, input_mesh);
Expand Down
Loading

0 comments on commit 0beac2b

Please sign in to comment.