- Timestamp:
- Sep 13, 2011 8:46:12 AM (13 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpStreamlines.cpp
r2507 r2510 461 461 462 462 _streamTracer->SetInput(ds); 463 _streamTracer->SetMaximumPropagation(maxBound); 463 _streamTracer->SetMaximumPropagation(2.0 * maxBound / avgSize); 464 _streamTracer->SetIntegratorTypeToRungeKutta45(); 464 465 465 466 if (_pdMapper == NULL) { … … 953 954 954 955 /** 955 * \brief Set maximum length of stream lines in world coordinates 956 * \brief Set the integration method used 957 */ 958 void Streamlines::setIntegrator(IntegratorType integrator) 959 { 960 if (_streamTracer != NULL) { 961 switch (integrator) { 962 case RUNGE_KUTTA2: 963 _streamTracer->SetIntegratorTypeToRungeKutta2(); 964 break; 965 case RUNGE_KUTTA4: 966 _streamTracer->SetIntegratorTypeToRungeKutta4(); 967 break; 968 case RUNGE_KUTTA45: 969 _streamTracer->SetIntegratorTypeToRungeKutta45(); 970 break; 971 default: 972 ; 973 } 974 } 975 } 976 977 /** 978 * \brief Set the direction of integration 979 */ 980 void Streamlines::setIntegrationDirection(IntegrationDirection dir) 981 { 982 if (_streamTracer != NULL) { 983 switch (dir) { 984 case FORWARD: 985 _streamTracer->SetIntegrationDirectionToForward(); 986 break; 987 case BACKWARD: 988 _streamTracer->SetIntegrationDirectionToBackward(); 989 break; 990 case BOTH: 991 _streamTracer->SetIntegrationDirectionToBoth(); 992 break; 993 default: 994 ; 995 } 996 } 997 } 998 999 /** 1000 * \brief Set the step size units. Length units are world 1001 * coordinates, and cell units means steps are from cell to 1002 * cell. Default is cell units 1003 */ 1004 void Streamlines::setIntegrationStepUnit(StepUnit unit) 1005 { 1006 if (_streamTracer != NULL) { 1007 switch (unit) { 1008 case LENGTH_UNIT: 1009 _streamTracer->SetIntegrationStepUnit(vtkStreamTracer::LENGTH_UNIT); 1010 break; 1011 case CELL_LENGTH_UNIT: 1012 _streamTracer->SetIntegrationStepUnit(vtkStreamTracer::CELL_LENGTH_UNIT); 1013 break; 1014 default: 1015 ; 1016 } 1017 } 1018 } 1019 1020 /** 1021 * \brief Set initial step size for adaptive step integrator in 1022 * step units (see setIntegrationStepUnit). For non-adaptive 1023 * integrators, this is the fixed step size. 1024 */ 1025 void Streamlines::setInitialIntegrationStep(double step) 1026 { 1027 if (_streamTracer != NULL) { 1028 _streamTracer->SetInitialIntegrationStep(step); 1029 } 1030 } 1031 1032 /** 1033 * \brief Set minimum step for adaptive step integrator in 1034 * step units (see setIntegrationStepUnit) 1035 */ 1036 void Streamlines::setMinimumIntegrationStep(double step) 1037 { 1038 if (_streamTracer != NULL) { 1039 _streamTracer->SetMinimumIntegrationStep(step); 1040 } 1041 } 1042 1043 /** 1044 * \brief Set maximum step for adaptive step integrator in 1045 * step units (see setIntegrationStepUnit) 1046 */ 1047 void Streamlines::setMaximumIntegrationStep(double step) 1048 { 1049 if (_streamTracer != NULL) { 1050 _streamTracer->SetMaximumIntegrationStep(step); 1051 } 1052 } 1053 1054 /** 1055 * \brief Set maximum error tolerance 1056 */ 1057 void Streamlines::setMaximumError(double error) 1058 { 1059 if (_streamTracer != NULL) { 1060 _streamTracer->SetMaximumError(error); 1061 } 1062 } 1063 1064 /** 1065 * \brief Set maximum length of stream lines in integration 1066 * step units (see setIntegrationStepUnit) 956 1067 */ 957 1068 void Streamlines::setMaxPropagation(double length) … … 959 1070 if (_streamTracer != NULL) { 960 1071 _streamTracer->SetMaximumPropagation(length); 1072 } 1073 } 1074 1075 /** 1076 * \brief Set maximum number of integration steps 1077 */ 1078 void Streamlines::setMaxNumberOfSteps(int steps) 1079 { 1080 if (_streamTracer != NULL) { 1081 _streamTracer->SetMaximumNumberOfSteps(steps); 1082 } 1083 } 1084 1085 /** 1086 * \brief Set the minimum speed before integration stops 1087 */ 1088 void Streamlines::setTerminalSpeed(double speed) 1089 { 1090 if (_streamTracer != NULL) { 1091 _streamTracer->SetTerminalSpeed(speed); 961 1092 } 962 1093 } -
trunk/packages/vizservers/vtkvis/RpStreamlines.h
r2507 r2510 44 44 COLOR_CONSTANT 45 45 }; 46 enum StepUnit { 47 LENGTH_UNIT, 48 CELL_LENGTH_UNIT 49 }; 50 enum IntegratorType { 51 RUNGE_KUTTA2, 52 RUNGE_KUTTA4, 53 RUNGE_KUTTA45 54 }; 55 enum IntegrationDirection { 56 FORWARD, 57 BACKWARD, 58 BOTH 59 }; 46 60 47 61 Streamlines(); … … 98 112 int numSides, int numPoints); 99 113 114 void setIntegrator(IntegratorType integrator); 115 116 void setIntegrationDirection(IntegrationDirection dir); 117 118 void setIntegrationStepUnit(StepUnit unit); 119 120 void setInitialIntegrationStep(double step); 121 122 void setMinimumIntegrationStep(double step); 123 124 void setMaximumIntegrationStep(double step); 125 126 void setMaximumError(double error); 127 100 128 void setMaxPropagation(double length); 129 130 void setMaxNumberOfSteps(int steps); 131 132 void setTerminalSpeed(double speed); 101 133 102 134 void setLineTypeToLines();
Note: See TracChangeset
for help on using the changeset viewer.