VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
articulatedPartCollection.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 
10 
11 #ifndef articulatedPartCollection_H_
12 #define articulatedPartCollection_H_
13 
14 #include <vlutil/vlMachineTypes.h>
15 
16 #include <map>
17 #include <set>
18 #include <vector>
19 #include <ostream>
20 
21 class DtArticulatedPart;
22 class DtClock;
23 
30 {
31 public:
32 
33  typedef std::map<unsigned int,DtArticulatedPart*> PartMap;
34  typedef PartMap::const_iterator const_iterator;
35  typedef std::set<unsigned int> PartTypeSet;
37  {
41  DtAttachFailCycle
42  };
43 
49 
56 
59 
61  virtual ~DtArticulatedPartCollection();
62 
63  bool operator==(const DtArticulatedPartCollection& other) const;
64  bool operator!=(const DtArticulatedPartCollection& other) const;
65 
69  virtual void getPartTypes(PartTypeSet& aSet);
70 
72  virtual DtArticulatedPart& getPart(unsigned int partType);
73 
75 
76 
77 
78 
79 
80  virtual DtArticulatedPart* findPart(unsigned int partType);
81  virtual const DtArticulatedPart* findPart(unsigned int partType) const;
83 
86  virtual void removeAllParts();
87 
90  virtual void removePart(unsigned int partType);
91 
97  virtual bool attachPart(DtArticulatedPart* childPart, DtArticulatedPart* parentPart, DtAttachResult* attachResult=0);
98 
105  inline bool attachPart(unsigned int childPartType, unsigned int parentPartType, DtAttachResult* attachResult=0);
106 
110  virtual bool attachCreatesCycle(DtArticulatedPart* childPart,
111  DtArticulatedPart* parentPart);
112 
114  virtual unsigned int totalParameterCount() const;
115 
117  virtual unsigned int partCount() const;
118 
124  virtual DtArticulatedPart* createPart(DtArticulatedPart* copy = 0) const;
125 
127  const_iterator begin() const;
128 
130  const_iterator end() const;
131 
138  virtual void setClock(DtClock* clock, bool setForAllParts = true);
139 
141 
142  DtClock* clock();
143  const DtClock* clock() const;
145 
148  bool partsApproximateByDefault() const;
149 
151  void setPartsApproximateByDefault(bool deadReckonByDefault);
152 
154  void printDataToStream(std::ostream& stream) const;
155 
157  const std::vector<DtArticulatedPart*>& getSortedList() const;
158 
159 protected:
160 
162  virtual void sortArtParts() const;
163 
166  virtual int calculatePartDistance(const DtArticulatedPart* part) const;
167 
170  virtual int fixPartAttachment(DtArticulatedPart* part);
171 
172 protected:
173 
177  mutable std::vector<DtArticulatedPart*> mySortedList;
178  mutable bool myNeedsSortingFlag;
179 };
180 
182  unsigned int childPartType, unsigned int parentPartType, DtArticulatedPartCollection::DtAttachResult* attachResult)
183 {
184  return attachPart(findPart(childPartType),findPart(parentPartType), attachResult);
185 }
186 
187 
188 #endif

Document ID: Generated on Mon Jun 22 21:18:40 EDT 2020 from SVN revision 213785
Copyright © 2005-2018 MAK Technologies. All Rights Reserved (www.mak.com)