/ src / libnml / cms / cms_pm.cc
cms_pm.cc
  1  /********************************************************************
  2  * Description: cms_pm.cc
  3  *   Provides CMS update functions for the POSEMATH classes.*
  4  *
  5  *   Derived from a work by Fred Proctor & Will Shackleford
  6  *
  7  * Author:
  8  * License: LGPL Version 2
  9  * System: Linux
 10  *    
 11  * Copyright (c) 2004 All rights reserved.
 12  *
 13  * Last change: 
 14  ********************************************************************/
 15  
 16  #include "cms.hh"		// class CMS
 17  #include "posemath.h"		// POSEMATH classes
 18  // translation types
 19  CMS_STATUS CMS::update(PM_CARTESIAN & Cart)
 20  {
 21      update(Cart.x);
 22      update(Cart.y);
 23      update(Cart.z);
 24      return (status);
 25  }
 26  
 27  CMS_STATUS CMS::update(PM_CARTESIAN * x, int n)
 28  {
 29      int i;
 30      for (i = 0; i < n; i++) {
 31  	update(x[i]);
 32      }
 33      return (status);
 34  }
 35  
 36  CMS_STATUS CMS::update(PM_SPHERICAL & Sph)
 37  {
 38      update(Sph.theta);
 39      update(Sph.phi);
 40      update(Sph.r);
 41      return (status);
 42  }
 43  
 44  CMS_STATUS CMS::update(PM_SPHERICAL * x, int n)
 45  {
 46      int i;
 47      for (i = 0; i < n; i++) {
 48  	update(x[i]);
 49      }
 50      return (status);
 51  }
 52  
 53  CMS_STATUS CMS::update(PM_CYLINDRICAL & Cyl)
 54  {
 55      update(Cyl.theta);
 56      update(Cyl.r);
 57      update(Cyl.z);
 58      return (status);
 59  }
 60  
 61  CMS_STATUS CMS::update(PM_CYLINDRICAL * x, int n)
 62  {
 63      int i;
 64      for (i = 0; i < n; i++) {
 65  	update(x[i]);
 66      }
 67      return (status);
 68  }
 69  
 70    // rotation types
 71  CMS_STATUS CMS::update(PM_ROTATION_VECTOR & Rot)
 72  {
 73      update(Rot.s);
 74      update(Rot.x);
 75      update(Rot.y);
 76      update(Rot.z);
 77      return (status);
 78  }
 79  
 80  CMS_STATUS CMS::update(PM_ROTATION_VECTOR * x, int n)
 81  {
 82      int i;
 83      for (i = 0; i < n; i++) {
 84  	update(x[i]);
 85      }
 86      return (status);
 87  }
 88  
 89  CMS_STATUS CMS::update(PM_ROTATION_MATRIX & Mat)
 90  {
 91      update(Mat.x);
 92      update(Mat.y);
 93      update(Mat.z);
 94      return (status);
 95  }
 96  
 97  CMS_STATUS CMS::update(PM_ROTATION_MATRIX * x, int n)
 98  {
 99      int i;
100      for (i = 0; i < n; i++) {
101  	update(x[i]);
102      }
103      return (status);
104  }
105  
106  CMS_STATUS CMS::update(PM_QUATERNION & Quat)
107  {
108      update(Quat.s);
109      update(Quat.x);
110      update(Quat.y);
111      update(Quat.z);
112      return (status);
113  }
114  
115  CMS_STATUS CMS::update(PM_QUATERNION * x, int n)
116  {
117      int i;
118      for (i = 0; i < n; i++) {
119  	update(x[i]);
120      }
121      return (status);
122  }
123  
124  CMS_STATUS CMS::update(PM_EULER_ZYZ & Zyz)
125  {
126      update(Zyz.z);
127      update(Zyz.y);
128      update(Zyz.zp);
129      return (status);
130  }
131  
132  CMS_STATUS CMS::update(PM_EULER_ZYZ * x, int n)
133  {
134      int i;
135      for (i = 0; i < n; i++) {
136  	update(x[i]);
137      }
138      return (status);
139  }
140  
141  CMS_STATUS CMS::update(PM_EULER_ZYX & Zyx)
142  {
143      update(Zyx.z);
144      update(Zyx.y);
145      update(Zyx.x);
146      return (status);
147  }
148  
149  CMS_STATUS CMS::update(PM_EULER_ZYX * x, int n)
150  {
151      int i;
152      for (i = 0; i < n; i++) {
153  	update(x[i]);
154      }
155      return (status);
156  }
157  
158  CMS_STATUS CMS::update(PM_RPY & Rpy)
159  {
160      update(Rpy.r);
161      update(Rpy.p);
162      update(Rpy.y);
163      return (status);
164  }
165  
166  CMS_STATUS CMS::update(PM_RPY * x, int n)
167  {
168      int i;
169      for (i = 0; i < n; i++) {
170  	update(x[i]);
171      }
172      return (status);
173  }
174  
175    // pose types
176  CMS_STATUS CMS::update(PM_POSE & Pose)
177  {
178      update(Pose.tran);
179      update(Pose.rot);
180      return (status);
181  }
182  
183  CMS_STATUS CMS::update(PM_POSE * x, int n)
184  {
185      int i;
186      for (i = 0; i < n; i++) {
187  	update(x[i]);
188      }
189      return (status);
190  }
191  
192  CMS_STATUS CMS::update(PM_HOMOGENEOUS & Hom)
193  {
194      update(Hom.tran);
195      update(Hom.rot);
196      return (status);
197  }
198  
199  CMS_STATUS CMS::update(PM_HOMOGENEOUS * x, int n)
200  {
201      int i;
202      for (i = 0; i < n; i++) {
203  	update(x[i]);
204      }
205      return (status);
206  }