summaryrefslogtreecommitdiff
path: root/src/Vrml/Vrml_SFImage.cxx
blob: 3c4b58c2a2bbae8151283dee8bf6145e9fb43e77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <Vrml_SFImage.ixx>

 Vrml_SFImage::Vrml_SFImage()
{
  myArray = new TColStd_HArray1OfInteger(1,1);
  myArrayFlag = Standard_False;
}
 Vrml_SFImage::Vrml_SFImage(const Standard_Integer aWidth, 
			    const Standard_Integer aHeight, 
			    const Vrml_SFImageNumber aNumber,
			    const Handle(TColStd_HArray1OfInteger)& anArray)
{
  Standard_Integer size = aWidth*aHeight;
  if (anArray->Length() != size)
    {
      Standard_Failure::Raise("The size of Array is no equal (aWidth*aHeight)");
    }
  myWidth  = aWidth;
  myHeight = aHeight;
  myNumber = aNumber;
  myArray  = anArray;
  myArrayFlag = Standard_True;
}

void Vrml_SFImage::SetWidth(const Standard_Integer aWidth)
{
  myWidth  =  aWidth;
}

Standard_Integer Vrml_SFImage::Width() const 
{
  return myWidth;
}

void Vrml_SFImage::SetHeight(const Standard_Integer aHeight)
{
  myHeight = aHeight;
}

Standard_Integer Vrml_SFImage::Height() const 
{
  return myHeight;
}

void Vrml_SFImage::SetNumber(const Vrml_SFImageNumber aNumber)
{
  myNumber = aNumber;
}

Vrml_SFImageNumber Vrml_SFImage::Number() const 
{
  return myNumber;
}

void Vrml_SFImage::SetArray(const Handle(TColStd_HArray1OfInteger)& anArray)
{
  Standard_Integer size = myWidth*myHeight;
  if (anArray->Length() != size)
    {
      Standard_Failure::Raise("The size of Array is no equal (aWidth*aHeight)");
      }
  myArray = anArray; 
  myArrayFlag = Standard_True;
}

Standard_Boolean Vrml_SFImage::ArrayFlag() const
{
 return myArrayFlag;
}
Handle(TColStd_HArray1OfInteger) Vrml_SFImage::Array() const 
{
 return myArray;
}