When merging geometries, tests if two arrays can be merged, regarding to their number of components, and the number of vertices.
| 1092 | |
| 1093 | /// When merging geometries, tests if two arrays can be merged, regarding to their number of components, and the number of vertices. |
| 1094 | bool isArrayCompatible(unsigned int numVertice1, unsigned int numVertice2, const osg::Array* compare1, const osg::Array* compare2) |
| 1095 | { |
| 1096 | // Sumed up truth table: |
| 1097 | // If array (1 or 2) not empty and vertices empty => error, should not happen (allows simplification in formulae below) |
| 1098 | // If one side has both vertices and array, and the other side has only vertices => then arrays cannot be merged |
| 1099 | // Else, arrays can be merged |
| 1100 | //assert(numVertice1 || !getSize(compare1)); |
| 1101 | //assert(numVertice2 || !getSize(compare2)); |
| 1102 | return !( (numVertice1 && !getSize(compare1) && getSize(compare2)) |
| 1103 | || (numVertice2 && !getSize(compare2) && getSize(compare1)) ); |
| 1104 | } |
| 1105 | |
| 1106 | /// Return true only if both geometries have same array type and if arrays (such as TexCoords) are compatible (i.e. both empty or both filled) |
| 1107 | bool isAbleToMerge(const osg::Geometry& g1, const osg::Geometry& g2) |
no test coverage detected