|
(0013828)
|
|
Zhanping Liu
|
|
2008-10-09 18:40
|
|
randall.hand once suggested the addition of the support for the vector cross product operator. It was added some time later. Then some new operators such as boolean ones were added and during this process unfortunately the vector cross product operator was carelessly disabled due to the incorrect check on the number of the input parameters.
The correct format of a vector cross product operation is:
====================================
vector_C = cross(vector_A, vector_B)
====================================
INSTEAD OF
====================================
cross(vector_A, vector_B, vector_C)
====================================
In other words, there should be TWO parameters and ONE comma.
However, the bug in vtkFunctionParser:: CheckSyntax() occurred within the following segment (between line 1444 and line 1453):
============================================================
if ((functionNumber == VTK_PARSER_MIN) ||
(functionNumber == VTK_PARSER_MAX))
{
expectCommaOnParenthesisCount[parenthesisCount+1] = 1;
}
if ((functionNumber == VTK_PARSER_IF) ||
(functionNumber == VTK_PARSER_CROSS))
{
expectTwoCommasOnParenthesisCount[parenthesisCount+1] = 1;
}
============================================================
Now this segment has been replaced with
============================================================
if ((functionNumber == VTK_PARSER_MIN) ||
(functionNumber == VTK_PARSER_MAX) ||
(functionNumber == VTK_PARSER_CROSS))
{
expectCommaOnParenthesisCount[parenthesisCount+1] = 1;
}
if (functionNumber == VTK_PARSER_IF)
{
expectTwoCommasOnParenthesisCount[parenthesisCount+1] = 1;
}
============================================================
Now the code performs correct check on the input format in terms of vector cross product and the suggested functionality is supported.
Thanks for suggesting the enhancement.
new revision: 1.43; previous revision: 1.42 |
|