All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

GeometricObjects Class CATCGMStream

Mathematics.CATCGMVirtual
  |
  +---Mathematics.CATMathStream
    |
    +---CATCGMStream
 

Usage: you must use this class as is. You should never derive it.


public class CATCGMStream

Class defining the stream to use for the stream and unstream of a single geometric object.
Role: This stream class is specially designed to deal with a list of linked objects. The list of linked objects must be written/read prior to any other write/read operation.
This class is used when you define the stream or unstream of your own CGM attribute, but you only has to use it as a CATMathStream. In fact, if you have linked objects, use CATCGMStreamAttribute.AddLink , and the stream/unstream of your linked objects will be automatic.

See also:
CATMathStream


Constructor and Destructor Index


o CATCGMStream(CATCGMStreamImpl*)
Constructs CATCGMStream for stream operation (read and write acces are allowed).
o CATCGMStream(CATStream&,CATCGMStreamType,CATBoolean,CATCGMStreamImpl*)
Constructs CATMathStream for read only or write only stream operation.
o CATCGMStream(CATStream&,size_t,CATCGMStreamImpl*)
Constructs CATCGMStream for read only stream operation.
o CATCGMStream(char*,CATCGMStreamType,CATBoolean,CATCGMStreamImpl*)
Constructs CATCGMStream for read only or write only stream operation.
o CATCGMStream(istream&,CATCGMStreamImpl*)
Constructs CATCGMStream for read only stream operation.
o CATCGMStream(ostream&,size_t,CATBoolean,CATCGMStreamImpl*)
Constructs CATCGMStream for write only stream operation.
o CATCGMStream(size_t,CATCGMStreamType,CATBoolean,CATCGMStreamImpl*)
Constructs CATCGMStream for stream operation.
o CATCGMStream(void*,size_t,CATCGMStreamImpl*)
Constructs CATCGMStream for read only stream operation.
o ~CATCGMStream()
Destructor

Method Index


o CloseFactoryForRead(size_t,short,CATBoolean)
Closes the stream after reading of the content of a CATGeoFactory.
o CloseFactoryForWrite(size_t,short,CATBoolean)
Closes the stream after writing of the content of a CATGeoFactory.
o GetAssociatedContainer()
Returns the CATGeoFactory used with a OpenFactoryForWrite/CloseFactoryForWrite or OpenFactoryForRead/CloseFactoryForRead operation.
o GetNumberOfBytesToRead()
Returns the number of bytes that remains to read.
o OpenFactoryForRead(CATICGMContainer*,size_t&,short&,CATBoolean)
Opens the stream for reading the content of a CATGeoFactory.
o OpenFactoryForWrite(CATICGMContainer*,size_t&,short&,CATBoolean)
Opens the stream for writing the content of a CATGeoFactory.
o PrepareToObjectStreaming()
Prepares the object streaming.
o PrepareToObjectUnstreaming()
Prepares the object unstreaming.
o PrepareToProcessAnObject(size_t)
Prepares the stream to process an object.
o ReadCrvLimits(CATCrvLimits&,CATCurve*,char[])
Reads a CATCrvLimits.
o ReadCrvParam(CATCrvParam&,CATCurve*,char[])
Reads a CATCrvParam.
o ReadGeometryV5(CATICGMObject**,CATLONG32,char[])
Read an array of CGM objects.
o ReadKnotVector(CATKnotVector&,char[])
Reads a CATKnotVector.
o ReadLinkedObjectsCount(CATULONG32&)
Reads the linked objects count.
o ReadListOfLinkedObjects(CATLISTP(CATICGMObject)&,char[])
Reads the total list of linked objects.
o ReadObject(CATICGMObject*&,char[])
Reads a linked object.
o ReadSurLimits(CATSurLimits&,CATSurface*,char[])
Reads a CATSurLimits.
o ReadSurParam(CATSurParam&,CATSurface*,char[])
Reads a CATSurParam.
o ResetToRawBehaviour()
Resets the stream to raw behaviour.
o SkipRemainingInformationsToRead()
Skips over remaining informations to read.
o SkipRemainingLinkedObjectsToRead()
Skips over remaining linked objects to read.
o WriteCrvLimits(CATCrvLimits&,char[])
Writes a CATCrvLimits.
o WriteCrvParam(CATCrvParam&,char[])
Writes a CATCrvParam.
o WriteGeometryV5(CATICGMObject**,CATLONG32,char[])
Writes an array of CGM objects.
o WriteKnotVector(CATKnotVector&,char[])
Writes a CATKnotVector.
o WriteLinkedObjectsCount(CATULONG32)
Writes the linked objects count.
o WriteListOfLinkedObjects(CATLISTP(CATICGMObject)&,char[])
Writes a (partial or total) list of linked objects.
o WriteObject(CATICGMObject*,char[])
Writes a linked object.
o WriteSurLimits(CATSurLimits&,char[])
Writes a CATSurLimits.
o WriteSurParam(CATSurParam&,char[])
Writes a CATSurParam.

