VR-Link API Documentation for DIS
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;
36 
42 
49 
52 
54  virtual ~DtArticulatedPartCollection();
55 
56  bool operator==(const DtArticulatedPartCollection& other) const;
57  bool operator!=(const DtArticulatedPartCollection& other) const;
58 
62  virtual void getPartTypes(PartTypeSet& aSet);
63 
65  virtual DtArticulatedPart& getPart(unsigned int partType);
66 
68 
69 
70 
71 
72 
73  virtual DtArticulatedPart* findPart(unsigned int partType);
74  virtual const DtArticulatedPart* findPart(unsigned int partType) const;
76 
79  virtual void removeAllParts();
80 
83  virtual void removePart(unsigned int partType);
84 
87  virtual void attachPart(DtArticulatedPart* childPart, DtArticulatedPart* parentPart);
88 
90  inline void attachPart(unsigned int childPartType, unsigned int parentPartType);
91 
93  virtual unsigned int totalParameterCount() const;
94 
96  virtual unsigned int partCount() const;
97 
103  virtual DtArticulatedPart* createPart(DtArticulatedPart* copy = 0) const;
104 
106  const_iterator begin() const;
107 
109  const_iterator end() const;
110 
117  virtual void setClock(DtClock* clock, bool setForAllParts = true);
118 
120 
121  DtClock* clock();
122  const DtClock* clock() const;
124 
127  bool partsApproximateByDefault() const;
128 
130  void setPartsApproximateByDefault(bool deadReckonByDefault);
131 
133  void printDataToStream(std::ostream& stream) const;
134 
137  const std::vector<DtArticulatedPart*>& getSortedList() const;
138 
139 protected:
140 
143  virtual void sortArtParts() const;
144 
147  int calculatePartDistance(DtArticulatedPart* part) const;
148 
149 protected:
150 
154  mutable std::vector<DtArticulatedPart*> mySortedList;
155  mutable bool myNeedsSortingFlag;
156 };
157 
159  unsigned int childPartType, unsigned int parentPartType)
160 {
161  attachPart(findPart(childPartType),findPart(parentPartType));
162 }
163 
164 
165 #endif

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)