File indexing completed on 2025-01-18 10:03:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _Graphic3d_Vertex_HeaderFile
0017 #define _Graphic3d_Vertex_HeaderFile
0018
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Macro.hxx>
0022 #include <Standard_ShortReal.hxx>
0023 #include <Standard_OStream.hxx>
0024
0025
0026 class Graphic3d_Vertex
0027 {
0028 public:
0029
0030 DEFINE_STANDARD_ALLOC
0031
0032
0033 Graphic3d_Vertex()
0034 {
0035 SetCoord (0.0f, 0.0f, 0.0f);
0036 }
0037
0038
0039 Graphic3d_Vertex (const Standard_ShortReal theX,
0040 const Standard_ShortReal theY,
0041 const Standard_ShortReal theZ)
0042 {
0043 SetCoord (theX, theY, theZ);
0044 }
0045
0046
0047 Graphic3d_Vertex (const Standard_Real theX,
0048 const Standard_Real theY,
0049 const Standard_Real theZ)
0050 {
0051 SetCoord (theX, theY, theZ);
0052 }
0053
0054
0055 void SetCoord (const Standard_ShortReal theX,
0056 const Standard_ShortReal theY,
0057 const Standard_ShortReal theZ)
0058 {
0059 xyz[0] = theX;
0060 xyz[1] = theY;
0061 xyz[2] = theZ;
0062 }
0063
0064
0065 void SetCoord (const Standard_Real theX,
0066 const Standard_Real theY,
0067 const Standard_Real theZ)
0068 {
0069 xyz[0] = Standard_ShortReal (theX);
0070 xyz[1] = Standard_ShortReal (theY);
0071 xyz[2] = Standard_ShortReal (theZ);
0072 }
0073
0074
0075 void Coord (Standard_ShortReal& theX,
0076 Standard_ShortReal& theY,
0077 Standard_ShortReal& theZ) const
0078 {
0079 theX = xyz[0];
0080 theY = xyz[1];
0081 theZ = xyz[2];
0082 }
0083
0084
0085 void Coord (Standard_Real& theX,
0086 Standard_Real& theY,
0087 Standard_Real& theZ) const
0088 {
0089 theX = xyz[0];
0090 theY = xyz[1];
0091 theZ = xyz[2];
0092 }
0093
0094
0095 Standard_ShortReal X() const { return xyz[0]; }
0096
0097
0098 Standard_ShortReal Y() const { return xyz[1]; }
0099
0100
0101 Standard_ShortReal Z() const { return xyz[2]; }
0102
0103
0104 Standard_EXPORT Standard_ShortReal Distance (const Graphic3d_Vertex& theOther) const;
0105
0106
0107 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0108
0109 float xyz[3];
0110
0111 };
0112
0113 #endif