summaryrefslogtreecommitdiff
path: root/src/Vrml/Vrml_TextureCoordinate2.cxx
blob: 78ce06c19bbf51928e2dc9296945c3021a8a3dcb (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
#include <Vrml_TextureCoordinate2.ixx>

Vrml_TextureCoordinate2::Vrml_TextureCoordinate2()
{
  gp_Vec2d tmpVec(0,0);
  myPoint = new TColgp_HArray1OfVec2d(1,1,tmpVec);
}

Vrml_TextureCoordinate2::Vrml_TextureCoordinate2(const Handle(TColgp_HArray1OfVec2d)& aPoint)
{
  myPoint = aPoint;
}

 void Vrml_TextureCoordinate2::SetPoint(const Handle(TColgp_HArray1OfVec2d)& aPoint) 
{
  myPoint = aPoint;
}

 Handle(TColgp_HArray1OfVec2d) Vrml_TextureCoordinate2::Point() const
{
  return myPoint;
}

 Standard_OStream& Vrml_TextureCoordinate2::Print(Standard_OStream& anOStream) const
{
 Standard_Integer i;
 anOStream  << "TextureCoordinate2 {" << endl;

 if ( myPoint->Length() != 1 || Abs(myPoint->Value(myPoint->Lower()).X() - 0) > 0.0001 || 
                                Abs(myPoint->Value(myPoint->Lower()).Y() - 0) > 0.0001 )
  { 
   anOStream  << "    point [" << endl << '\t';
    for ( i = myPoint->Lower(); i <= myPoint->Upper(); i++ )
	{
	 anOStream << myPoint->Value(i).X() << ' ' << myPoint->Value(i).Y();

         if ( i < myPoint->Length() )
	    anOStream  << ',' << endl << '\t';
	}
    anOStream  << " ]" << endl;
  }
  anOStream  << '}' << endl;
 return anOStream;
}