0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[occt.git] / src / Graphic3d / Graphic3d_Vertex.hxx
CommitLineData
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
b6472664 19#include <Standard.hxx>
20#include <Standard_DefineAlloc.hxx>
b8ddfc2f 21#include <Standard_Macro.hxx>
b8ddfc2f 22#include <Standard_ShortReal.hxx>
23#include <Standard_Real.hxx>
24
ebc93ae7 25//! This class represents a graphical 3D point.
b6472664 26class Graphic3d_Vertex
b8ddfc2f 27{
ebc93ae7 28public:
29
b6472664 30 DEFINE_STANDARD_ALLOC
31
ebc93ae7 32 //! Creates a point with 0.0, 0.0, 0.0 coordinates.
b8ddfc2f 33 Graphic3d_Vertex()
ebc93ae7 34 {
35 SetCoord (0.0f, 0.0f, 0.0f);
36 }
37
38 //! Creates a point with coordinates identical to thePoint.
39 Graphic3d_Vertex (const Graphic3d_Vertex& thePoint)
40 {
41 SetCoord (thePoint.X(), thePoint.Y(), thePoint.Z());
42 }
43
44 //! Creates a point with theX, theY and theZ coordinates.
45 Graphic3d_Vertex (const Standard_ShortReal theX,
46 const Standard_ShortReal theY,
47 const Standard_ShortReal theZ)
48 {
49 SetCoord (theX, theY, theZ);
50 }
51
52 //! Creates a point with theX, theY and theZ coordinates.
53 Graphic3d_Vertex (const Standard_Real theX,
54 const Standard_Real theY,
55 const Standard_Real theZ)
56 {
57 SetCoord (theX, theY, theZ);
58 }
59
60 //! Modifies the coordinates.
61 void SetCoord (const Standard_ShortReal theX,
62 const Standard_ShortReal theY,
63 const Standard_ShortReal theZ)
64 {
65 xyz[0] = theX;
66 xyz[1] = theY;
67 xyz[2] = theZ;
68 }
69
70 //! Modifies the coordinates.
71 void SetCoord (const Standard_Real theX,
72 const Standard_Real theY,
73 const Standard_Real theZ)
74 {
75 xyz[0] = Standard_ShortReal (theX);
76 xyz[1] = Standard_ShortReal (theY);
77 xyz[2] = Standard_ShortReal (theZ);
78 }
79
80 //! Returns the coordinates.
81 void Coord (Standard_ShortReal& theX,
82 Standard_ShortReal& theY,
83 Standard_ShortReal& theZ) const
84 {
85 theX = xyz[0];
86 theY = xyz[1];
87 theZ = xyz[2];
88 }
89
90 //! Returns the coordinates.
91 void Coord (Standard_Real& theX,
92 Standard_Real& theY,
93 Standard_Real& theZ) const
94 {
95 theX = xyz[0];
96 theY = xyz[1];
97 theZ = xyz[2];
98 }
99
100 //! Returns the X coordinates.
b8ddfc2f 101 Standard_ShortReal X() const { return xyz[0]; }
ebc93ae7 102
103 //! Returns the Y coordinate.
b8ddfc2f 104 Standard_ShortReal Y() const { return xyz[1]; }
ebc93ae7 105
106 //! Returns the Z coordinate.
b8ddfc2f 107 Standard_ShortReal Z() const { return xyz[2]; }
ebc93ae7 108
109 //! Returns the distance between two points.
110 Standard_EXPORT Standard_ShortReal Distance (const Graphic3d_Vertex& theOther) const;
111
b6472664 112 float xyz[3];
113
b8ddfc2f 114};
115
116#endif