b8ddfc2f |
1 | // Created on: 2012-06-20 |
2 | // Created by: Sergey ZERCHANINOV |
973c2be1 |
3 | // Copyright (c) 2011-2014 OPEN CASCADE SAS |
b8ddfc2f |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b8ddfc2f |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b8ddfc2f |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b8ddfc2f |
15 | |
16 | #ifndef _Graphic3d_Vertex_HeaderFile |
17 | #define _Graphic3d_Vertex_HeaderFile |
18 | |
19 | #include <Standard_Macro.hxx> |
20 | #include <InterfaceGraphic_telem.hxx> |
21 | #include <Standard_ShortReal.hxx> |
22 | #include <Standard_Real.hxx> |
23 | |
24 | //! This class represents a graphical 3D point. <br> |
25 | class Graphic3d_Vertex : public TEL_POINT |
26 | { |
27 | public: |
28 | //! Creates a point with 0.0, 0.0, 0.0 coordinates. <br> |
29 | Graphic3d_Vertex() |
30 | { SetCoord(0.f,0.f,0.f); } |
31 | //! Creates a point with coordinates identical to <APoint>. <br> |
32 | Graphic3d_Vertex(const Graphic3d_Vertex& APoint) |
33 | { SetCoord(APoint.X(),APoint.Y(),APoint.Z()); } |
34 | //! Creates a point with <AX>, <AY> and <AZ> coordinates. <br> |
35 | Graphic3d_Vertex(const Standard_ShortReal AX,const Standard_ShortReal AY,const Standard_ShortReal AZ) |
36 | { SetCoord(AX,AY,AZ); } |
37 | //! Creates a point with <AX>, <AY> and <AZ> coordinates. <br> |
38 | Graphic3d_Vertex(const Standard_Real AX,const Standard_Real AY,const Standard_Real AZ) |
39 | { SetCoord(AX,AY,AZ); } |
40 | //! Modifies the coordinates of the point <me>. <br> |
41 | void SetCoord(const Standard_ShortReal AX,const Standard_ShortReal AY,const Standard_ShortReal AZ) |
42 | { xyz[0] = AX, xyz[1] = AY, xyz[2] = AZ; } |
43 | //! Modifies the coordinates of the point <me>. <br> |
44 | void SetCoord(const Standard_Real AX,const Standard_Real AY,const Standard_Real AZ) |
45 | { xyz[0] = Standard_ShortReal(AX), xyz[1] = Standard_ShortReal(AY), xyz[2] = Standard_ShortReal(AZ); } |
46 | //! Returns the coordinates of the point <me>. <br> |
47 | void Coord(Standard_ShortReal& AX,Standard_ShortReal& AY,Standard_ShortReal& AZ) const |
48 | { AX = xyz[0], AY = xyz[1], AZ = xyz[2]; } |
49 | //! Returns the coordinates of the point <me>. <br> |
50 | void Coord(Standard_Real& AX,Standard_Real& AY,Standard_Real& AZ) const |
51 | { AX = xyz[0], AY = xyz[1], AZ = xyz[2]; } |
52 | //! Returns the X coordinates of the point <me>. <br> |
53 | Standard_ShortReal X() const { return xyz[0]; } |
54 | //! Returns the Y coordinate of the point <me>. <br> |
55 | Standard_ShortReal Y() const { return xyz[1]; } |
56 | //! Returns the Z coordinate of the point <me>. <br> |
57 | Standard_ShortReal Z() const { return xyz[2]; } |
58 | //! Returns the distance between <AV1> and <AV2>. <br> |
59 | Standard_EXPORT Standard_ShortReal Distance(const Graphic3d_Vertex& AOther) const; |
60 | }; |
61 | |
62 | #endif |