File indexing completed on 2026-09-19 09:28:07
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 DEFINE_STANDARD_ALLOC
0030
0031
0032 Graphic3d_Vertex() { SetCoord(0.0f, 0.0f, 0.0f); }
0033
0034
0035 Graphic3d_Vertex(const float theX, const float theY, const float theZ)
0036 {
0037 SetCoord(theX, theY, theZ);
0038 }
0039
0040
0041 Graphic3d_Vertex(const double theX, const double theY, const double theZ)
0042 {
0043 SetCoord(theX, theY, theZ);
0044 }
0045
0046
0047 void SetCoord(const float theX, const float theY, const float theZ)
0048 {
0049 xyz[0] = theX;
0050 xyz[1] = theY;
0051 xyz[2] = theZ;
0052 }
0053
0054
0055 void SetCoord(const double theX, const double theY, const double theZ)
0056 {
0057 xyz[0] = float(theX);
0058 xyz[1] = float(theY);
0059 xyz[2] = float(theZ);
0060 }
0061
0062
0063 void Coord(float& theX, float& theY, float& theZ) const
0064 {
0065 theX = xyz[0];
0066 theY = xyz[1];
0067 theZ = xyz[2];
0068 }
0069
0070
0071 void Coord(double& theX, double& theY, double& theZ) const
0072 {
0073 theX = xyz[0];
0074 theY = xyz[1];
0075 theZ = xyz[2];
0076 }
0077
0078
0079 float X() const { return xyz[0]; }
0080
0081
0082 float Y() const { return xyz[1]; }
0083
0084
0085 float Z() const { return xyz[2]; }
0086
0087
0088 Standard_EXPORT float Distance(const Graphic3d_Vertex& theOther) const;
0089
0090
0091 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const;
0092
0093 float xyz[3];
0094 };
0095
0096 #endif