comparison src/Modules/Output/Graphics/GraphAxisSpec.cc @ 126:a9cb396529c2

- Added support for movies!
author tomwalters
date Thu, 21 Oct 2010 01:46:39 +0000
parents 18237d55e346
children 73c6d61440ad
comparison
equal deleted inserted replaced
125:bf1417b5d83e 126:a9cb396529c2
68 //! The following parameters are recognized for each axis: 68 //! The following parameters are recognized for each axis:
69 //! - \c "<prefix>.min", the minimum value; a float or \c 'auto' 69 //! - \c "<prefix>.min", the minimum value; a float or \c 'auto'
70 snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]), 70 snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]),
71 "%s.min", 71 "%s.min",
72 sPrefix); 72 sPrefix);
73 if (parameters->IsSet(sParamName)) { 73 if (strcmp(parameters->DefaultString(sParamName, "auto"), "auto") == 0)
74 if (strcmp(parameters->GetString(sParamName), "auto") == 0) 74 m_fMin = fMin;
75 m_fMin = fMin; 75 else
76 else 76 m_fMin = parameters->GetFloat(sParamName);
77 m_fMin = parameters->GetFloat(sParamName); 77
78 }
79 78
80 //! - \c "<prefix>.max", the maximum value; a float or \c 'auto' 79 //! - \c "<prefix>.max", the maximum value; a float or \c 'auto'
81 snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]), 80 snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]),
82 "%s.max", 81 "%s.max",
83 sPrefix); 82 sPrefix);
84 if (parameters->IsSet(sParamName)) { 83 if (strcmp(parameters->DefaultString(sParamName, "auto"), "auto")==0)
85 if (strcmp(parameters->GetString(sParamName), "auto")==0) 84 m_fMax = fMax;
86 m_fMax = fMax; 85 else
87 else 86 m_fMax = parameters->GetFloat(sParamName);
88 m_fMax = parameters->GetFloat(sParamName);
89 }
90 87
91 // Make sure ranges are updated properly 88 // Make sure ranges are updated properly
92 SetDisplayRange(m_fMin, m_fMax); 89 SetDisplayRange(m_fMin, m_fMax);
93 90
94 //! - \c "<prefix>.scale", the scale; one of \c 'auto', 91 //! - \c "<prefix>.scale", the scale; one of \c 'auto',
95 //! \c 'linear', \c 'erb' or \c 'log' 92 //! \c 'linear', \c 'erb' or \c 'log'
96 snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]), 93 snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]),
97 "%s.scale", 94 "%s.scale",
98 sPrefix); 95 sPrefix);
99 if (parameters->IsSet(sParamName)) { 96 // Scale change, we updated min/max values already so no need to
100 // Scale change, we updated min/max values already so no need to 97 Scale::ScaleType iThisScale;
101 Scale::ScaleType iThisScale; 98 const char *sVal = parameters->DefaultString(sParamName, "auto");
102 const char *sVal = parameters->GetString(sParamName); 99 if (strcmp(sVal, "auto")==0)
103 if (strcmp(sVal, "auto")==0) 100 iThisScale = iScale;
104 iThisScale = iScale; 101 else if (strcmp(sVal, "linear")==0)
105 else if (strcmp(sVal, "linear")==0) 102 iThisScale = Scale::SCALE_LINEAR;
106 iThisScale = Scale::SCALE_LINEAR; 103 else if (strcmp(sVal, "erb")==0)
107 else if (strcmp(sVal, "erb")==0) 104 iThisScale = Scale::SCALE_ERB;
108 iThisScale = Scale::SCALE_ERB; 105 else if (strcmp(sVal, "log")==0)
109 else if (strcmp(sVal, "log")==0) 106 iThisScale = Scale::SCALE_LOG;
110 iThisScale = Scale::SCALE_LOG; 107 else {
111 else { 108 LOG_ERROR(_T("Unrecognized scale type in parameter '%s': '%s'"),
112 LOG_ERROR(_T("Unrecognized scale type in parameter '%s': '%s'"), 109 sParamName,
113 sParamName, 110 sVal);
114 sVal); 111 return false;
115 return false;
116 }
117 SetDisplayScale(iThisScale);
118 } 112 }
113 SetDisplayScale(iThisScale);
114
119 115
120 //! - \c "<prefix>.label", the label; a string 116 //! - \c "<prefix>.label", the label; a string
121 snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]), 117 snprintf(sParamName, sizeof(sParamName)/sizeof(sParamName[0]),
122 "%s.label", 118 "%s.label",
123 sPrefix); 119 sPrefix);
124 if (parameters->IsSet(sParamName)) 120 m_sLabel = parameters->DefaultString(sParamName, ""); // Assumes strings remains valid
125 m_sLabel = parameters->GetString(sParamName); // Assumes strings remains valid
126 121
127 return true; 122 return true;
128 } 123 }
129 } // namespace aimc 124 } // namespace aimc