B
Brice Rebsamen
I would like to work with points in space:
Point2D : (x,y)
Point3D : (x,y,z)
Pos2D : (x,y,yaw)
Pos6D : (x,y,z,roll,pitch,yaw)
what would be nice is that I can pass a Pos6D to a function that takes
a Point3D as argument. What would be the best way of doing that?
Possibilities I can see are:
1) Point2D is base class of Pos2D which is base class of Pos6D. That's
what I was doing untill I introduced the Point3D class. If Point3D
inherits from Point2D and If Pos6D inherits from both Point3D and
Pos2D then there is ambiguity. Can I solve that?
2) make this classes independent and define constructors and cast
operator to convert between them?
Thanks
Brice
Point2D : (x,y)
Point3D : (x,y,z)
Pos2D : (x,y,yaw)
Pos6D : (x,y,z,roll,pitch,yaw)
what would be nice is that I can pass a Pos6D to a function that takes
a Point3D as argument. What would be the best way of doing that?
Possibilities I can see are:
1) Point2D is base class of Pos2D which is base class of Pos6D. That's
what I was doing untill I introduced the Point3D class. If Point3D
inherits from Point2D and If Pos6D inherits from both Point3D and
Pos2D then there is ambiguity. Can I solve that?
2) make this classes independent and define constructors and cast
operator to convert between them?
Thanks
Brice