Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Surface Class Reference

#include <Surface.h>

Inheritance diagram for Surface:

Inheritance graph
[legend]
Collaboration diagram for Surface:

Collaboration graph
[legend]
List of all members.

Detailed Description

The Surface class, which is inherited by all surfaces.

So far the only item that all surfaces share is a meshed representation.

Definition at line 43 of file Surface.h.

Object Naming

void checkObjectName ()
 See if the objectName has not been set yet.

std::string registry_name
 The name of the Surface class.

std::string objectName
 The name of the Surface object when instantiated.

std::string defaultObjectNamePrefix = std::string("~!")
 The prefix added to the default object instance name.

unsigned int objectNumber = 0
 The number of the instanced object used for the object name.


Public Member Functions

 Surface ()
 default constructor

virtual const std::string name ()
 Return the name of this Surface.

std::string getObjectName ()
 < Return name of 'class' of Surface

const char * getObjectNameAsCString ()
 Returns the name of the object (sans prefix) as a C-string.

std::string getFullObjectName ()
 Returns the name of the instanced object WITH any 'default' prefix.

const char * getFullObjectNameAsCString ()
 Returns the name of the object (with prefix) as a C-string.

void setObjectName (std::string)
 Sets the name of the object to the passed-in string.

void setObjectName (char *)
 Sets the name of the object to the passed-in C-string.

virtual void resetObjectName ()
 Sets the name of the object to a unique 'default' name.

bool objectNameIsDefault ()
 Returns true if the object name has a 'default' prefix.

void setObjectNumber (int)
 Sets the internal unique object counter number.


Protected Attributes

gmMesh m_mesh


Constructor & Destructor Documentation

Surface::Surface  ) 
 

default constructor

Definition at line 4 of file Surface.cpp.


Member Function Documentation

void Surface::checkObjectName  )  [protected]
 

See if the objectName has not been set yet.

If the objectName value is empty (ie. ""), then we call resetObjectName to give the object a 'default' object name. This method is called every time you try to get the objectName to make sure that the objectName has been properly initialized. The objectName string can never be empty since if you try to pass the empty string to setObjectName(), that method resets the object name to be the default prefix. If the objectName string is ever empty, then something has gone wrong!

Definition at line 168 of file Surface.cpp.

References objectName, and resetObjectName().

Referenced by getFullObjectName(), and getObjectName().

std::string Surface::getFullObjectName  ) 
 

Returns the name of the instanced object WITH any 'default' prefix.

If there is no 'default' prefix, then this method returns the same string as getObjectName(). This method returns a std::string.

Returns:
The name of the Surface object as a String with default prefix.
See also:
getObjectName();

getFullObjectNameAsCString();

Definition at line 63 of file Surface.cpp.

References checkObjectName(), and objectName.

Referenced by getFullObjectNameAsCString().

const char * Surface::getFullObjectNameAsCString  ) 
 

Returns the name of the object (with prefix) as a C-string.

If there is no 'default' prefix, then this method returns the same string as getObjectNameAsCString(). This method returns a C-string (char*).

Returns:
The name of the Surface object as a C-string with default prefix.
See also:
getObjectNameAsCString();

getFullObjectName();

Definition at line 77 of file Surface.cpp.

References getFullObjectName().

std::string Surface::getObjectName  ) 
 

< Return name of 'class' of Surface

If there is no 'default' prefix, then this method returns the same string as getFullObjectName(). This method returns a std::string.

Returns:
The name of the Surface object as a string sans default prefix.
See also:
getFullObjectName();

getObjectNameAsCString();

Definition at line 33 of file Surface.cpp.

References checkObjectName(), defaultObjectNamePrefix, objectName, and objectNameIsDefault().

Referenced by getObjectNameAsCString(), UnaryOp::getqname(), BinaryOp::getqname(), SearchDegenerate::print(), and SearchCritical::print().

const char * Surface::getObjectNameAsCString  ) 
 

Returns the name of the object (sans prefix) as a C-string.

If there is no 'default' prefix, then this method returns the same string as getFullObjectNameAsCString(). This method returns a C-string (char*).

Returns:
The name of the Surface object as a C-string sans default prefix.
See also:
getFullObjectNameAsCString();

getObjectName();

Definition at line 50 of file Surface.cpp.

References getObjectName().

const std::string Surface::name  )  [virtual]
 

Return the name of this Surface.

Since Surface does not define registry_name in Surface.cpp, it returns NULL. This should be the case for all abstract classes.