Constructor and Destructor


o CATCGMStream
public CATCGMStream(CATCGMStreamImpl* ipImpl= NULL)
Constructs CATCGMStream for stream operation (read and write acces are allowed).
Parameters:
CATCGMStreamImpl
Internal use only. Do not change the default value.
o CATCGMStream
public CATCGMStream(CATStream& iDirectStreaming,
const CATCGMStreamType iAcces,
const CATBoolean iEnableByAddress= FALSE,
CATCGMStreamImpl* ipImpl= NULL)
Constructs CATMathStream for read only or write only stream operation.
Parameters:
iDirectStreaming
The stream from which the stream is read or writen.
iAcces
The kind of acces allowed on the CATMathStream.
The first acces of the stream may be done with OpenReadStreamHeader or OpenWriteStreamHeader.
The last acces of the stream may be done with CloseReadStreamHeader or CloseWriteStreamHeader.
iEnableByAddress
Reserved for future use (do not change the default value)
CATCGMStreamImpl
Internal use only. Do not change the default value.
o CATCGMStream
public CATCGMStream(CATStream& iDirectStreaming,
size_t iSizeStream,
CATCGMStreamImpl* ipImpl= NULL)
Constructs CATCGMStream for read only stream operation.
Parameters:
iDirectStreaming
The stream from which the stream is read.
iSizeStream
The size in bytes of iDirectStreaming.
CATCGMStreamImpl
Internal use only. Do not change the default value.
o CATCGMStream
public CATCGMStream( const char* iFilename,
const CATCGMStreamType iAcces,
const CATBoolean iEnableByAddress= FALSE,
CATCGMStreamImpl* ipImpl= NULL)
Constructs CATCGMStream for read only or write only stream operation.
Parameters:
ioFile
The stream from which the stream is read.
iAcces
The kind of acces allowed on the CATCGMStream.
The first acces of the stream may be done with OpenReadStreamHeader or OpenWriteStreamHeader.
The last acces of the stream may be done with CloseReadStreamHeader or CloseWriteStreamHeader.
CATCGMStreamImpl
Internal use only. Do not change the default value.
o CATCGMStream
public CATCGMStream(istream& ioFile,
CATCGMStreamImpl* ipImpl= NULL)
Constructs CATCGMStream for read only stream operation.
Parameters:
ioFile
The stream from which the stream is read.
The first acces of the stream may be done with OpenWriteStreamHeader.
The last acces of the stream may be done with CloseWriteStreamHeader.
CATCGMStreamImpl
Internal use only. Do not change the default value.
o CATCGMStream
public CATCGMStream(ostream& ioFile,
size_t iInitialNumberOfBytes= 0,
const CATBoolean iEnableByAddress= FALSE,
CATCGMStreamImpl* ipImpl= NULL)
Constructs CATCGMStream for write only stream operation.
Parameters:
ioFile
The stream on which the stream is saved.
iInitialNumberOfBytes
The initial memory size of internal buffer in bytes.
The first acces of the stream may be done with OpenReadStreamHeader.
The last acces of the stream may be done with CloseReadStreamHeader.
CATCGMStreamImpl
Internal use only. Do not change the default value.
o CATCGMStream
public CATCGMStream(size_t iInitialNumberOfBytes,
const CATCGMStreamType iAcces,
const CATBoolean iEnableByAddress= FALSE,
CATCGMStreamImpl* ipImpl= NULL)
Constructs CATCGMStream for stream operation.
Parameters:
iInitialNumberOfBytes
The initial number of bytes for internal buffer.
iAcces
The kind of acces allowed on the CATCGMStream.
CATCGMStreamImpl
Internal use only. Do not change the default value.
o CATCGMStream
public CATCGMStream(void* iBuffer,
size_t iSizeBuffer,
CATCGMStreamImpl* ipImpl= NULL)
Constructs CATCGMStream for read only stream operation.
Parameters:
iBuffer
The memory area directly acceded for the read operation.
iSizeBuffer
The size in bytes of iBuffer.
CATCGMStreamImpl
Internal use only. Do not change the default value.
o ~CATCGMStream
public virtual ~CATCGMStream()
Destructor

