------------------------------------------------------------------------------ Description: Reorder vertices `v' in increasing order in `w'. Return if the orientation has changed.
| 2931 | // Reorder vertices `v' in increasing order in `w'. Return if the orientation |
| 2932 | // has changed. |
| 2933 | int vtkUnstructuredGridVolumeZSweepMapper::ReorderTriangle(vtkIdType v[3], vtkIdType w[3]) |
| 2934 | { |
| 2935 | if (v[0] > v[1]) |
| 2936 | { |
| 2937 | if (v[1] > v[2]) |
| 2938 | { |
| 2939 | // v[2] is the min |
| 2940 | w[0] = v[2]; |
| 2941 | w[1] = v[0]; |
| 2942 | w[2] = v[1]; |
| 2943 | } |
| 2944 | else |
| 2945 | { |
| 2946 | // v[1] is the min |
| 2947 | w[0] = v[1]; |
| 2948 | w[1] = v[2]; |
| 2949 | w[2] = v[0]; |
| 2950 | } |
| 2951 | } |
| 2952 | else |
| 2953 | { |
| 2954 | if (v[0] > v[2]) |
| 2955 | { |
| 2956 | // v[2] is the min |
| 2957 | w[0] = v[2]; |
| 2958 | w[1] = v[0]; |
| 2959 | w[2] = v[1]; |
| 2960 | } |
| 2961 | else |
| 2962 | { |
| 2963 | // v[0] is the min |
| 2964 | w[0] = v[0]; |
| 2965 | w[1] = v[1]; |
| 2966 | w[2] = v[2]; |
| 2967 | } |
| 2968 | } |
| 2969 | // At this point the triangle start with the min id and the |
| 2970 | // order did not change |
| 2971 | // Now, ensure that the two last id are in increasing order |
| 2972 | int result = w[1] > w[2]; |
| 2973 | if (result) |
| 2974 | { |
| 2975 | vtkIdType tmp = w[1]; |
| 2976 | w[1] = w[2]; |
| 2977 | w[2] = tmp; |
| 2978 | } |
| 2979 | return result; |
| 2980 | } |
| 2981 | |
| 2982 | //------------------------------------------------------------------------------ |
| 2983 | void vtkUnstructuredGridVolumeZSweepMapper::ProjectAndSortVertices(vtkRenderer* ren, vtkVolume* vol) |