Returns:
registry_name The name of the Surface class.

Todo:
Make sure that NULL is the default value of registry_name in Unix/Linux.

Reimplemented in ClusterMesh.

Definition at line 20 of file Surface.cpp.

References registry_name.

Referenced by UnaryOp::getqname(), BinaryOp::getqname(), SurfaceInterrogator::qname(), ImplicitInterrogator::qname(), and ImpFileManager::writeImplicit().

bool Surface::objectNameIsDefault  ) 
 

Returns true if the object name has a 'default' prefix.

This method is useful in determining if the object's name is in a 'default' format so that you don't save the object's name to file.

Returns:
True if the object's name is in a default format (ie. has a 'default' prefix).

Definition at line 137 of file Surface.cpp.

References defaultObjectNamePrefix, and objectName.

Referenced by getObjectName(), and setObjectName().

void Surface::resetObjectName  )  [virtual]
 

Sets the name of the object to a unique 'default' name.

Reimplemented in ClusterMesh.

Definition at line 125 of file Surface.cpp.

References defaultObjectNamePrefix, and objectName.

Referenced by checkObjectName().

void Surface::setObjectName char *  newName  ) 
 

Sets the name of the object to the passed-in C-string.

This method is the same as setObjectName(std::string) but takes a C-string as the parameter.

Parameters:
newName The new name for the object.
See also:
setObjectName(std::string)

Definition at line 119 of file Surface.cpp.

References setObjectName().

void Surface::setObjectName std::string  newName  ) 
 

Sets the name of the object to the passed-in string.

Note that you CANNOT set the name of the object to a 'default' state by passing in a string with the 'default' prefix. This method will remove any 'default' prefix. If you want a default name for the object, use resetObjectName() OR pass in an empty string (see Note).

Parameters:
newName The new name for the object.
See also:
resetObjectName();
Note:
If you pass in an empty string, this method will set the string to be a 'default' name without any value. This will erase any name currently assigned to the object AND make the string equal to the 'default' prefix so that you don't save the empty name string to file.
Parameters:
newName The new name for the object.
See also:
setObjectName(char*);

Definition at line 97 of file Surface.cpp.

References defaultObjectNamePrefix, objectName, and objectNameIsDefault().

Referenced by setObjectName().

void Surface::setObjectNumber int  newNumber  ) 
 

Sets the internal unique object counter number.

This should only be used if you know what you are doing because it affects the names of all newly created Surface objects. You may want to use this after you have read in an Surface object file and notice that somehow one of the names is in the default object name format and need to update the internal object counter to be higher than that object's number. Use with care!

Parameters:
newNumber The new number for the internal object counter.

Definition at line 152 of file Surface.cpp.

References objectNumber.


Member Data Documentation

std::string Surface::defaultObjectNamePrefix = std::string("~!") [static, protected]
 

The prefix added to the default object instance name.

This is done so we know when the user has changed the object name.

Definition at line 9 of file Surface.cpp.

Referenced by getObjectName(), objectNameIsDefault(), resetObjectName(), and setObjectName().

gmMesh Surface::m_mesh [protected]
 

Definition at line 53 of file Surface.h.

Referenced by CatmullClarkSubdivision::buildVertex(), ModButterflySubdivision::compute(), loopSubdivision::compute(), CatmullClarkSubdivision::compute(), ButterflySubdivision::compute(), CatmullClarkSubdivision::divideEdge(), CatmullClarkSubdivision::divideFace(), and CatmullClarkSubdivision::subdivide().

std::string Surface::objectName [protected]
 

The name of the Surface object when instantiated.

This string should be equal to the CLASS name plus a unique number so that every Surface object has a unique name when first created.

Definition at line 65 of file Surface.h.

Referenced by checkObjectName(), getFullObjectName(), getObjectName(), objectNameIsDefault(), TriMesh::readFile(), resetObjectName(), ClusterMesh::resetObjectName(), and setObjectName().

unsigned int Surface::objectNumber = 0 [static, protected]
 

The number of the instanced object used for the object name.

This number is automatically incremented upon creation of a new Surface object so that every Surface has a unique name.

Definition at line 10 of file Surface.cpp.

Referenced by ClusterMesh::resetObjectName(), and setObjectNumber().

std::string Surface::registry_name [protected]
 

The name of the Surface class.

Reimplemented in ClusterMesh.

Definition at line 58 of file Surface.h.

Referenced by name().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:03:16 2004 for Advanced Surface Library by doxygen 1.3.4