Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / GeomAPI / GeomAPI_XYZ.h
1 // File:        GeomAPI_XYZ.hxx
2 // Created:     23 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef GeomAPI_XYZ_H_
6 #define GeomAPI_XYZ_H_
7
8 #include <GeomAPI_Interface.h>
9 #include <boost/shared_ptr.hpp>
10
11 /**\class GeomAPI_XYZ
12  * \ingroup DataModel
13  * \brief 3 coordinates: they may represent vector or point or something else
14  */
15
16 class GEOMAPI_EXPORT GeomAPI_XYZ : public GeomAPI_Interface
17 {
18  public:
19   /// Creation by coordinates
20   GeomAPI_XYZ(const double theX, const double theY, const double theZ);
21
22   /// returns X coordinate
23   double x() const;
24   /// returns Y coordinate
25   double y() const;
26   /// returns Z coordinate
27   double z() const;
28
29   /// sets X coordinate
30   void setX(const double theX);
31   /// sets Y coordinate
32   void setY(const double theY);
33   /// sets Z coordinate
34   void setZ(const double theZ);
35
36   /// result is sum of coordinates of this and the given argument
37   const boost::shared_ptr<GeomAPI_XYZ> added(const boost::shared_ptr<GeomAPI_XYZ>& theArg);
38   /// result is difference between coordinates of this and the given argument
39   const boost::shared_ptr<GeomAPI_XYZ> decreased(const boost::shared_ptr<GeomAPI_XYZ>& theArg);
40   /// result is coordinates multiplied by the argument
41   const boost::shared_ptr<GeomAPI_XYZ> multiplied(const double theArg);
42
43   /// result is a scalar product of two triplets
44   double dot(const boost::shared_ptr<GeomAPI_XYZ>& theArg) const;
45   /// result is a cross product of two triplets
46   const boost::shared_ptr<GeomAPI_XYZ> cross(const boost::shared_ptr<GeomAPI_XYZ>& theArg) const;
47
48   /// Distance between two triplets
49   double distance(const boost::shared_ptr<GeomAPI_XYZ>& theOther) const;
50 };
51
52 #endif
53