0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[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>
92f8ec2f 23#include <Standard_OStream.hxx>
b8ddfc2f 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
ebc93ae7 38 //! Creates a point with theX, theY and theZ coordinates.
39 Graphic3d_Vertex (const Standard_ShortReal theX,
40 const Standard_ShortReal theY,
41 const Standard_ShortReal theZ)
42 {
43 SetCoord (theX, theY, theZ);
44 }
45
46 //! Creates a point with theX, theY and theZ coordinates.
47 Graphic3d_Vertex (const Standard_Real theX,
48 const Standard_Real theY,
49 const Standard_Real theZ)
50 {
51 SetCoord (theX, theY, theZ);
52 }
53
54 //! Modifies the coordinates.
55 void SetCoord (const Standard_ShortReal theX,
56 const Standard_ShortReal theY,
57 const Standard_ShortReal theZ)
58 {
59 xyz[0] = theX;
60 xyz[1] = theY;
61 xyz[2] = theZ;
62 }
63
64 //! Modifies the coordinates.
65 void SetCoord (const Standard_Real theX,
66 const Standard_Real theY,
67 const Standard_Real theZ)
68 {
69 xyz[0] = Standard_ShortReal (theX);
70 xyz[1] = Standard_ShortReal (theY);
71 xyz[2] = Standard_ShortReal (theZ);
72 }
73
74 //! Returns the coordinates.
75 void Coord (Standard_ShortReal& theX,
76 Standard_ShortReal& theY,
77 Standard_ShortReal& theZ) const
78 {
79 theX = xyz[0];
80 theY = xyz[1];
81 theZ = xyz[2];
82 }
83
84 //! Returns the coordinates.
85 void Coord (Standard_Real& theX,
86 Standard_Real& theY,
87 Standard_Real& theZ) const
88 {
89 theX = xyz[0];
90 theY = xyz[1];
91 theZ = xyz[2];
92 }
93
94 //! Returns the X coordinates.
b8ddfc2f 95 Standard_ShortReal X() const { return xyz[0]; }
ebc93ae7 96
97 //! Returns the Y coordinate.
b8ddfc2f 98 Standard_ShortReal Y() const { return xyz[1]; }
ebc93ae7 99
100 //! Returns the Z coordinate.
b8ddfc2f 101 Standard_ShortReal Z() const { return xyz[2]; }
ebc93ae7 102
103 //! Returns the distance between two points.
104 Standard_EXPORT Standard_ShortReal Distance (const Graphic3d_Vertex& theOther) const;
a5162275 105
106 //! Dumps the content of me into the stream
107 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
ebc93ae7 108
b6472664 109 float xyz[3];
110
b8ddfc2f 111};
112
113#endif