VR-Forces 4.8 Class Documentation
 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) 2015 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  , public DtObjectDebugger< DtDynamicFeatureSetTemplate<F> >
27  {
29 
30  public:
33  typedef typename Base::FeaturePtr FeaturePtr;
34  typedef typename Base::Feature Feature;
35 
36  typedef boost::shared_ptr<DtDynamicFeatureSetTemplate> Ptr;
37  typedef boost::shared_ptr<const DtDynamicFeatureSetTemplate> CPtr;
38 
40  {
41  return boost::static_pointer_cast<DtDynamicFeatureSetTemplate>(Base::shared_from_this());
42  }
43 
44  std::string label() const
45  {
46  return "dynamic feature set";
47  }
48 
50  const DtQuery& query,
51  const boost::optional<DtFeatureGeometry>& geometry,
52  DtLoadType load) const
53  {
54  return new typename Base::Filtered(this->clone(), query, geometry);
55  }
56 
58  {
59  if (!callback)
60  return DetachCallback();
61 
62  typedef boost::signals2::connection Connection;
63 
64  Connection conn = myLoadedSignal.connect(callback);
65 
66  try
67  {
68  return boost::bind(&Connection::disconnect, conn);
69  }
70  catch (...)
71  {
72  conn.disconnect();
73  throw;
74  }
75  }
76 
78  {
79  FeaturePtr f = Base::addFeaturePtr(feature);
81  return f;
82  }
83 
84  protected:
85  typedef boost::signals2::signal<void ()> LoadedSignal;
87  };
88 
90 }
91 
93 
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:101
FeatureSet::LoadedCallback LoadedCallback
Definition: featureSetUtils.h:158
boost::shared_ptr< DtDynamicFeatureSetTemplate > Ptr
Definition: dynamicFeatureSet.h:36
Ptr shared_from_this()
Definition: dynamicFeatureSet.h:39
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.
Base::DetachCallback DetachCallback
Definition: dynamicFeatureSet.h:31
boost::shared_ptr< const DtDynamicFeatureSetTemplate > CPtr
Definition: dynamicFeatureSet.h:37
std::string label() const
Definition: dynamicFeatureSet.h:44
Base::FeaturePtr FeaturePtr
Definition: dynamicFeatureSet.h:33
Represents a set of characeters a DtFeature object can have.
Definition: query.h:38
binderNoArgs< _Fn > bind(const _Fn &_Func, const _Ty &_Left)
Definition: DtSTLUtilities.h:76
DtSinkFeatureSet< FS >::Feature Feature
Definition: featureSetUtils.h:287
#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.
Definition: dynamicFeatureSet.h:77
DtSinkFeatureSet< FS >::FeaturePtr FeaturePtr
Definition: featureSetUtils.h:288
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:49
boost::signals2::signal< void()> LoadedSignal
Definition: dynamicFeatureSet.h:85
DtLoadType
Used to indicate whether to load features.
Definition: featureSet.h:36
Base::LoadedCallback LoadedCallback
Definition: dynamicFeatureSet.h:32
LoadedSignal myLoadedSignal
Definition: dynamicFeatureSet.h:86
Source feature sets are used to create your own feature sets with your own features.
Definition: featureSetUtils.h:280
DtDynamicFeatureSetTemplate< DtFeature > DtDynamicFeatureSet
Definition: dynamicFeatureSet.h:89
DtFeatureSetTemplate< F >::Source Base
Definition: dynamicFeatureSet.h:28
DetachCallback addLoadedCallback(const LoadedCallback &callback) const
Definition: dynamicFeatureSet.h:57
Base::Feature Feature
Definition: dynamicFeatureSet.h:34
FeatureSet::DetachCallback DetachCallback
Definition: featureSetUtils.h:291

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)