Methods


o CloseFactoryForRead
public void CloseFactoryForRead( const size_t iWhere,
const short iLevel,
CATBoolean iForExternalWeakLinks= FALSE)
Closes the stream after reading of the content of a CATGeoFactory.
Parameters:
iWhere
internal parameter given by OpenFactoryForRead.
iLevel
internal parameter given by OpenFactoryForRead.
iForExternalWeakLinks
Internal use only. Do not change the default value.
o CloseFactoryForWrite
public void CloseFactoryForWrite( const size_t iWhere,
const short iLevel,
CATBoolean iForExternalWeakLinks= FALSE)
Closes the stream after writing of the content of a CATGeoFactory.
Parameters:
iWhere
internal parameter given by OpenFactoryForWrite.
iLevel
internal parameter given by OpenFactoryForWrite.
iForExternalWeakLinks
Internal use only. Do not change the default value.
o GetAssociatedContainer
public CATICGMContainer* GetAssociatedContainer()
Returns the CATGeoFactory used with a OpenFactoryForWrite/CloseFactoryForWrite or OpenFactoryForRead/CloseFactoryForRead operation.
Returns:
A CATICGMContainer pointer to the associated CATGeoFactory.
o GetNumberOfBytesToRead
public size_t GetNumberOfBytesToRead()
Returns the number of bytes that remains to read.
Returns:
The number of bytes still to read, considering what has been already read
o OpenFactoryForRead
public void OpenFactoryForRead(CATICGMContainer* iFactory,
size_t& oWhere,
short& oLevel,
CATBoolean iForExternalWeakLinks= FALSE)
Opens the stream for reading the content of a CATGeoFactory.
Parameters:
iFactory
A pointer to the CATGeoFactory to be read.
oWhere
internal parameter you must give back to CloseFactoryForRead.
oLevel
internal parameter you must give back to CloseFactoryForRead.
iForExternalWeakLinks
Internal use only. Do not change the default value.
o OpenFactoryForWrite
public void OpenFactoryForWrite(CATICGMContainer* iFactory,
size_t& oWhere,
short& oLevel,
CATBoolean iForExternalWeakLinks= FALSE)
Opens the stream for writing the content of a CATGeoFactory.
Parameters:
iFactory
A pointer to the CATGeoFactory to be written.
oWhere
internal parameter you must give back to CloseFactoryForWrite.
oLevel
internal parameter you must give back to CloseFactoryForWrite.
iForExternalWeakLinks
Internal use only. Do not change the default value.
o PrepareToObjectStreaming
public void PrepareToObjectStreaming()
Prepares the object streaming.
This function forces the order of write operations:
  1. Indicates the linked objects count for the objects to stream.
    (thru a call to WriteLinkedObjectsCount)
    This step is mandatory, even if there is no link.
  2. Writes the list of linked objects for object to be streamed, combining :
    • call(s) to WriteListOfLinkedObjects,
    • call(s) to WriteObject.
  3. Write other informations (numbers and strings).

