VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
articulatedPartManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2019 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 #include <vrfStateData/stateData.h>
16 #include <vlutil/vlList.h>
17 #include <vlpi/disEnums.h>
18 #include <vl/hostStructs.h>
20 
21 #include <map>
22 
23 class Coordinate_System;
25 
26 namespace makVrf
27 {
28  class DtStateData;
29 
34  {
35 
36  private:
38 
39  public:
40 
42  typedef std::map<DtArtPartType, DtArticulatedPartStateRepository*> ArtPartMap;
43 
45  DtArticulatedPartManager(DtStateData* owner = nullptr, const DtString& name = "art-parts",
46  DtReaderWriterRegistry* parentRegistry = nullptr);
47 
49  virtual ~DtArticulatedPartManager() override;
50 
53  virtual DtArticulatedPartStateRepository* attachPart(DtArtPartType partType);
54 
57  virtual DtArticulatedPartStateRepository* attachPart(DtArtPartType partType,
58  DtArtPartType parentPartType);
59 
61  virtual DtArticulatedPartStateRepository* attachPart(DtArtPartType partType,
62  DtArtPartType parentPartType, const DtArticulatedPartStateRepository& partState);
63 
67  virtual bool detachPart(DtArtPartType partType,
68  DtArticulatedPartStateRepository* partState = nullptr);
69 
72  virtual DtArticulatedPartStateRepository* findPartByType(DtArtPartType partType);
73 
76  virtual void setStateData(DtStateData*);
77 
81  virtual const DtArticulatedPartStateRepository* findPartByType(DtArtPartType partType) const;
82 
84  virtual int numParts() const;
85 
88  const DtArtPartMap& articulatedParts() const { return myParts; };
89 
91  virtual void mergeInPartAttachments(const DtArticulatedPartManager& other);
92 
95  virtual void setAllPartValuesUnspecified();
96 
99  virtual void preGetSelf() override;
100 
102  virtual void postGetSelf() override;
103 
106  virtual void prePutSelf() override;
107 
110  virtual void setCoordinateSystem(const Coordinate_System* cs);
111 
113  virtual void printAllParts(std::ostream& strm) const;
114 
117 
121  virtual void setPublishOnLegionNetwork(bool, bool isWritable);
125  {
126  return myPublishOnLegionNetwork;
127  }
128 
131  virtual void updateDataStorage(const DtArticulatedPartCollection&);
132 
133  protected:
134 
139  const DtArticulatedPartStateRepository* findPartOnOtherPart(DtArtPartType partType,
140  const DtArticulatedPartStateRepository& parentPart) const;
141 
147  bool detatchPartFromOtherPart(DtArtPartType partType,
149  DtArticulatedPartStateRepository* partState = nullptr);
150 
154  int countPartsOnOtherPart(const DtArticulatedPartStateRepository& parentPart) const;
155 
158  void mergeIntoPartsMap(const DtArtPartMap& otherMap);
159 
160  protected:
167 
174  };
175 }
DtStateData * myOwner
The owning state data object for this part manager.
Definition: articulatedPartManager.h:164
The articulated part manager maintains a tree of articulated and attached parts for the state reposit...
Definition: articulatedPartManager.h:33
DtArtPartMap myTempParts
Temporary parts map used during serialization (preGetSelf/postGetSelf).
Definition: articulatedPartManager.h:169
const Coordinate_System * myCoordinateSystem
Coordinate system used by this manager and all contained parts.
Definition: articulatedPartManager.h:166
Definition: readerWriter.h:85
bool publishOnLegionNetwork() const
Returns true if this manager publishes parts on the Legion network.
Definition: articulatedPartManager.h:124
Definition: readerWriterRegistry.h:39
const DtArtPartMap & articulatedParts() const
Returns the map of top-level articulated parts indexed by part type.
Definition: articulatedPartManager.h:88
Definition: coordSystem.h:54
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
bool myPublishOnLegionNetwork
True if this manager publishes parts on the Legion network.
Definition: articulatedPartManager.h:171
std::map< DtArtPartType, DtArticulatedPartStateRepository * > ArtPartMap
Map type indexing articulated part state repositories by part type.
Definition: articulatedPartManager.h:42
A typed map of DtArticulatedPartStateRepository objects keyed by DIS/RPR part type. Used to store and access child parts attached to an entity or another articulated part.
Definition: articulatedPartStateRepository.h:46
DtArtPartMap myParts
Top-level map of articulated parts indexed by part type.
Definition: articulatedPartManager.h:162
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:40
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
bool myIsWritable
True if parts are writable on the Legion network.
Definition: articulatedPartManager.h:173

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)