parameters: (inParaViewDataRepresentation, inPhactoriRepresentation, inVariableName, inVariableArrayType, inColorMapSettings)
docstring: Set the scalar variable (by name) which will be used to color the data\n     presentation.
docstring_summary: Set the scalar variable (by name) which will be used to color the data\n     presentation.
docstring_tokens: Set the scalar variable ( by name ) which will be used to color the data \ n presentation .
function: def ColorByVariableScalarXX(inParaViewDataRepresentation, inPhactoriRepresentation, inVariableName, inVariableArrayType, inColorMapSettings):
    "Set the scalar variable (by name) which will be used to color the data\n     presentation."
    if gParaViewCatalystVersionFlag >= 40300:
      #for paraview 4.3
      if inVariableArrayType == None:
        myDebugPrint3AndException(\
          "ColorByVariableComponentOrMagnitudeXX "
          "expecting inVariableArrayType\n")
      if PhactoriDbg():
        myDebugPrint3("using ColorBy() to set color var " + \
          inVariableName + "  " + inVariableArrayType + " 3\n")
      inParaViewDataRepresentation.RescaleTransferFunctionToDataRange(False)
      SafeColorBy(inParaViewDataRepresentation,
          (inVariableArrayType, inVariableName))
      inParaViewDataRepresentation.RescaleTransferFunctionToDataRange(False)
      #need to deal with color table
      myRGBPoints, myColorSpace, myNanColor = \
          GetColorMapInfoFromColorLegendCollection(inColorMapSettings,
              -1.0, 1.0)
      pv_4_3_LUT = GetColorTransferFunction(inVariableName)
      pv_4_3_LUT.RGBPoints = myRGBPoints
      pv_4_3_LUT.ColorSpace = myColorSpace
      pv_4_3_LUT.NanColor = myNanColor
      return
  
    #rest of function for paraview 4.1
  
    inParaViewDataRepresentation.ColorArrayName = inVariableName
    if inVariableArrayType != None:
      inParaViewDataRepresentation.ColorAttributeType = inVariableArrayType
  
    new_var_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 1.0, 1.0] )
  
    myRGBPoints, myColorSpace, myNanColor = \
        GetColorMapInfoFromColorLegendCollection(inColorMapSettings,
            0.0, 1647.1430997030882)
  
    new_var_PVLookupTable = GetLookupTableForArray( inVariableName, 3, Discretize=1, RGBPoints= myRGBPoints, UseLogScale=0, VectorComponent=0, NanColor=myNanColor, NumberOfTableValues=1024, ColorSpace=myColorSpace, VectorMode='Magnitude', HSVWrap=0, ScalarRangeInitialized=1.0, LockScalarRange=0 )
    if PhactoriDbg():
      myDebugPrint3("new lookup table (1):\n");
    if PhactoriDbg():
      myDebugPrint3(str(new_var_PVLookupTable) + "\n")
    if PhactoriDbg():
      myDebugPrint3("RGBPoints:\n");
    if PhactoriDbg():
      myDebugPrint3(str(new_var_PVLookupTable.RGBPoints) + "\n")
  
    if PhactoriDbg():
      myDebugPrint3(str(inParaViewDataRepresentation) + '\n')
    try:
      inParaViewDataRepresentation.ScalarOpacityFunction = new_var_PiecewiseFunction
    except:
      if PhactoriDbg():
        myDebugPrint3('no inParaViewDataRepresentation.ScalarOpacityFunction\n');
    if PhactoriDbg():
      myDebugPrint3('new or reused lookup table: ' + str(new_var_PVLookupTable) + '\n')
    if PhactoriDbg():
      myDebugPrint3('prior inParaViewDataRepresentation.DataRepresentation.LookupTable: ' + str(inParaViewDataRepresentation.LookupTable) + '\n')
    inParaViewDataRepresentation.LookupTable = new_var_PVLookupTable
    if PhactoriDbg():
      myDebugPrint3(str(new_var_PVLookupTable))
    if PhactoriDbg():
      myDebugPrint3(str(new_var_PVLookupTable.RGBPoints))
    if PhactoriDbg():
      myDebugPrint3(str(inParaViewDataRepresentation) + '\n')
