VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgEarthMemoryFeatureSource.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include <vrvOsg/vrvOsg.h>
12 
14 
15 #include <osgEarth/FeatureSource>
16 #include <osgEarth/Feature>
17 #include <osgEarth/Threading>
18 
19 #include <unordered_map>
20 
21 namespace osgEarth
22 {
23  class LandCoverDictionary;
24 }
25 
26 namespace makVrv
27 {
31  class DT_DLL_VRVOSG DtOsgEarthMemoryFeatureSource : public osgEarth::FeatureSource
32  {
33  public:
35  META_LayerOptions(makVrv, Options, osgEarth::FeatureSource::Options);
36  void fromConfig(const osgEarth::Config&) { }
37  };
38 
39  public:
40  META_Layer(makVrv, DtOsgEarthMemoryFeatureSource, Options, osgEarth::FeatureSource, DtOsgEarthMemoryFeatureSource);
41 
44 
45  protected:
47  virtual void init() override;
48 
50  virtual osgEarth::Status openImplementation() override;
51 
53  virtual osgEarth::FeatureCursor* createFeatureCursorImplementation(
54  const osgEarth::Query& query,
55  osgEarth::ProgressCallback* progress) const override;
56 
57  public:
58 
62  DtOsgEarthMemoryFeatureSource &operator=(const DtOsgEarthMemoryFeatureSource &other) = delete;
63 
65  void setFeatures(const osgEarth::FeatureList& features);
66 
67  public: // FeatureSource API
68 
69  virtual const osgEarth::GeoExtent& getExtent() const override;
70 
72  virtual bool insertFeature(osgEarth::Feature* feature) override;
73 
75  virtual bool deleteFeature(osgEarth::FeatureID fid) override;
76 
78  virtual bool deleteAllFeatures();
79 
81  virtual bool isWritable() const override;
82 
83  protected:
85  osgEarth::GeoExtent myExtent;
86  osgEarth::FeatureList myFeatures;
87  std::atomic_int myFidgen;
88 
89  void recalculateExtent();
90  };
91 }
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
unsigned int FeatureID
Definition: DtFeature.h:21
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osgEarth::Threading::Mutex myMutex
Definition: DtOsgEarthMemoryFeatureSource.h:84
void fromConfig(const osgEarth::Config &)
Definition: DtOsgEarthMemoryFeatureSource.h:36
std::atomic_int myFidgen
Definition: DtOsgEarthMemoryFeatureSource.h:87
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
osgEarth::FeatureList myFeatures
Definition: DtOsgEarthMemoryFeatureSource.h:86
Definition: DtOsgEarthMemoryFeatureSource.h:34
osgEarth::GeoExtent myExtent
Definition: DtOsgEarthMemoryFeatureSource.h:85
Contains DLL export macros.
Custom feature source that stores features in memory. Note: this FS will not serialize.
Definition: DtOsgEarthMemoryFeatureSource.h:31

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)