VR-Forces Developer's Guide
 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 
45  // Note that the second argument, useOriginalGeometry is ignored; myGeometry is
46  // always used to match, which is the switch location and 0 radius
47  virtual bool matches(const DtDynamicTerrainChange& command, bool) const;
48  virtual bool matches(const DtDynamicTerrainGeometry&, bool ) const;
50 
51  virtual void changeState(const DtDynamicTerrainChanges& changes);
52 
55  virtual bool stringValueToState( const DtString& valueName, int &state ) const;
56 
57  virtual void setState(const DtDynamicTerrainChange* command);
58 
59  virtual bool isInDefaultState() const;
60  virtual bool lastStateWasDefaultState() const;
61 
62  protected:
63  const boost::scoped_ptr<DtDynamicTerrainGeometry> myGeometry;
64  const boost::scoped_ptr<DtDynamicTerrainGeometry> myOriginalGeometry;
65  const boost::shared_ptr<DtDynamicTerrainFeature> myParentFeature;
68 
70  typedef tbb::spin_mutex Mutex;
71  mutable Mutex myMutex;
72 
73  boost::scoped_ptr<DtDynamicTerrainSwitch> mySwitcher;
74  };
75 }
boost::scoped_ptr< DtDynamicTerrainSwitch > mySwitcher
Definition: DtSwitchTerrainFeature.h:73
Definition: DtDynamicTerrainFeature.h:316
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Mutex myMutex
Definition: DtSwitchTerrainFeature.h:71
Represents (possibly infinite) area of space.
Definition: DtDynamicTerrainGeometry.h:20
const boost::scoped_ptr< DtDynamicTerrainGeometry > myOriginalGeometry
Definition: DtSwitchTerrainFeature.h:64
const DtString myStateName
Definition: DtSwitchTerrainFeature.h:66
State switch. This is an interface for manipulating a switch. A switch in this context is defined as ...
Definition: DtDynamicTerrainStateManipulatorFactory.h:110
const DtDynamicTerrainSwitchNode::ValueChildMap myValueToChildMap
Definition: DtSwitchTerrainFeature.h:67
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:65
Command which can be given to the dynamic terrain system to perform some change. This class is a simp...
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:70
const boost::scoped_ptr< DtDynamicTerrainGeometry > myGeometry
Definition: DtSwitchTerrainFeature.h:63

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)