VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
osgEarthFeatureSet.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include <features/feature.h>
9 #include <features/featureSet.h>
10 
11 #include <osgEarth/Map>
12 #include <osgEarth/FeatureSource>
13 #include <osgEarth/Query>
14 #include <osgEarth/MapNode>
15 #include <osgEarth/Geometry>
16 
17 namespace MAKVRinTerra
18 {
20  {
21  public:
23 
24  static DtFeatureGeometry::GeometryVector ConvertGeometry(
25  const osgEarth::Geometry* geom, const DtProj& proj);
26 
28 
29  unsigned numberOfAttributes(const Key::String&) const;
30 
31  boost::optional<Attribute> attribute(const Key &) const;
32 
33  DtFeatureGeometry geometry() const;
34 
35  void forEachAttribute(ForEachFunction) const;
36 
38  {
39  return DetachCallback();
40  }
41 
42  bool isDeleted() const
43  {
44  return false;
45  }
46 
47  protected:
50 
51  typedef osgEarth::AttributeTable AttributeTable;
52  typedef std::map<Key::String, AttributeTable::value_type::second_type> StringAttributeTable;
54  };
55 
57  {
58  public:
60 
61  DtFeatureGeometry geometry() const;
62 
63  protected:
65  };
66 
68  {
69  public:
70  typedef std::set<DtFeature::Key> AttributeSet;
71 
72  static DtFeatureSet* Make(osg::ref_ptr<osgEarth::FeatureSource> featureSource);
73 
74  explicit DtOsgEarthFeatureSet(osg::ref_ptr<osgEarth::FeatureSource> featureSource, const std::string& driver);
75 
76  std::string labelWithoutBounds() const;
77  std::string label() const;
78  void forEachFeatureParallel(const ForEachFunction&) const;
79  DetachCallback forEachFeatureAsync(const ForEachFunction&) const;
80  DtFeatureSet* filter(
81  const DtQuery&, const boost::optional<DtFeatureGeometry>&, DtLoadType) const;
82  DtFeatureSet* clone() const;
83  bool loaded(double) const;
84  DetachCallback addLoadedCallback(const LoadedCallback&) const;
85  bool elided() const;
86  bool empty() const;
87  bool isCacheable(const boost::optional<DtFeatureGeometry>& area) const;
88  void cacheEstimate(double& time, double& size, const boost::optional<DtFeatureGeometry>& area) const;
89  void cacheData(
90  const boost::optional<DtFeatureGeometry>& area,
91  DtFeatureCacheProgressCallback* progress) const;
92 
93  protected:
95  DtOsgEarthFeatureSet(const DtOsgEarthFeatureSet&, boost::optional<DtFeatureGeometry>);
96 
97  virtual void convertBoundsQueryToTileQueries(
98  std::list<osgEarth::Query>& output) const;
99  virtual void convertBoundsQueryToTileQueries(
100  const osgEarth::TileKey& root,
101  std::list<osgEarth::Query>& output) const;
102 
106  boost::optional<DtFeatureGeometry> myGeometryFilter;
107  osgEarth::Query myQuery;
110  bool myUseTFS;
111  int myTFSLod;
112  };
113 }
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:101
bool myErrorFlag
Definition: osgEarthFeatureSet.h:104
boost::function< void(const Feature &)> ForEachFunction
Callback type type for iterating through features.
Definition: featureSet.h:153
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
Definition: osgEarthFeatureSet.h:67
osg::ref_ptr< osgEarth::FeatureSource > myFeatureSource
Definition: osgEarthFeatureSet.h:103
std::set< DtFeature::Key > AttributeSet
Definition: osgEarthFeatureSet.h:70
boost::function< void()> DetachCallback
Callback type for disconnecting other callbacks. Functions which register callbacks return a DetachCa...
Definition: featureSet.h:125
Key used to lookup attributes. The DtFeature interface is a dictionary that maps Key objects to attri...
Definition: feature.h:68
bool myAlwaysLoadFlag
Definition: osgEarthFeatureSet.h:109
voidpf void uLong size
Definition: ioapi.h:39
StringAttributeTable myAttributes
Definition: osgEarthFeatureSet.h:53
boost::function< void()> DetachCallback
Callback used to detach the user from a feature so the users callback is not called anymore...
Definition: feature.h:180
boost::optional< DtFeatureGeometry > myGeometryFilter
Definition: osgEarthFeatureSet.h:106
Definition: osgEarthFeatureSet.h:19
boost::function< void(const Key &, const Attribute &)> ForEachFunction
Callback used to iterating through attributes with ForEachAttribute.
Definition: feature.h:151
Represents some coordinate system. The terms &quot;coordinate system&quot;, &quot;projection&quot;, &quot;spatial reference&quot;...
Definition: proj.h:44
Represents a set of characeters a DtFeature object can have. DtQuery objects are the way to communica...
Definition: query.h:38
osg::ref_ptr< osgEarth::Feature > OsgEarthFeaturePtr
Definition: osgEarthFeatureSet.h:22
boost::function< void()> DeleteCallback
User supplied callback called when feature is deleted.
Definition: feature.h:183
Definition: osgEarthFeatureSet.h:56
boost::shared_ptr< const DtProj > CPtr
Definition: proj.h:48
DetachCallback addDeleteCallback(const DeleteCallback &) const
Add a user supplied callback to the feature to be called when the feature is deleted. If the feature is already deleted the callback may or may not be called by the implementation of this function. The callback is guaranteed to only be called once.
Definition: osgEarthFeatureSet.h:37
DtFeatureGeometry myGeometry
Definition: osgEarthFeatureSet.h:64
DtProj::CPtr myProjection
Definition: osgEarthFeatureSet.h:49
osgEarth::Query myQuery
Definition: osgEarthFeatureSet.h:107
DtProj::CPtr myProjection
Definition: osgEarthFeatureSet.h:105
bool isDeleted() const
Check to see if feature has been deleted. Note: this is not related to C++ delete or destructors...
Definition: osgEarthFeatureSet.h:42
osgEarth::AttributeTable AttributeTable
Definition: osgEarthFeatureSet.h:51
DtLoadType
Used to indicate whether to load features. See DtFeatureSetTemplate::filter.
Definition: featureSet.h:36
std::vector< DtFeatureGeometry > GeometryVector
Definition: featureGeometry.h:74
int myTFSLod
Definition: osgEarthFeatureSet.h:111
OsgEarthFeaturePtr myFeature
Definition: osgEarthFeatureSet.h:48
AttributeSet myAttributes
Definition: osgEarthFeatureSet.h:108
Represents a GIS feature. Features consist of a DtFeatureGeometry (2.5D geometric vector data) and a ...
Definition: feature.h:37
boost::function< void()> LoadedCallback
Callback type type for async notification of feature set loading.
Definition: featureSet.h:156
std::map< Key::String, AttributeTable::value_type::second_type > StringAttributeTable
Definition: osgEarthFeatureSet.h:52
Represents a feature geometry.
Definition: featureGeometry.h:39
bool myUseTFS
Definition: osgEarthFeatureSet.h:110

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)