1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef GeomAPI_XYZ_H_
22 #define GeomAPI_XYZ_H_
24 #include <GeomAPI_Interface.h>
29 * \brief 3 coordinates: they may represent vector or point or something else
32 class GeomAPI_XYZ : public GeomAPI_Interface
35 /// Creation by coordinates
37 GeomAPI_XYZ(const double theX, const double theY, const double theZ);
39 /// returns X coordinate
42 /// returns Y coordinate
45 /// returns Z coordinate
51 void setX(const double theX);
54 void setY(const double theY);
57 void setZ(const double theZ);
59 /// result is sum of coordinates of this and the given argument
61 const std::shared_ptr<GeomAPI_XYZ> added(const std::shared_ptr<GeomAPI_XYZ>& theArg);
62 /// result is difference between coordinates of this and the given argument
64 const std::shared_ptr<GeomAPI_XYZ> decreased(const std::shared_ptr<GeomAPI_XYZ>& theArg);
65 /// result is coordinates multiplied by the argument
67 const std::shared_ptr<GeomAPI_XYZ> multiplied(const double theArg);
69 /// result is a scalar product of two triplets
71 double dot(const std::shared_ptr<GeomAPI_XYZ>& theArg) const;
72 /// result is a cross product of two triplets
74 const std::shared_ptr<GeomAPI_XYZ> cross(const std::shared_ptr<GeomAPI_XYZ>& theArg) const;
76 /// Distance between two triplets
78 double distance(const std::shared_ptr<GeomAPI_XYZ>& theOther) const;
80 /// Square length of triplet from the origin
81 GEOMAPI_EXPORT double squareModulus() const;