1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Standard_Type.hxx>
16 #include <Vrml_Normal.hxx>
18 IMPLEMENT_STANDARD_RTTIEXT(Vrml_Normal,Standard_Transient)
20 Vrml_Normal::Vrml_Normal(const Handle(TColgp_HArray1OfVec)& aVector)
25 Vrml_Normal::Vrml_Normal()
28 myVector = new TColgp_HArray1OfVec (1,1);
30 Tmp_Vec.SetX(0); Tmp_Vec.SetY(0); Tmp_Vec.SetZ(1);
31 myVector->SetValue(1,Tmp_Vec);
34 void Vrml_Normal::SetVector(const Handle(TColgp_HArray1OfVec)& aVector)
39 Handle(TColgp_HArray1OfVec) Vrml_Normal::Vector() const
44 Standard_OStream& Vrml_Normal::Print(Standard_OStream& anOStream) const
48 anOStream << "Normal {\n";
49 i = myVector->Lower();
50 if ( myVector->Length() == 1 &&
51 Abs(myVector->Value(i).X() - 0) < 0.0001 &&
52 Abs(myVector->Value(i).Y() - 0) < 0.0001 &&
53 Abs(myVector->Value(i).Z() - 1) < 0.0001 )
60 anOStream << " vector [\n\t";
61 for ( i = myVector->Lower(); i <= myVector->Upper(); i++ )
63 anOStream << myVector->Value(i).X() << " " << myVector->Value(i).Y() << " " << myVector->Value(i).Z();
64 if ( i < myVector->Length() )