CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
FacetModeler::BinaryStream Class Reference

#include <FMDataSerialize.h>

Public Types

enum  OdaObjectMarker {
  ePoint2dMarker = 1 , eContour2dMarker = 2 , eProfile2dMarker = 3 , eBodyMarker = 4 ,
  eFaceMarker = 5 , ePoint3dMarker = 6
}
 
enum  Version {
  v64bit = -2 , v32bit = -1 , vAuto = 0 , vKeyTypeAdded = 1 ,
  vSaveColorsAdded = 2 , vCurrent = 2
}
 

Public Member Functions

 BinaryStream ()
 
 ~BinaryStream ()
 
bool Create (const OdString &szFile)
 
bool Open (const OdString &szFile, Version ver=vAuto)
 
bool Open (OdStreamBuf *pFileBuff, Version ver=vAuto)
 
bool Create (OdStreamBuf *pFileBuff)
 
bool Reset (Version ver=vAuto)
 
Version getVersion () const
 
void Write (const void *pData, OdUInt32 length)
 
void Read (void *pData, OdUInt32 length)
 
template<typename T >
void Write (const T val)
 
void Write (const OdGePoint2d &val)
 
void Write (const Contour2D &val)
 
void Write (const Profile2D &val)
 
void Write (const OdGePoint3d &val)
 
void Write (const Face &val)
 
void Write (const Body &val)
 
void WriteVertexList (Vertex *pVertexList, OdUInt32 uVtxCount)
 
void WriteVertex (Vertex *pVertex)
 
void WriteEdgesList (const Body &val)
 
void WriteEdge (Edge *pEdge)
 
template<typename T >
void Read (T &val)
 
void Read (OdGePoint2d &val)
 
void Read (Contour2D &val)
 
void Read (Profile2D &val)
 
void Read (OdGePoint3d &val)
 
void ReadFaceToBody (Body &val)
 
void Read (Body &val)
 
void ReadKey (KeyType &val)
 
void ReadVertexImages (VertexImages &vertexImages, Body *pBody)
 
void SetVertexListForBody (VertexImages &vertexImages, Body &val)
 
void ReadEdgeImages (EdgeImages &edgeImages)
 
void ReadFaceImages (FaceImages &faceImages)
 

Static Public Attributes

static const OdUInt32 iSigLen = 4
 
static const OdUInt32 iVerLen = 2
 

Detailed Description

Provides functionality for reading and writing binary data to a file.

Definition at line 124 of file FMDataSerialize.h.

Member Enumeration Documentation

◆ OdaObjectMarker

Defines types of object markers.

Enumerator
ePoint2dMarker 

OdGePoint2d marker.

eContour2dMarker 

Contour2D marker.

eProfile2dMarker 

Profile2D marker.

eBodyMarker 

Body marker.

eFaceMarker 

Face marker.

ePoint3dMarker 

OdGePoint3d marker.

Definition at line 131 of file FMDataSerialize.h.

◆ Version

Defines Facet Modeler file or binary stream format versions.

Enumerator
v64bit 

Force old-style 64-bit.

v32bit 

Force old-style 32-bit.

vAuto 

Version from the file.

vKeyTypeAdded 

Version where saving unified for different bitness.

vSaveColorsAdded 

Version where added saving of Face color fields.

vCurrent 

Current version.

Definition at line 155 of file FMDataSerialize.h.

Constructor & Destructor Documentation

◆ BinaryStream()

FacetModeler::BinaryStream::BinaryStream ( )

Default constructor.

◆ ~BinaryStream()

FacetModeler::BinaryStream::~BinaryStream ( )

Destructor.

Member Function Documentation

◆ Create() [1/2]

bool FacetModeler::BinaryStream::Create ( const OdString szFile)

Opens a file from the file system for writing.

Parameters
szFile[in] Filename string.
Returns
true if the file is opened successfully, or false otherwise.

◆ Create() [2/2]

bool FacetModeler::BinaryStream::Create ( OdStreamBuf pFileBuff)

Opens a stream buffer for writing a binary stream to.

Parameters
pFileBuff[in] Pointer to the OdStreamBuf object.
Returns
true if the stream buffer is opened successfully, or false otherwise.

◆ getVersion()

Version FacetModeler::BinaryStream::getVersion ( ) const
inline

Gets version of this stream object.

Returns
Current stream version from Version enum.

Definition at line 237 of file FMDataSerialize.h.

◆ Open() [1/2]

bool FacetModeler::BinaryStream::Open ( const OdString szFile,
Version  ver = vAuto 
)

Opens a file from the file system for reading in the specified format version.

Parameters
szFile[in] Filename string.
ver[in] File version to read.
Returns
true if the file is opened successfully, or false otherwise.

◆ Open() [2/2]

bool FacetModeler::BinaryStream::Open ( OdStreamBuf pFileBuff,
Version  ver = vAuto 
)

Opens a stream buffer for reading in the specified format version.

Parameters
pFileBuff[in] Pointer to the OdStreamBuf object.
ver[in] Format version to use for reading.
Returns
true if the stream buffer is opened successfully, or false otherwise.

◆ Read() [1/7]

void FacetModeler::BinaryStream::Read ( Body val)

Reads a Body object.

Parameters
val[out] Read Body object.

◆ Read() [2/7]

void FacetModeler::BinaryStream::Read ( Contour2D val)

Reads a contour object.

