Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

HAPI::NetworkModel Class Reference

Inheritance diagram for HAPI::NetworkModel:

HAPI::Class HAPI::Domain List of all members.

Detailed Description

NetworkModel is the ancestor of both Domain and Class.

Since Class and Domain are, in many ways, conceptually and functionally similar, the NetworkModel class is introduced to capture this similarity. It contains functionality and variables that are identical for the two classes.

See also:
Class

Domain


Public Member Functions

double INFINITY () const
 The infinity value used by Hugin.

virtual void saveAsNet (const std::string &filename)=0
 Write a NET description of the networkModel to a file.

virtual std::string getAttribute (const std::string &key) const=0
 Return the value associated with key in the attribute list for this NetworkModel.

virtual std::string getFileName () const=0
 Return the file name most recently used for loading or saving this NetworkModel.

virtual NodeList getNodes () const=0
 Return the Nodes of this NetworkModel.

virtual NodegetNodeByName (const std::string &name) const=0
 Return the node in the NetworkModel, which is identified by the given name.

void setUserData (void *data)
 Set the user data field of this NetworkModel.

void * getUserData () const
 Return the value stored within the user data slot of this NetworkModel.

virtual NodeList parseNodes (const std::string &filename, ParseListener *errorHandler)=0
 Create a nodelist from the data in the given file.

virtual void setAttribute (const std::string &key, const std::string &value)=0
 Insert the key/value pair in the attribute list for this NetworkModel.

virtual void setLogFile (FILE *log)=0
 Set the file to be used for logging by subsequent compilation, triangulation, and table generation operations.

virtual bool hasAttribute (const std::string &key) const=0
 Test if this NetworkModel contains an attribute with the specified key.

virtual std::pair< size_t,
size_t > 
getNodeSize () const=0
 Return the size of the displayed nodes.

virtual void setNodeSize (size_t width, size_t height)=0
 Set the size of the nodes.

virtual AttributeList getAttributes () const=0
 Return all the attributes associated with this NetworkModel.

virtual void generateTables ()=0
 Generate tables for all Nodes, having a Model, in the NetworkModeL.


Member Function Documentation

virtual void HAPI::NetworkModel::generateTables  )  [pure virtual]
 

Generate tables for all Nodes, having a Model, in the NetworkModeL.

This is done by calling Node::GenerateTable () for each applicable Node. The operation is aborted, if table generation fails for some Node. This may leave the NetworkModel in a state, where some Nodes have got generated Tables, some have not got generated Tables, and one has a partially generated Table. In this case, an exception is thrown.

Implemented in HAPI::Class, and HAPI::Domain.

virtual std::string HAPI::NetworkModel::getAttribute const std::string &  key  )  const [pure virtual]
 

Return the value associated with key in the attribute list for this NetworkModel.

Returns:
Standard C++ Library string containing the attribure value.

Implemented in HAPI::Class, and HAPI::Domain.

virtual AttributeList HAPI::NetworkModel::getAttributes  )  const [pure virtual]
 

Return all the attributes associated with this NetworkModel.

Returns:
A vector of all Attributes

Implemented in HAPI::Class, and HAPI::Domain.

virtual std::string HAPI::NetworkModel::getFileName  )  const [pure virtual]
 

Return the file name most recently used for loading or saving this NetworkModel.

Returns:
A Standard C++ Library string.

Implemented in HAPI::Class, and HAPI::Domain.

virtual Node* HAPI::NetworkModel::getNodeByName const std::string &  name  )  const [pure virtual]
 

Return the node in the NetworkModel, which is identified by the given name.

Parameters:
name A Standard C++ string containing the name of the node to be found in this NetworkModel.
Returns:
Reference to a node in the NetworkModel carrying the name specified by the input. On error an exception will be thrown.

Implemented in HAPI::Class, and HAPI::Domain.

virtual NodeList HAPI::NetworkModel::getNodes  )  const [pure virtual]
 

Return the Nodes of this NetworkModel.

No ordering can be inferred by the user.

Returns:
NodeList containing the Nodes of this Domain.

Implemented in HAPI::Class, and HAPI::Domain.

virtual std::pair<size_t, size_t> HAPI::NetworkModel::getNodeSize  )  const [pure virtual]
 

Return the size of the displayed nodes.

Returns:
Standard C++ Library pair<int,int>.

Implemented in HAPI::Class, and HAPI::Domain.

void* HAPI::NetworkModel::getUserData  )  const [inline]
 

Return the value stored within the user data slot of this NetworkModel.

If the stored value is NULL, or if no value has been stored, NULL is returned. It is the responsibility of the application programmer to ensure that the data is valid, that pointers are accessed correctly, etc.

Also note that when you delete a NetworkModel, Hugin does not attempt to delete the data pointed to by the user data slot. It is the responsibility of the user.

Returns:
Pointer stored within the NetworkModel object as a reference to user data associated with this NetworkModel.

virtual bool HAPI::NetworkModel::hasAttribute const std::string &  key  )  const [pure virtual]
 

Test if this NetworkModel contains an attribute with the specified key.

Parameters:
key A Standar C++ Library string.
Returns:
boolean

Implemented in HAPI::Class, and HAPI::Domain.

double HAPI::NetworkModel::INFINITY  )  const
 

The infinity value used by Hugin.

Returns:
infinity, represented as a double

virtual NodeList HAPI::NetworkModel::parseNodes const std::string &  filename,
ParseListener errorHandler
[pure virtual]
 

Create a nodelist from the data in the given file.

This is typically used together with the triangulateWithOrder function.

Parameters:
filename The name of the file containing the node list description
errorHandler An instance of a ParseListener for handling errors during the parsing.

Implemented in HAPI::Class, and HAPI::Domain.

virtual void HAPI::NetworkModel::saveAsNet const std::string &  filename  )  [pure virtual]
 

Write a NET description of the networkModel to a file.

Parameters:
filename The name of the file to save to.

Implemented in HAPI::Class, and HAPI::Domain.

virtual void HAPI::NetworkModel::setAttribute const std::string &  key,
const std::string &  value
[pure virtual]
 

Insert the key/value pair in the attribute list for this NetworkModel.

If the key is already defined, the value is updated. If no value is provided, the attribute is removed.

Parameters:
key A Standard C++ Library string.
value A Standard C++ Library string.

Implemented in HAPI::Class, and HAPI::Domain.

virtual void HAPI::NetworkModel::setLogFile FILE *  log  )  [pure virtual]
 

Set the file to be used for logging by subsequent compilation, triangulation, and table generation operations.

Parameters:
log File pointer to an opened file to be used as log. log must be a text file opened for writing or appending. Writing is done sequentially.

Implemented in HAPI::Class, and HAPI::Domain.

virtual void HAPI::NetworkModel::setNodeSize size_t  width,
size_t  height
[pure virtual]
 

Set the size of the nodes.

Parameters:
width 
height 

Implemented in HAPI::Class, and HAPI::Domain.

void HAPI::NetworkModel::setUserData void *  data  )  [inline]
 

Set the user data field of this NetworkModel.

The Hugin API provides a slot within each NetworkModel object for use exclusively by the user/application. This slot can hold a pointer to arbitrary data, such as a file, a function pointer, etc. Please note that Hugin does not do anything to the user data. Data is not even copied. Only the pointer to the data is stored.

Parameters:
data Pointer to user-defined data associated with *this NetworkModel.


Copyright Hugin Expert A/S 1993-2004