View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002903VTK(No Category)public2006-02-22 11:242013-04-05 19:57
ReporterRandall Hand 
Assigned ToZhanping Liu 
PriorityurgentSeverityminorReproducibilityalways
StatusclosedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002903: vtkArrayCalculator does not support Cross Products
Descriptionthe existing vtkArrayCalculator (in both VTK & ParaView) does not support computation of Cross Products. As this is important in my work, I modified the Common/vtkFunctionParser.cxx/h to support a "cross" function that takes 2 vectors as input.
TagsNo tags attached.
Project
Type
Attached Filescxx file icon vtkFunctionParser.cxx [^] (58,630 bytes) 1969-12-31 19:00
? file icon vtkFunctionParser.h [^] (8,616 bytes) 1969-12-31 19:00

 Relationships

  Notes
(0013828)
Zhanping Liu (developer)
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

 Issue History
Date Modified Username Field Change
2008-09-25 15:29 Berk Geveci Assigned To Mathieu Malaterre => Zhanping Liu
2008-10-09 18:40 Zhanping Liu Note Added: 0013828
2008-10-09 18:42 Zhanping Liu Status tabled => @80@
2008-10-09 18:42 Zhanping Liu Description Updated
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2013-04-05 19:57 Berk Geveci Status customer review => closed


Copyright © 2000 - 2018 MantisBT Team