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) 2024 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 #include <memory.h>
19 
20 namespace makVrv
21 {
22  class DtDynamicTerrainGeometry;
23  class DtDynamicTerrainChange;
24  class DtDynamicTerrainSwitch;
25 
27  {
28  public:
29  explicit DtSwitchTerrainFeature(
30  DtDynamicTerrainSwitch* switcher,
31  const DtString& stateName,
32  const DtDynamicTerrainSwitchNode::ValueChildMap& valueChildMap,
33  const osg::BoundingSphere& sphere,
34  const std::shared_ptr<DtDynamicTerrainFeature>& parent);
35 
36  virtual DtString description() const;
37 
38  virtual const DtDynamicTerrainFeature* parentFeature() const;
39 
40  virtual void iterateCommands( const boost::function<void (const DtDynamicTerrainChange&)>& callback,
41  const DtString& key) const;
42 
43  virtual const DtDynamicTerrainGeometry* geometry() const;
44  virtual const DtDynamicTerrainGeometry* originalGeometry() const;
45 
47  // Note that the second argument, useOriginalGeometry is ignored; myGeometry is
48  // always used to match, which is the switch location and 0 radius
49  virtual bool matches(const DtDynamicTerrainChange& command, bool) const;
50  virtual bool matches(const DtDynamicTerrainGeometry&, bool ) const;
52 
53  virtual void changeState(const DtDynamicTerrainChanges& changes);
54 
57  virtual bool stringValueToState( const DtString& valueName, int &state ) const;
58 
59  virtual void setState(const DtDynamicTerrainChange* command);
60 
61  virtual bool isInDefaultState() const;
62  virtual bool lastStateWasDefaultState() const;
63 
64  protected:
65  const std::unique_ptr<DtDynamicTerrainGeometry> myGeometry;
66  const std::unique_ptr<DtDynamicTerrainGeometry> myOriginalGeometry;
67  const std::shared_ptr<DtDynamicTerrainFeature> myParentFeature;
70 
72  typedef tbb::spin_mutex Mutex;
73  mutable Mutex myMutex;
74 
75  const std::unique_ptr<DtDynamicTerrainSwitch> mySwitcher;
76  };
77 }
Definition: DtDynamicTerrainFeature.h:316
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Mutex myMutex
Definition: DtSwitchTerrainFeature.h:73
Represents (possibly infinite) area of space.
Definition: DtDynamicTerrainGeometry.h:20
const DtString myStateName
Definition: DtSwitchTerrainFeature.h:68
const std::unique_ptr< DtDynamicTerrainGeometry > myOriginalGeometry
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:107
const DtDynamicTerrainSwitchNode::ValueChildMap myValueToChildMap
Definition: DtSwitchTerrainFeature.h:69
const std::shared_ptr< DtDynamicTerrainFeature > myParentFeature
Definition: DtSwitchTerrainFeature.h:67
Definition: DtSwitchTerrainFeature.h:26
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 std::unique_ptr< DtDynamicTerrainGeometry > myGeometry
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:72
const std::unique_ptr< DtDynamicTerrainSwitch > mySwitcher
Definition: DtSwitchTerrainFeature.h:75

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)