function_tokens: def ColorByVariableScalarXX ( inParaViewDataRepresentation , inPhactoriRepresentation , inVariableName , inVariableArrayType , inColorMapSettings ) : if gParaViewCatalystVersionFlag >= 40300 : #for paraview 4.3 if inVariableArrayType == None : myDebugPrint3AndException ( "ColorByVariableComponentOrMagnitudeXX " "expecting inVariableArrayType\n" ) if PhactoriDbg ( ) : myDebugPrint3 ( "using ColorBy() to set color var " + inVariableName + "  " + inVariableArrayType + " 3\n" ) inParaViewDataRepresentation . RescaleTransferFunctionToDataRange ( False ) SafeColorBy ( inParaViewDataRepresentation , ( inVariableArrayType , inVariableName ) ) inParaViewDataRepresentation . RescaleTransferFunctionToDataRange ( False ) #need to deal with color table myRGBPoints , myColorSpace , myNanColor = GetColorMapInfoFromColorLegendCollection ( inColorMapSettings , - 1.0 , 1.0 ) pv_4_3_LUT = GetColorTransferFunction ( inVariableName ) pv_4_3_LUT . RGBPoints = myRGBPoints pv_4_3_LUT . ColorSpace = myColorSpace pv_4_3_LUT . NanColor = myNanColor return #rest of function for paraview 4.1 inParaViewDataRepresentation . ColorArrayName = inVariableName if inVariableArrayType != None : inParaViewDataRepresentation . ColorAttributeType = inVariableArrayType new_var_PiecewiseFunction = CreatePiecewiseFunction ( Points = [ 0.0 , 0.0 , 1.0 , 1.0 ] ) myRGBPoints , myColorSpace , myNanColor = GetColorMapInfoFromColorLegendCollection ( inColorMapSettings , 0.0 , 1647.1430997030882 ) new_var_PVLookupTable = GetLookupTableForArray ( inVariableName , 3 , Discretize = 1 , RGBPoints = myRGBPoints , UseLogScale = 0 , VectorComponent = 0 , NanColor = myNanColor , NumberOfTableValues = 1024 , ColorSpace = myColorSpace , VectorMode = 'Magnitude' , HSVWrap = 0 , ScalarRangeInitialized = 1.0 , LockScalarRange = 0 ) if PhactoriDbg ( ) : myDebugPrint3 ( "new lookup table (1):\n" ) if PhactoriDbg ( ) : myDebugPrint3 ( str ( new_var_PVLookupTable ) + "\n" ) if PhactoriDbg ( ) : myDebugPrint3 ( "RGBPoints:\n" ) if PhactoriDbg ( ) : myDebugPrint3 ( str ( new_var_PVLookupTable . RGBPoints ) + "\n" ) if PhactoriDbg ( ) : myDebugPrint3 ( str ( inParaViewDataRepresentation ) + '\n' ) try : inParaViewDataRepresentation . ScalarOpacityFunction = new_var_PiecewiseFunction except : if PhactoriDbg ( ) : myDebugPrint3 ( 'no inParaViewDataRepresentation.ScalarOpacityFunction\n' ) if PhactoriDbg ( ) : myDebugPrint3 ( 'new or reused lookup table: ' + str ( new_var_PVLookupTable ) + '\n' ) if PhactoriDbg ( ) : myDebugPrint3 ( 'prior inParaViewDataRepresentation.DataRepresentation.LookupTable: ' + str ( inParaViewDataRepresentation . LookupTable ) + '\n' ) inParaViewDataRepresentation . LookupTable = new_var_PVLookupTable if PhactoriDbg ( ) : myDebugPrint3 ( str ( new_var_PVLookupTable ) ) if PhactoriDbg ( ) : myDebugPrint3 ( str ( new_var_PVLookupTable . RGBPoints ) ) if PhactoriDbg ( ) : myDebugPrint3 ( str ( inParaViewDataRepresentation ) + '\n' )