Parameters
val[out] Read Contour2D object.

◆ Read() [3/7]

void FacetModeler::BinaryStream::Read ( OdGePoint2d val)

Reads a point object.

Parameters
val[out] Read OdGePoint2d object.

◆ Read() [4/7]

void FacetModeler::BinaryStream::Read ( OdGePoint3d val)

Reads a point.

Parameters
val[out] Read OdGePoint3d object.

◆ Read() [5/7]

void FacetModeler::BinaryStream::Read ( Profile2D val)

Reads a profile object.

Parameters
val[out] Read Profile2d object.

◆ Read() [6/7]

template<typename T >
void FacetModeler::BinaryStream::Read ( T &  val)
inline

Reads an object.

Parameters
val[out] Read object.

Definition at line 346 of file FMDataSerialize.h.

◆ Read() [7/7]

void FacetModeler::BinaryStream::Read ( void pData,
OdUInt32  length 
)

Reads the specified number of bytes.

Parameters
pData[out] Pointer to the read data.
length[in] Number of bytes to read.

◆ ReadEdgeImages()

void FacetModeler::BinaryStream::ReadEdgeImages ( EdgeImages edgeImages)

Reads an EdgeImages array.

Parameters
edgeImages[out] Read EdgeImages array.

◆ ReadFaceImages()

void FacetModeler::BinaryStream::ReadFaceImages ( FaceImages faceImages)

Reads a FaceImages array.

Parameters
faceImages[out] Read FaceImages array.

◆ ReadFaceToBody()

void FacetModeler::BinaryStream::ReadFaceToBody ( Body val)

Reads a Face object to the specified body.

Parameters
val[in/out] Body object to assign the face to.

◆ ReadKey()

void FacetModeler::BinaryStream::ReadKey ( KeyType val)

Reads a KeyType object.

Parameters
val[out] Read KeyType value.

◆ ReadVertexImages()

void FacetModeler::BinaryStream::ReadVertexImages ( VertexImages vertexImages,
Body pBody 
)

Reads a VertexImages array from the specified body.

Parameters
vertexImages[out] VertexImages output array.
pBody[in] Body to read from.

◆ Reset()

bool FacetModeler::BinaryStream::Reset ( Version  ver = vAuto)

Resets the stream of a file pointer to the start and sets a format version.

Parameters
ver[in] Format version.
Returns
true if the stream buffer is reset successfully, or false otherwise.

◆ SetVertexListForBody()

void FacetModeler::BinaryStream::SetVertexListForBody ( VertexImages vertexImages,
Body val 
)

Sets a vertex list for the specified body using a VertexImages array.

Parameters
vertexImages[in] VertexImages array to set.
val[in/out] Body to set.

◆ Write() [1/8]

void FacetModeler::BinaryStream::Write ( const Body val)

Writes the body.

Parameters
val[in] Body object to write.

◆ Write() [2/8]

void FacetModeler::BinaryStream::Write ( const Contour2D val)

Writes the contour.

Parameters
val[in] Contour2D object to write.

◆ Write() [3/8]

void FacetModeler::BinaryStream::Write ( const Face val)

Writes the face.

Parameters
val[in] Face object to write.

◆ Write() [4/8]

void FacetModeler::BinaryStream::Write ( const OdGePoint2d val)

Writes the 2D point.

Parameters
val[in] OdGePoint2d object to write.

◆ Write() [5/8]

void FacetModeler::BinaryStream::Write ( const OdGePoint3d val)

Writes the 3D point.

Parameters
val[in] OdGePoint3d object to write.

◆ Write() [6/8]

void FacetModeler::BinaryStream::Write ( const Profile2D val)

Writes the profile.

Parameters
val[in] Profile2D object to write.

◆ Write() [7/8]

template<typename T >
void FacetModeler::BinaryStream::Write ( const T  val)
inline

Writes data with a defined size.

Parameters
val[in] Data to write.

Definition at line 264 of file FMDataSerialize.h.

◆ Write() [8/8]

void FacetModeler::BinaryStream::Write ( const void pData,
OdUInt32  length 
)

Writes the specified number of bytes of data.

Parameters
pData[in] Pointer to data to write.
length[in] Count of bytes to write.

◆ WriteEdge()

void FacetModeler::BinaryStream::WriteEdge ( Edge pEdge)

Writes the edge.

Parameters
pEdge[in] Edge to write.

◆ WriteEdgesList()

void FacetModeler::BinaryStream::WriteEdgesList ( const Body val)

Writes the body edges list.

Parameters
val[in] Body to write.

◆ WriteVertex()

void FacetModeler::BinaryStream::WriteVertex ( Vertex pVertex)

Writes the vertex.

Parameters
pVertex[in] Pointer to vertex to write.

◆ WriteVertexList()

void FacetModeler::BinaryStream::WriteVertexList ( Vertex pVertexList,
OdUInt32  uVtxCount 
)

Writes the specified number of vertices from the vertex list.

Parameters
pVertexList[in] Vertex list pointer.
uVtxCount[in] Vertices number to write.

Member Data Documentation

◆ iSigLen

const OdUInt32 FacetModeler::BinaryStream::iSigLen = 4
static

Definition at line 176 of file FMDataSerialize.h.

◆ iVerLen

const OdUInt32 FacetModeler::BinaryStream::iVerLen = 2
static

Definition at line 177 of file FMDataSerialize.h.


The documentation for this class was generated from the following file: