Is it possible to in a VuoGenericType situation filter the type so that we can use boolean operators to decide whether there is an y/z/w value using an if statement?
What you can do is write (or find already written) different versions of a function that apply to each type. For example, if adding two points, you could call VuoGenericType1_add which will call VuoPoint2d_add or VuoPoint3d_add or VuoPoint4d_add depending on the type substituted in for VuoGenericType1.
I guess you could even write a group of functions like this to check the data type you're working with:
So you're probably better off writing/using higher-level functions like VuoPoint*d_add that don't just check for the existence of a certain coordinate, but actually accomplish whatever you need to do based on that check.
Or another option would be to eschew generic types and instead implement a separate version of the node class for each data type, like vuo.point.get.VuoPoint2d and vuo.point.get.VuoPoint3d and vuo.point.get.VuoPoint4d.
Comments
Not exactly.
Not exactly.
What you can do is write (or find already written) different versions of a function that apply to each type. For example, if adding two points, you could call
VuoGenericType1_add
which will callVuoPoint2d_add
orVuoPoint3d_add
orVuoPoint4d_add
depending on the type substituted in forVuoGenericType1
.I guess you could even write a group of functions like this to check the data type you're working with:
Although then what do you do with that information? The following would not work:
So you're probably better off writing/using higher-level functions like
VuoPoint*d_add
that don't just check for the existence of a certain coordinate, but actually accomplish whatever you need to do based on that check.Or another option would be to eschew generic types and instead implement a separate version of the node class for each data type, like
vuo.point.get.VuoPoint2d
andvuo.point.get.VuoPoint3d
andvuo.point.get.VuoPoint4d
.