#include <stdio.h>#include <gp_Pnt.hxx>#include "DriverSTL_R_SMDS_Mesh.h"#include "SMDS_Mesh.hxx"#include "SMDS_MeshElement.hxx"#include "SMDS_MeshNode.hxx"#include <OSD_Path.hxx>#include <OSD_File.hxx>#include <OSD_FromWhere.hxx>#include <OSD_Protection.hxx>#include <OSD_SingleProtection.hxx>#include <Standard_NoMoreObject.hxx>#include "utilities.h"#include <NCollection_DataMap.hxx>
Go to the source code of this file.
Typedefs | |
| typedef NCollection_DataMap < gp_Pnt, SMDS_MeshNode * > | DriverSTL_DataMapOfPntNodePtr |
Functions | |
| Standard_Integer | HashCode (const gp_Pnt &point, Standard_Integer Upper) |
| Standard_Boolean | IsEqual (const gp_Pnt &point1, const gp_Pnt &point2) |
| static Standard_Real | readFloat (OSD_File &theFile) |
| static SMDS_MeshNode * | addNode (const gp_Pnt &P, DriverSTL_DataMapOfPntNodePtr &uniqnodes, SMDS_Mesh *theMesh) |
| static SMDS_MeshNode * | readNode (FILE *file, DriverSTL_DataMapOfPntNodePtr &uniqnodes, SMDS_Mesh *theMesh) |
| static SMDS_MeshNode * | readNode (OSD_File &theFile, DriverSTL_DataMapOfPntNodePtr &uniqnodes, SMDS_Mesh *theMesh) |
Variables | |
| static Standard_Real | tab1 [3] |
| static Standard_Real | tab2 [3] |
| static const int | HEADER_SIZE = 84 |
| static const int | SIZEOF_STL_FACET = 50 |
| static const int | ASCII_LINES_PER_FACET = 7 |
| typedef NCollection_DataMap<gp_Pnt,SMDS_MeshNode*> DriverSTL_DataMapOfPntNodePtr |
Definition at line 80 of file DriverSTL_R_SMDS_Mesh.cxx.
| static SMDS_MeshNode* addNode | ( | const gp_Pnt & | P, |
| DriverSTL_DataMapOfPntNodePtr & | uniqnodes, | ||
| SMDS_Mesh * | theMesh | ||
| ) | [static] |
Definition at line 181 of file DriverSTL_R_SMDS_Mesh.cxx.
References SMDS_Mesh.AddNode(), and ex29_refine.node().
Referenced by readNode().
{
SMDS_MeshNode* node = 0;
if ( uniqnodes.IsBound(P) ) {
node = uniqnodes.Find(P);
} else {
node = theMesh->AddNode(P.X(), P.Y(), P.Z() );
uniqnodes.Bind(P,node);
}
return node;
}
| Standard_Integer HashCode | ( | const gp_Pnt & | point, |
| Standard_Integer | Upper | ||
| ) |
Definition at line 30 of file DriverSTL_R_SMDS_Mesh.cxx.
{
union
{
Standard_Real R[3];
Standard_Integer I[6];
} U;
point.Coord(U.R[0],U.R[1],U.R[2]);
return ::HashCode(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7,Upper);
}
| Standard_Boolean IsEqual | ( | const gp_Pnt & | point1, |
| const gp_Pnt & | point2 | ||
| ) |
| static Standard_Real readFloat | ( | OSD_File & | theFile | ) | [static] |
Definition at line 161 of file DriverSTL_R_SMDS_Mesh.cxx.
Referenced by DriverSTL_R_SMDS_Mesh.readBinary(), and readNode().
{
union {
Standard_Boolean i;
Standard_ShortReal f;
}u;
char c[4];
Standard_Address adr;
adr = (Standard_Address)c;
Standard_Integer lread;
theFile.Read(adr,4,lread);
u.i = c[0] & 0xFF;
u.i |= (c[1] & 0xFF) << 0x08;
u.i |= (c[2] & 0xFF) << 0x10;
u.i |= (c[3] & 0xFF) << 0x18;
return u.f;
}
| static SMDS_MeshNode* readNode | ( | OSD_File & | theFile, |
| DriverSTL_DataMapOfPntNodePtr & | uniqnodes, | ||
| SMDS_Mesh * | theMesh | ||
| ) | [static] |
Definition at line 208 of file DriverSTL_R_SMDS_Mesh.cxx.
References addNode(), and readFloat().
| static SMDS_MeshNode* readNode | ( | FILE * | file, |
| DriverSTL_DataMapOfPntNodePtr & | uniqnodes, | ||
| SMDS_Mesh * | theMesh | ||
| ) | [static] |
Definition at line 196 of file DriverSTL_R_SMDS_Mesh.cxx.
References addNode().
Referenced by DriverSTL_R_SMDS_Mesh.readAscii(), and DriverSTL_R_SMDS_Mesh.readBinary().
{
Standard_ShortReal coord[3];
// reading vertex
fscanf(file,"%*s %f %f %f\n",&coord[0],&coord[1],&coord[2]);
gp_Pnt P(coord[0],coord[1],coord[2]);
return addNode( P, uniqnodes, theMesh );
}
const int ASCII_LINES_PER_FACET = 7 [static] |
Definition at line 73 of file DriverSTL_R_SMDS_Mesh.cxx.
Referenced by DriverSTL_R_SMDS_Mesh.readAscii().
const int HEADER_SIZE = 84 [static] |
Definition at line 70 of file DriverSTL_R_SMDS_Mesh.cxx.
Referenced by DriverSTL_R_SMDS_Mesh.readBinary().
const int SIZEOF_STL_FACET = 50 [static] |
Definition at line 71 of file DriverSTL_R_SMDS_Mesh.cxx.
Standard_Real tab1[3] [static] |
Definition at line 42 of file DriverSTL_R_SMDS_Mesh.cxx.
Standard_Real tab2[3] [static] |
Definition at line 43 of file DriverSTL_R_SMDS_Mesh.cxx.