![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Generic color implementation with variable number of color components. More...
#include <CVarColor.h>
Public Types | |
typedef imath::CVarVector | BaseClass |
![]() | |
typedef std::vector< double > | Elements |
![]() | |
enum | ChangeFlags { CF_ICF_INTERNAL = 0 , CF_ALL_DATA , CF_ANY , CF_DESTROYING , CF_DELEGATED , CF_NO_UNDO } |
Data model change notification flags. More... | |
enum | SupportedOperations { SO_NONE = 0 , SO_OBSERVE = 1 << 0 , SO_COPY = 1 << 1 , SO_CLONE = 1 << 2 , SO_COMPARE = 1 << 3 , SO_RESET = 1 << 4 , SO_CHANGE_LOCK = 1 << 5 } |
Flags for supported operations. More... | |
enum | CompatibilityMode { CM_STRICT , CM_WITHOUT_REFS , CM_WITH_REFS , CM_CONVERT } |
Control how relationship betweeen objects are interpreted. More... | |
Public Member Functions | |
CVarColor () | |
Default constructor. | |
CVarColor (int componentsCount, double value=0) | |
Constructor with explicit initialization of number of elements. | |
CVarColor (const CVarColor &color) | |
Copy constructor. | |
template<int Size> | |
CVarColor (const imath::TVector< Size > &vector) | |
Template conversion constructor. | |
void | GetRounded (const imath::IDoubleManip &manipulator, CVarColor &result) |
Get color after components value rounding with specified precision. | |
bool | IsRoundedEqual (const CVarColor &color, const imath::IDoubleManip &manipulator) const |
Check if two values are equal after rounding. | |
bool | IsSimilar (const CVarColor &color, double tolerance=I_BIG_EPSILON) const |
Allows to compare two colors with tolerance. | |
bool | IsNormalized () const |
Check if this color value is normalized. | |
void | Normalize () |
Make this color to be normalized. | |
void | GetNormalized (CVarColor &result) const |
Get normalized color. | |
CVarColor | operator+ (const CVarColor &color) const |
CVarColor | operator- (const CVarColor &color) const |
CVarColor | operator* (const CVarColor &color) const |
CVarColor | operator/ (const CVarColor &color) const |
CVarColor | operator* (double value) const |
CVarColor | operator/ (double value) const |
CVarColor & | operator= (const CVarColor &color) |
const CVarColor & | operator+= (const CVarColor &color) |
const CVarColor & | operator-= (const CVarColor &color) |
const CVarColor & | operator*= (const CVarColor &color) |
const CVarColor & | operator/= (const CVarColor &color) |
const CVarColor & | operator*= (double value) |
const CVarColor & | operator/= (double value) |
bool | Serialize (iser::IArchive &archive) |
Load or store state of this object as a archive stream. | |
![]() | |
CVarVector () | |
Create the vector without components. | |
CVarVector (int componentsCount, double value=0) | |
Create vector and initialize number of components. | |
template<typename iterator > | |
CVarVector (iterator beginIter, iterator endIter) | |
Constructor with iterators. | |
CVarVector (const CVarVector &vector) | |
Copy constructor. | |
template<int Size> | |
CVarVector (const TVector< Size, double > &vector) | |
bool | IsEmpty () const |
Get true , if the element ist is empty. | |
int | GetElementsCount () const |
Get number of elements. | |
bool | SetElementsCount (int count, double value=0) |
Set number of elements. | |
double | GetElement (int index) const |
Get element at specified index. | |
double & | GetElementRef (int index) |
Get reference to element at specified index. | |
void | SetElement (int index, double value) |
Set element at specified index. | |
void | SetAllElements (double value) |
Set some value to all elements. | |
void | Reset () |
Set size to zero. | |
void | Reset (int elementsCount, double value) |
Set number of elements and set all elements to specified value. | |
void | Clear () |
Set all coordinates to zero. | |
void | SetElementsFrom (const CVarVector &vector, double expansionValue=0) |
Set elements from other vector without resizing. | |
const Elements & | GetElements () const |
Get read-only access to internal element container. | |
Elements & | GetElementsRef () |
Get access to internal element container. | |
bool | EnsureElementsCount (int count, double value=0) |
Ensure, that number of elements is at least the specified value. | |
void | Translate (const CVarVector &vector) |
Translate the point. | |
CVarVector | GetTranslated (const CVarVector &vector) |
Get translated point. | |
void | GetTranslated (const CVarVector &vector, CVarVector &result) |
/overloaded | |
void | ScaledCumulate (const CVarVector &vector, double scale) |
Add second vector scaled by specified factor. | |
bool | IsNull (double tolerance=I_BIG_EPSILON) const |
Check if this vector is null. | |
double | GetDotProduct (const CVarVector &vector) const |
Return dot product of two vectors. | |
double | GetLength2 () const |
Return euclidean length square. | |
double | GetLength () const |
Return euclidian length. | |
double | GetDistance2 (const CVarVector &vector) const |
Return distance square between two vectors. | |
double | GetDistance (const CVarVector &vector) const |
Return distance between two vectors. | |
double | GetElementsSum () const |
Get simple sum of all elements. | |
bool | Normalize (double length=1.0) |
Normalize vector to specified length. | |
bool | GetNormalized (CVarVector &result, double length=1.0) const |
Return normalized vector with the same direction and specified length. | |
void | GetMinimal (const CVarVector &vector, CVarVector &result) const |
Get vector with minimal elements values. | |
void | GetMaximal (const CVarVector &vector, CVarVector &result) const |
Get vector with maximal elements values. | |
bool | Serialize (iser::IArchive &archive) |
Serialize this vector to specified archive. | |
bool | operator== (const CVarVector &vector) const |
bool | operator!= (const CVarVector &vector) const |
bool | operator< (const CVarVector &vector) const |
bool | operator> (const CVarVector &vector) const |
bool | operator<= (const CVarVector &vector) const |
bool | operator>= (const CVarVector &vector) const |
CVarVector | operator- () const |
CVarVector | operator+ (const CVarVector &vector) const |
CVarVector | operator- (const CVarVector &vector) const |
CVarVector | operator* (double scalar) const |
CVarVector | operator/ (double scalar) const |
CVarVector & | operator+= (const CVarVector &vector) |
CVarVector & | operator-= (const CVarVector &vector) |
CVarVector & | operator*= (double scalar) |
CVarVector & | operator/= (double scalar) |
CVarVector & | operator= (const CVarVector &vector) |
double | operator[] (int i) const |
double & | operator[] (int i) |
![]() | |
virtual quint32 | GetMinimalVersion (int versionId) const |
Get minimal needed version to correct storing of this data. | |
![]() | |
virtual int | GetSupportedOperations () const |
Get set of flags for supported operations. | |
virtual bool | CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) |
Copy this object from another one. | |
virtual bool | IsEqual (const IChangeable &object) const |
Compare this object with another object. | |
virtual std::unique_ptr< IChangeable > | CloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const |
Make a copy of this object. | |
virtual bool | ResetData (CompatibilityMode mode=CM_WITHOUT_REFS) |
Reset data to its default state. | |
virtual QMutex * | GetChangesLock () const |
Get mutex beeing locked during changes, if available. | |
virtual void | BeginChanges (const ChangeSet &changeSet) |
Starts the change transaction. | |
virtual void | EndChanges (const ChangeSet &changeSet) |
Ends the change transaction. | |
virtual void | BeginChangeGroup (const ChangeSet &changeSet) |
Starts group of changes. | |
virtual void | EndChangeGroup (const ChangeSet &changeSet) |
Ends group of changes. | |
Additional Inherited Members | |
![]() | |
static const ChangeSet & | GetNoChanges () |
Get empty set of changes. | |
static const ChangeSet & | GetAnyChange () |
Get anonymous change set. | |
static const ChangeSet & | GetAllChanges () |
Get anonymous change set. | |
static const ChangeSet & | GetDelegatedChanges () |
Get delegated change set. | |
![]() | |
virtual void | OnBeginChanges () |
Callback function for begin change event. | |
virtual void | OnEndChanges (const ChangeSet &changeSet) |
Callback function for end change event. | |
Generic color implementation with variable number of color components.
The dimension of used colorspace can be set at the construction time of CVarColor object,
Definition at line 25 of file CVarColor.h.
Definition at line 28 of file CVarColor.h.
icmm::CVarColor::CVarColor | ( | ) |
Default constructor.
It set number of elements to 0.
|
explicit |
Constructor with explicit initialization of number of elements.
icmm::CVarColor::CVarColor | ( | const CVarColor & | color | ) |
Copy constructor.
|
inline |
Template conversion constructor.
Definition at line 50 of file CVarColor.h.
void icmm::CVarColor::GetNormalized | ( | CVarColor & | result | ) | const |
Get normalized color.
Normalized values have all components in the range [0, 1].
void icmm::CVarColor::GetRounded | ( | const imath::IDoubleManip & | manipulator, |
CVarColor & | result ) |
Get color after components value rounding with specified precision.
manipulator | manipulator object used to round single components. |
result | result object. |
|
inline |
Check if this color value is normalized.
Normalized values have all components in the range [0, 1].
Definition at line 123 of file CVarColor.h.
References imath::CVarVector::GetElement(), and imath::CVarVector::GetElementsCount().
bool icmm::CVarColor::IsRoundedEqual | ( | const CVarColor & | color, |
const imath::IDoubleManip & | manipulator ) const |
Check if two values are equal after rounding.
color | second color to comparision. |
manipulator | value manipulator used to round single components. |
|
inline |
Allows to compare two colors with tolerance.
Definition at line 117 of file CVarColor.h.
References imath::CVarVector::GetDistance().
void icmm::CVarColor::Normalize | ( | ) |
Make this color to be normalized.
Normalized values have all components in the range [0, 1].
Definition at line 159 of file CVarColor.h.
|
inline |
Definition at line 179 of file CVarColor.h.
References imath::CVarVector::GetElement(), imath::CVarVector::GetElementsCount(), and imath::CVarVector::SetElement().
|
inline |
Definition at line 207 of file CVarColor.h.
References imath::CVarVector::operator*=().
Definition at line 139 of file CVarColor.h.
Definition at line 149 of file CVarColor.h.
Definition at line 169 of file CVarColor.h.
|
inline |
Definition at line 193 of file CVarColor.h.
References imath::CVarVector::GetElement(), imath::CVarVector::GetElementsCount(), and imath::CVarVector::SetElement().
|
inline |
Definition at line 215 of file CVarColor.h.
References imath::CVarVector::operator/=().
|
virtual |
Load or store state of this object as a archive stream.
Type of operation is depending on archive type.
Implements iser::ISerializable.
© Witold Gantzke and Kirill Lepskiy