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

Vrml_Coordinate3::Vrml_Coordinate3(const Handle(TColgp_HArray1OfVec)& aPoint)
{
 myPoint = aPoint;
}

 Vrml_Coordinate3::Vrml_Coordinate3()
{
 gp_Vec Tmp_Vec;
 
 myPoint = new TColgp_HArray1OfVec(1,1);
 Tmp_Vec.SetX(0); Tmp_Vec.SetY(0); Tmp_Vec.SetZ(0);
 myPoint->SetValue (1,Tmp_Vec);
}

void Vrml_Coordinate3::SetPoint(const Handle(TColgp_HArray1OfVec)& aPoint)
{
 myPoint = aPoint;
}

Handle(TColgp_HArray1OfVec) Vrml_Coordinate3::Point() const 
{
 return myPoint;
}

Standard_OStream& Vrml_Coordinate3::Print(Standard_OStream& anOStream) const 
{
 Standard_Integer i;
 
 anOStream  << "Coordinate3 {" << endl;
 
 i = myPoint->Lower();
 if (  myPoint->Length() == 1 && Abs(myPoint->Value(i).X() - 0) < 0.0001 
                              && Abs(myPoint->Value(i).Y() - 0) < 0.0001 
                              && Abs(myPoint->Value(i).Z() - 0) < 0.0001 )
   {
    anOStream << '}' << endl;
    return anOStream;
   }
 else
   {
    anOStream  << "    point [" << endl << '\t';
    for ( i = myPoint->Lower(); i <= myPoint->Upper(); i++ )
	{
	 anOStream << myPoint->Value(i).X() << ' ' << myPoint->Value(i).Y() << ' ' << myPoint->Value(i).Z();
	 if ( i < myPoint->Length() )
	    anOStream  << ',' << endl << '\t';
        }
    anOStream  << " ]" << endl;
   }
 anOStream << '}' << endl;

 return anOStream;
}