VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSwitchTerrainFeature.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 
15 
16 #include <tbb/spin_mutex.h>
17 
18 namespace makVrv
19 {
20  class DtDynamicTerrainGeometry;
21  class DtDynamicTerrainChange;
22  class DtDynamicTerrainSwitch;
23 
25  {
26  public:
27  explicit DtSwitchTerrainFeature(
28  DtDynamicTerrainSwitch* switcher,
29  const DtString& stateName,
30  const DtDynamicTerrainSwitchNode::ValueChildMap& valueChildMap,
31  const osg::BoundingSphere& sphere,
32  const boost::shared_ptr<DtDynamicTerrainFeature>& parent);
33 
34  virtual DtString description() const;
35 
36  virtual const DtDynamicTerrainFeature* parentFeature() const;
37 
38  virtual void iterateCommands( const boost::function<void (const DtDynamicTerrainChange&)>& callback,
39  const DtString& key) const;
40 
41  virtual const DtDynamicTerrainGeometry* geometry() const;
42  virtual const DtDynamicTerrainGeometry* originalGeometry() const;
43 
44  virtual bool matches(const DtDynamicTerrainChange& command, bool useOriginalGeometry) const;
45  virtual bool matches(const DtDynamicTerrainGeometry&, bool useOriginalGeometry) const;
46 
47  virtual void changeState(const DtDynamicTerrainChanges& changes);
48 
51  virtual bool stringValueToState( const DtString& valueName, int &state ) const;
52 
53  virtual void setState(const DtDynamicTerrainChange* command);
54 
55  virtual bool isInDefaultState() const;
56  virtual bool lastStateWasDefaultState() const;
57 
58  protected:
59  const boost::scoped_ptr<DtDynamicTerrainGeometry> myGeometry;
60  const boost::scoped_ptr<DtDynamicTerrainGeometry> myOriginalGeometry;
61  const boost::shared_ptr<DtDynamicTerrainFeature> myParentFeature;
64 
66  typedef tbb::spin_mutex Mutex;
67  mutable Mutex myMutex;
68 
69  boost::scoped_ptr<DtDynamicTerrainSwitch> mySwitcher;
70  };
71 }
boost::scoped_ptr< DtDynamicTerrainSwitch > mySwitcher
Definition: DtSwitchTerrainFeature.h:69
Definition: DtDynamicTerrainFeature.h:316
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Mutex myMutex
Definition: DtSwitchTerrainFeature.h:67
Represents (possibly infinite) area of space.
Definition: DtDynamicTerrainGeometry.h:19
const boost::scoped_ptr< DtDynamicTerrainGeometry > myOriginalGeometry
Definition: DtSwitchTerrainFeature.h:60
const DtString myStateName
Definition: DtSwitchTerrainFeature.h:62
State switch.
Definition: DtDynamicTerrainStateManipulatorFactory.h:110
const DtDynamicTerrainSwitchNode::ValueChildMap myValueToChildMap
Definition: DtSwitchTerrainFeature.h:63
Definition: DtSwitchTerrainFeature.h:24
boost::unordered_map< DtString, int > ValueChildMap
ValueChildMap defines an unordered map of value names to the child indices to which they correspond...
Definition: DtDynamicTerrainSwitchNode.h:91
Interface which abstracts the concept of a individually identifiable &quot;thing&quot; in the terrain...
Definition: DtDynamicTerrainFeature.h:83
Contains makVrv::DtDynamicTerrainFeature class.
const boost::shared_ptr< DtDynamicTerrainFeature > myParentFeature
Definition: DtSwitchTerrainFeature.h:61
Command which can be given to the dynamic terrain system to perform some change.
Definition: DtDynamicTerrainChange.h:42
Contains DLL export macros.
Contains makVrv::DtDynamicTerrainSwitchNode class.
tbb::spin_mutex Mutex
Mutex to prevent concurrent state switch in mySwitcher.
Definition: DtSwitchTerrainFeature.h:66
const boost::scoped_ptr< DtDynamicTerrainGeometry > myGeometry
Definition: DtSwitchTerrainFeature.h:59

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)