It must be called anytime, even if there is no link. (use an empty list in such case)
o PrepareToObjectUnstreaming
public void PrepareToObjectUnstreaming()
Prepares the object unstreaming.
This function will force the order of read operations:
  1. Gets the linked objects for the objects to unstream:
    • Either read the linked objects count for object to be streamed.
      (in one shot, thru a call to 'ReadListOfLinkedObjects').
      Extract then only what you need: Do not make any assumptions on list's size, as upcoming versions may add later linked objects to the modelization.
    • Either read the count, then read individually each linked object.
      You must forecast to skip linked objects possibly added by upcoming versions.
      (thru a call to 'ReadLinkedObjectsCount', followed by as many calls as required to 'ReadObject', ended by a call to 'SkipRemainingLinkedObjectsToRead').

    This step is mandatory, even if there is no link.
  2. Read other informations (numbers and strings).

It must be called anytime, even if there is no link. (use an empty list in such case)
o PrepareToProcessAnObject
public void PrepareToProcessAnObject(size_t iObjectSize= 0)
Prepares the stream to process an object.
This resets the flags that control the order of read/write operations.
It must be called before streaming/unstreaming an object.
Parameters:
iObjectSize
The size of the object to be unstreamed (useless when streaming).
o ReadCrvLimits
public void ReadCrvLimits(CATCrvLimits& ioCrvLimits,
CATCurve* ipCurve,
const char[] iLabelReserved= "")
Reads a CATCrvLimits.
Parameters:
ioCrvLimits
The read CATCrvLimits.
ipCurve
The CATCurve with which the CATCrvLimits is associated.
iReservedLabel
Reserved for future use. Do not change the default value.
o ReadCrvParam
public void ReadCrvParam(CATCrvParam& ioCrvParam,
CATCurve* ipCurve,
const char[] iLabelReserved= "")
Reads a CATCrvParam.
Parameters:
ioCrvParam
The read CATCrvParam.
ipCurve
The CATCurve with which the CATCrvParam is associated.
iReservedLabel
Reserved for future use. Do not change the default value.
o ReadGeometryV5
public void ReadGeometryV5(CATICGMObject** geometry,
const CATLONG32 iNbGeometry,
const char[] iReservedLabel= "")
Read an array of CGM objects.
Parameters:
geometry
A pointer to the array of read CATICGMObjects.
iNbGeometry
The number of CATICGMObjects to read.
iReservedLabel
Reserved for future use. Do not change the default value.
o ReadKnotVector
public void ReadKnotVector(CATKnotVector& ioKnotVector,
const char[] iLabelReserved= "")
Reads a CATKnotVector.
Parameters:
ioKnotVector
The read CATKnotVector.
iReservedLabel
Reserved for future use. Do not change the default value.
o ReadLinkedObjectsCount
public void ReadLinkedObjectsCount(CATULONG32& ioLinkedObjectsCount)
Reads the linked objects count.
Parameters:
ioLinkedObjectsCount
The number of linked objects that are requsted by this.
o ReadListOfLinkedObjects
public void ReadListOfLinkedObjects(CATLISTP(CATICGMObject)& ioLinkedObjects,
const char[] iLabelReserved= "")
Reads the total list of linked objects.
Parameters:
ioLinkedObjects
The list of linked objects. This list does not need to be empty in order to make the concatenation easier.
iReservedLabel
Reserved for future use. Do not change the default value.
o ReadObject
public void ReadObject(CATICGMObject*& ioLinkedObject,
const char[] iLabelReserved= "")
Reads a linked object.
Parameters:
ioLinkedObject
Retrieves the current linked object.
iReservedLabel
Reserved for future use. Do not change the default value.
o ReadSurLimits
public void ReadSurLimits(CATSurLimits& ioSurLimits,
CATSurface* ipSurface,
const char[] iLabelReserved= "")
Reads a CATSurLimits.
Parameters:
ioSurLimits
The read CATSurLimits.
ipSurface
The CATSurface with which the CATSurLimits is associated.
iReservedLabel
Reserved for future use. Do not change the default value.
o ReadSurParam
public void ReadSurParam(CATSurParam& ioSurParam,
CATSurface* ipSurface,
const char[] iLabelReserved= "")
Reads a CATSurParam.
Parameters:
ioSurParam
The read CATSurParam.
ipSurface
The CATSurface with which the CATSurParam is associated.
iReservedLabel
Reserved for future use. Do not change the default value.
o ResetToRawBehaviour
public void ResetToRawBehaviour()
Resets the stream to raw behaviour.
This removes checks on the stream use (i.e. when no object streaming/unstreaming).
o SkipRemainingInformationsToRead
public void SkipRemainingInformationsToRead()
Skips over remaining informations to read.
(i.e. what follows the linked objects sequence)
o SkipRemainingLinkedObjectsToRead
public void SkipRemainingLinkedObjectsToRead()
Skips over remaining linked objects to read.
o WriteCrvLimits
public void WriteCrvLimits( const CATCrvLimits& ioCrvLimits,
const char[] iLabelReserved= "")
Writes a CATCrvLimits.
Parameters:
ioCrvLimits
The CATCrvLimits to write.
iReservedLabel
Reserved for future use. Do not change the default value.
o WriteCrvParam
public void WriteCrvParam( const CATCrvParam& ioCrvParam,
const char[] iLabelReserved= "")
Writes a CATCrvParam.
Parameters:
ioCrvParam
The CATCrvParam to write.
iReservedLabel
Reserved for future use. Do not change the default value.
o WriteGeometryV5
public void WriteGeometryV5(CATICGMObject** geometry,
const CATLONG32 iNbGeometry,
const char[] iReservedLabel= "")
Writes an array of CGM objects.
Parameters:
geometry
A pointer to the array of CATICGMObjects to write.
iNbGeometry
The number of CATICGMObjects to write.
iReservedLabel
Reserved for future use. Do not change the default value.
o WriteKnotVector
public void WriteKnotVector( const CATKnotVector& ioKnotVector,
const char[] iLabelReserved= "")
Writes a CATKnotVector.
Parameters:
ioKnotVector
The CATKnotVector to write.
iReservedLabel
Reserved for future use. Do not change the default value.
o WriteLinkedObjectsCount
public void WriteLinkedObjectsCount(CATULONG32 iLinkedObjectsCount)
Writes the linked objects count.
Refer to the CATCGMStream.PrepareToObjectStreaming method for explanations about the write functions sequence.
o WriteListOfLinkedObjects
public void WriteListOfLinkedObjects( const CATLISTP(CATICGMObject)& iLinkedObjects,
const char[] iLabelReserved= "")
Writes a (partial or total) list of linked objects.
Refer to CATCGMStream.PrepareToObjectStreaming method for explanations about the write functions sequence.
Parameters:
iReservedLabel
Reserved for future use. Do not change the default value.
o WriteObject
public void WriteObject(CATICGMObject* iLinkedObject,
const char[] iLabelReserved= "")
Writes a linked object.
Refer to CATCGMStream.PrepareToObjectStreaming method for explanations about the write functions sequence.
Parameters:
iReservedLabel
Reserved for future use. Do not change the default value.
o WriteSurLimits
public void WriteSurLimits( const CATSurLimits& ioSurLimits,
const char[] iLabelReserved= "")
Writes a CATSurLimits.
Parameters:
ioSurLimits
The CATSurLimits to write.
iReservedLabel
Reserved for future use. Do not change the default value.
o WriteSurParam
public void WriteSurParam( const CATSurParam& ioSurParam,
const char[] iLabelReserved= "")
Writes a CATSurParam.
Parameters:
ioSurParam
The CATSurParam to write.
iReservedLabel
Reserved for future use. Do not change the default value.

This object is included in the file: CATCGMStream.h
If needed, your Imakefile.mk should include the module: CATGeometricObjects

Copyright © 2003, Dassault Systèmes. All rights reserved.