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 <StepGeom_CartesianPoint.hxx>
17 #include <TCollection_HAsciiString.hxx>
19 IMPLEMENT_STANDARD_RTTIEXT(StepGeom_CartesianPoint,StepGeom_Point)
21 StepGeom_CartesianPoint::StepGeom_CartesianPoint () {}
23 void StepGeom_CartesianPoint::Init(
24 const Handle(TCollection_HAsciiString)& aName,
25 const Handle(TColStd_HArray1OfReal)& aCoordinates)
27 // --- classe own fields ---
28 nbcoord = aCoordinates->Length();
29 coords[0] = aCoordinates->Value(1);
30 coords[1] = aCoordinates->Value(2);
31 coords[2] = aCoordinates->Value(3);
32 // coordinates = aCoordinates;
33 // --- classe inherited fields ---
34 StepRepr_RepresentationItem::Init(aName);
37 void StepGeom_CartesianPoint::Init2D(
38 const Handle(TCollection_HAsciiString)& aName,
39 const Standard_Real X, const Standard_Real Y)
44 // --- classe inherited fields ---
45 StepRepr_RepresentationItem::Init(aName);
48 void StepGeom_CartesianPoint::Init3D(
49 const Handle(TCollection_HAsciiString)& aName,
50 const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
56 // --- classe inherited fields ---
57 StepRepr_RepresentationItem::Init(aName);
60 void StepGeom_CartesianPoint::SetCoordinates(const Handle(TColStd_HArray1OfReal)& aCoordinates)
62 nbcoord = aCoordinates->Length();
63 coords[0] = aCoordinates->Value(1);
64 coords[1] = aCoordinates->Value(2);
65 coords[2] = aCoordinates->Value(3);
66 // coordinates = aCoordinates;
69 Handle(TColStd_HArray1OfReal) StepGeom_CartesianPoint::Coordinates() const
71 Handle(TColStd_HArray1OfReal) coordinates = new TColStd_HArray1OfReal(1,nbcoord);
72 coordinates->SetValue(1,coords[0]);
73 coordinates->SetValue(2,coords[1]);
74 coordinates->SetValue(3,coords[2]);
78 Standard_Real StepGeom_CartesianPoint::CoordinatesValue(const Standard_Integer num) const
81 // return coordinates->Value(num);
84 Standard_Integer StepGeom_CartesianPoint::NbCoordinates () const
87 // return coordinates->Length();