120 virtual bool IsEqual(
const IChangeable&
object)
const override;
125 typedef std::vector<double> SamplesContainer;
126 SamplesContainer m_samplesContainer;
135 Q_ASSERT(index>= 0 && index < m_samplesContainer.size());
137 return m_samplesContainer[index];
143 Q_ASSERT(index >= 0 && index < m_samplesContainer.size());
145 m_samplesContainer[index] = value;
151 m_logicalRange = logicalRange;
157 if (m_samplesContainer.size() >= 2){
158 return m_logicalRange.
GetLength() / (m_samplesContainer.size() - 1);
167 Q_ASSERT(m_samplesContainer.size() > 0);
168 Q_ASSERT(0 <= index);
169 Q_ASSERT(index < m_samplesContainer.size());
171 return m_logicalRange.
GetValueFromAlpha(
double(index) /
double(m_samplesContainer.size() - 1));
Implementation of 1D sampled function with uniform sampling grid.
CSampledFunction(const imath::ISampledFunction &function)
CSampledFunction(const CSampledFunction &function)
virtual bool CreateFunction(double *dataPtr, const ArgumentType &sizes) override
Create function from input data.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
virtual istd::CRange GetLogicalRange(int dimensionIndex) const override
Get logical range for the specified dimension.
double GetSamplingStep() const
virtual int GetSupportedOperations() const override
Get set of flags for supported operations.
double GetSampleCoordinate(int index) const
bool operator==(const CSampledFunction &other) const
virtual istd::IChangeableUniquePtr CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
virtual std::vector< double > GetSamples() const override
Get all samples as a vector.
virtual bool IsEqual(const IChangeable &object) const override
virtual double GetSampleAt(const SampleIndex &index) const override
Get sample value at the given index.
virtual ResultType GetValueAt(const ArgumentType &argument) const override
virtual bool ResetData(CompatibilityMode mode=CM_WITHOUT_REFS) override
Reset data to its default state.
void SetSampleValue(int index, double value)
virtual int GetGridSize(int dimensionIndex) const override
Get number of samples for specified dimension.
bool Initialize(int size, double defaultValue=0)
virtual bool GetValueAt(const ArgumentType &argument, ResultType &result) const override
CSampledFunction(int size, double defaultValue=0)
virtual int GetTotalSamplesCount() const override
Get number of samples stored in this container.
void SetLogicalRange(const istd::CRange &logicalRange)
virtual istd::CRange GetResultValueRange(int dimensionIndex, int resultDimension=-1) const override
Get the range (boundary) of possible result values for the given axis.
double GetSampleValue(int index) const
BaseClass::ResultType ResultType
BaseClass::ArgumentType ArgumentType
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Multidimensional index used to addressing fixed-size array.
ValueType GetLength() const
Get length of this range.
ValueType GetValueFromAlpha(double alpha) const
Get value based on 'alpha' factor.
Package with mathematical functions and algebraical primitives.