Warning, file /include/opencascade/MeshVS_Buffer.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef MeshVS_Buffer_HeaderFile
0017 #define MeshVS_Buffer_HeaderFile
0018
0019 #include <Standard.hxx>
0020 #include <gp_Pnt.hxx>
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #define MeshVS_BufSize 10*3*sizeof(double)
0032
0033 class MeshVS_Buffer
0034 {
0035 public:
0036
0037 MeshVS_Buffer (const Standard_Size theSize)
0038 : myDynData (0)
0039 {
0040 if (theSize > MeshVS_BufSize)
0041 myDynData = Standard::Allocate (theSize);
0042 }
0043
0044
0045 ~MeshVS_Buffer()
0046 {
0047 if (myDynData)
0048 {
0049 Standard::Free (myDynData);
0050 myDynData = 0;
0051 }
0052 }
0053
0054
0055 operator void* ()
0056 {
0057 return myDynData ? myDynData : (void*) myAutoData;
0058 }
0059
0060
0061 operator Standard_Real& ()
0062 {
0063 return * (myDynData ? (Standard_Real*) myDynData : (Standard_Real*) myAutoData);
0064 }
0065
0066
0067 operator Standard_Integer& ()
0068 {
0069 return * (myDynData ? (Standard_Integer*) myDynData : (Standard_Integer*) myAutoData);
0070 }
0071
0072
0073 operator gp_Pnt& ()
0074 {
0075 return * (myDynData ? (gp_Pnt*) myDynData : (gp_Pnt*) myAutoData);
0076 }
0077
0078 private:
0079
0080 MeshVS_Buffer(const MeshVS_Buffer&) {}
0081
0082
0083 MeshVS_Buffer& operator=(const MeshVS_Buffer&) {return *this;}
0084
0085 char myAutoData[ MeshVS_BufSize ];
0086 void* myDynData;
0087 };
0088
0089 #endif