Integration of OCCT 6.5.0 from SVN
[occt.git] / src / Aspect / Aspect_IndexPixel.cxx
CommitLineData
7fd59977 1
2#include <stdio.h>
3
4#include <Standard_Stream.hxx>
5#include <Aspect_IndexPixel.ixx>
6
7Aspect_IndexPixel::Aspect_IndexPixel () {
8
9 myIndex = 0;
10
11}
12
13Aspect_IndexPixel::Aspect_IndexPixel (const Standard_Integer anIndex) {
14
15 myIndex = anIndex;
16
17}
18
19Standard_Integer Aspect_IndexPixel::Value() const {
20
21return myIndex;
22
23}
24
25
26void Aspect_IndexPixel::SetValue(const Standard_Integer anIndex) {
27
28 myIndex = anIndex;
29
30}
31
32void Aspect_IndexPixel::Print(Standard_OStream& s) const
33
34{
35 s << dec << setw(4) << myIndex;
36}
37
38// ------------------------------------------------------------------
39// Hascode : Computes a hascoding value for a given Aspect_IndexPixel
40// ------------------------------------------------------------------
41Standard_Integer Aspect_IndexPixel::HashCode(const Standard_Integer Upper) const
42{
43 return ( myIndex % Upper ) + 1 ;
44}
45
46
47Standard_Boolean Aspect_IndexPixel::IsEqual(const Aspect_IndexPixel& Other) const
48{
49 return (myIndex == Other.myIndex);
50}
51
52Standard_Boolean Aspect_IndexPixel::IsNotEqual(const Aspect_IndexPixel& Other) const
53{
54 return !IsEqual(Other);
55}