CgmObject Class Reference

Provides access to CGM data for an graphic object. More...

#include <CgmObject.h>

Inheritance diagram for CgmObject:

Inheritance graph

List of all members.

Public Member Functions

virtual short * toCgm (int &lBytes)=0
virtual int fromCgm (short *pData)=0
virtual bool serializeCgm (const std::string &fileName)=0
virtual bool deserializeCgm (const std::string &fileName)=0
virtual void setMetafileName (const std::string &metafileName)=0
virtual const std::string & getMetafileName () const =0
virtual void setPictureName (const std::string &metafileName)=0
virtual const std::string & getPictureName () const =0
virtual void setMetafileDescription (const std::string &metafileDescription)=0
virtual const std::string & getMetafileDescription () const =0
virtual void setFontList (const std::vector< std::string > &fontList)=0
virtual void getFontList (std::vector< std::string > &fontList) const =0
virtual short getVersion () const =0
virtual short getColorSelectionMode () const =0
virtual short getEdgeWidthMode () const =0
virtual short getLineWidthMode () const =0
virtual void destroy ()=0

Protected Member Functions

virtual ~CgmObject ()


Detailed Description

Provides access to CGM data for an graphic object.

Any graphic object can be converted to a CGM format using the CgmObject class. A CgmObject is obtained using the GraphicObject::convertToCgm() method. The class provides access functions to the CGM metadata as well as conversion methods to read and write the object in CGM binary format.

This subclass of Subject will notify upon the following conditions:

See also:
GraphicObject, GraphicObject::convertToCgm()

Definition at line 28 of file CgmObject.h.


Constructor & Destructor Documentation

virtual CgmObject::~CgmObject (  )  [protected, virtual]

This should be destroyed by calling GraphicLayer::removeObject.

Definition at line 181 of file CgmObject.h.


Member Function Documentation

virtual short* CgmObject::toCgm ( int &  lBytes  )  [pure virtual]

Converts the graphic object to CGM binary format.

Parameters:
lBytes Populated with the total length in bytes of the CGM data.
Returns:
A pointer to the CGM data for the graphic object. NULL is returned if an error occurs.
See also:
fromCgm()

virtual int CgmObject::fromCgm ( short *  pData  )  [pure virtual]

Modifies the properties of the graphic object to that contained in the given CGM binary data.

Parameters:
pData A pointer to the CGM data to use to convert the graphic object.
Returns:
int The total number of bytes read of the CGM data. A value of -1 is returned if an error occurs.
See also:
toCgm()

virtual bool CgmObject::serializeCgm ( const std::string &  fileName  )  [pure virtual]

Save a CGM to a file in binary format.

Parameters:
fileName The name of the file to serialize the data to.
See also:
deserializeCgm()

virtual bool CgmObject::deserializeCgm ( const std::string &  fileName  )  [pure virtual]

Load a CGM from a file in binary format.

Parameters:
fileName The name of the file to deserialize the data from.
See also:
serializeCgm()

virtual void CgmObject::setMetafileName ( const std::string &  metafileName  )  [pure virtual]

Sets the Begin Metafile element name.

Parameters:
metafileName The new name for the element.

virtual const std::string& CgmObject::getMetafileName (  )  const [pure virtual]

Returns the Begin Metafile element name.

Returns:
The element name.

virtual void CgmObject::setPictureName ( const std::string &  metafileName  )  [pure virtual]

Sets the Begin Picture element name.

Parameters:
metafileName The new name for the element.

virtual const std::string& CgmObject::getPictureName (  )  const [pure virtual]

Returns the Begin Picture element name.

Returns:
The element name.

virtual void CgmObject::setMetafileDescription ( const std::string &  metafileDescription  )  [pure virtual]

Sets the Metafile Description element value.

Parameters:
metafileDescription The new description.

virtual const std::string& CgmObject::getMetafileDescription (  )  const [pure virtual]

Returns the Metafile Description element value.

Returns:
The metafile description.

virtual void CgmObject::setFontList ( const std::vector< std::string > &  fontList  )  [pure virtual]

Sets the font names for the Font List element.

Parameters:
fontList The font names.

virtual void CgmObject::getFontList ( std::vector< std::string > &  fontList  )  const [pure virtual]

Returns the font names for the Font List element.

Parameters:
fontList Populated with the font names from the font list.

virtual short CgmObject::getVersion (  )  const [pure virtual]

Returns the Metafile Version element value.

Returns:
The metafile version.

virtual short CgmObject::getColorSelectionMode (  )  const [pure virtual]

Returns the Color Selection Mode element value.

Returns:
The color selection mode.

virtual short CgmObject::getEdgeWidthMode (  )  const [pure virtual]

Returns the Edge Width Specification Mode element value.

Returns:
The edge width specification mode.

virtual short CgmObject::getLineWidthMode (  )  const [pure virtual]

Returns the Line Width Specification Mode element value.

Returns:
The line width specification mode.

virtual void CgmObject::destroy (  )  [pure virtual]

Destroys the CGM graphic object.

The CGM object becomes invalid after this method is called, so pointers to the object should be reset to NULL.


Software Development Kit - Opticks 4.9.0 Build 16218