VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dynamicFeatureSet.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
13 #include "features/featureSet.h"
15 
16 #include <vrfutil/objectCounter.h>
17 
18 #include <boost/signals2.hpp>
19 
20 namespace MAKVRinTerra
21 {
23  template <typename F>
25  : public DtFeatureSetTemplate<F>::Source
26 #ifdef DtObjectDebugger_Enable
27  , public DtObjectDebugger< DtDynamicFeatureSetTemplate<F> >
28 #endif
29  {
31 
32  public:
35  typedef typename Base::FeaturePtr FeaturePtr;
36  typedef typename Base::Feature Feature;
37 
38  typedef boost::shared_ptr<DtDynamicFeatureSetTemplate> Ptr;
39  typedef boost::shared_ptr<const DtDynamicFeatureSetTemplate> CPtr;
40 
42  {
43  return boost::static_pointer_cast<DtDynamicFeatureSetTemplate>(Base::shared_from_this());
44  }
45 
46  std::string label() const
47  {
48  return "dynamic feature set";
49  }
50 
52  const DtQuery& query,
53  const boost::optional<DtFeatureGeometry>& geometry,
54  DtLoadType load) const
55  {
56  return new typename Base::Filtered(this->clone(), query, geometry);
57  }
58 
60  {
61  if (!callback)
62  return DetachCallback();
63 
64  typedef boost::signals2::connection Connection;
65 
66  Connection conn = myLoadedSignal.connect(callback);
67 
68  try
69  {
70  return boost::bind(&Connection::disconnect, conn);
71  }
72  catch (...)
73  {
74  conn.disconnect();
75  throw;
76  }
77  }
78 
80  {
81  FeaturePtr f = Base::addFeaturePtr(feature);
83  return f;
84  }
85 
86  protected:
87  typedef boost::signals2::signal<void ()> LoadedSignal;
89  };
90 
92 }
93 
95 
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:101
FeatureSet::LoadedCallback LoadedCallback
Definition: featureSetUtils.h:164
boost::shared_ptr< DtDynamicFeatureSetTemplate > Ptr
Definition: dynamicFeatureSet.h:38
Ptr shared_from_this()
Definition: dynamicFeatureSet.h:41
Default on in debug, off in release.
Definition: objectCounter.h:31
virtual FeaturePtr addFeaturePtr(Feature *feature)
These functions are used to add features to the feature sets. The argument is the feature being added...
Base::DetachCallback DetachCallback
Definition: dynamicFeatureSet.h:33
boost::shared_ptr< const DtDynamicFeatureSetTemplate > CPtr
Definition: dynamicFeatureSet.h:39
std::string label() const
Definition: dynamicFeatureSet.h:46
Base::FeaturePtr FeaturePtr
Definition: dynamicFeatureSet.h:35
Represents a set of characeters a DtFeature object can have. DtQuery objects are the way to communica...
Definition: query.h:38
binderNoArgs< _Fn > bind(const _Fn &_Func, const _Ty &_Left)
Definition: DtSTLUtilities.h:76
DtSinkFeatureSet< FS >::Feature Feature
Definition: featureSetUtils.h:295
#define DT_DEFINE_OBJECT_DEBUGGER_NAME_TEMPLATE(type)
Definition: objectCounter.h:275
FeaturePtr addFeaturePtr(Feature *feature)
These functions are used to add features to the feature sets. The argument is the feature being added...
Definition: dynamicFeatureSet.h:79
DtSinkFeatureSet< FS >::FeaturePtr FeaturePtr
Definition: featureSetUtils.h:296
Dynamic feature set object.
Definition: dynamicFeatureSet.h:24
DtFeatureSetTemplate< F > * filter(const DtQuery &query, const boost::optional< DtFeatureGeometry > &geometry, DtLoadType load) const
Definition: dynamicFeatureSet.h:51
boost::signals2::signal< void()> LoadedSignal
Definition: dynamicFeatureSet.h:87
DtLoadType
Used to indicate whether to load features. See DtFeatureSetTemplate::filter.
Definition: featureSet.h:36
Base::LoadedCallback LoadedCallback
Definition: dynamicFeatureSet.h:34
LoadedSignal myLoadedSignal
Definition: dynamicFeatureSet.h:88
Source feature sets are used to create your own feature sets with your own features.
Definition: featureSetUtils.h:286
DtDynamicFeatureSetTemplate< DtFeature > DtDynamicFeatureSet
Definition: dynamicFeatureSet.h:91
DtFeatureSetTemplate< F >::Source Base
Definition: dynamicFeatureSet.h:30
DetachCallback addLoadedCallback(const LoadedCallback &callback) const
Definition: dynamicFeatureSet.h:59
Base::Feature Feature
Definition: dynamicFeatureSet.h:36
FeatureSet::DetachCallback DetachCallback
Definition: featureSetUtils.h:299

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)