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

regina::NSurfaceFilterCombination Class Reference
[Normal Surfaces]

A normal surface filter that simply combines other filters. More...

#include <sfcombination.h>

Inheritance diagram for regina::NSurfaceFilterCombination:

regina::NSurfaceFilter regina::NPacket regina::NFilePropertyReader regina::ShareableObject regina::boost::noncopyable List of all members.

Public Member Functions

 NSurfaceFilterCombination ()
 Creates a new surface filter that accepts all normal surfaces.
 NSurfaceFilterCombination (const NSurfaceFilterCombination &cloneMe)
 Creates a new surface filter that is a clone of the given surface filter.
bool getUsesAnd () const
 Determines whether this is an and or an or combination.
void setUsesAnd (bool value)
 Sets whether this is an and or an or combination.
virtual bool accept (const NNormalSurface &surface) const
 Decides whether or not the given normal surface is accepted by this filter.
virtual void writeTextLong (std::ostream &out) const
 Writes this object in long text format to the given output stream.
virtual int getFilterID () const
 Returns the unique integer ID corresponding to the filtering method that is this particular subclass of NSurfaceFilter.
virtual std::string getFilterName () const
 Returns a string description of the filtering method that is this particular subclass of NSurfaceFilter.

Static Public Member Functions

NXMLFilterReadergetXMLFilterReader (NPacket *parent)
 Returns a newly created XML filter reader that will read the details of a particular type of surface filter.
NSurfaceFilterreadFilter (NFile &in, NPacket *parent)
 Reads the details of a normal surface filter from the specified old-style binary file and returns a newly created filter containing that information.

Static Public Attributes

const int filterID
 Contains the integer ID for this type of surface filter.

Protected Member Functions

virtual void writeXMLFilterData (std::ostream &out) const
 Writes a chunk of XML containing the details of this filter.
virtual void writeFilter (NFile &out) const
 Writes the details of this filter to the given old-style binary file.

Detailed Description

A normal surface filter that simply combines other filters.

This filter will combine, using boolean and or or, all of the filters that are immediate children of this packet. This packet may have children that are not normal surface filters; such children will simply be ignored.

If there are no immediate child filters, a normal surface will be accepted if this is an and filter and rejected if this is an or filter.


Constructor & Destructor Documentation

regina::NSurfaceFilterCombination::NSurfaceFilterCombination  )  [inline]
 

Creates a new surface filter that accepts all normal surfaces.

This will be an and filter.

regina::NSurfaceFilterCombination::NSurfaceFilterCombination const NSurfaceFilterCombination cloneMe  )  [inline]
 

Creates a new surface filter that is a clone of the given surface filter.

Parameters:
cloneMe the surface filter to clone.


Member Function Documentation

virtual bool regina::NSurfaceFilterCombination::accept const NNormalSurface surface  )  const [virtual]
 

Decides whether or not the given normal surface is accepted by this filter.

The default implementation simply returns true.

Parameters:
surface the normal surface under investigation.
Returns:
true if and only if the given surface is accepted by this filter.

Reimplemented from regina::NSurfaceFilter.

virtual int regina::NSurfaceFilterCombination::getFilterID  )  const [virtual]
 

Returns the unique integer ID corresponding to the filtering method that is this particular subclass of NSurfaceFilter.

Returns:
the unique integer filtering method ID.

Reimplemented from regina::NSurfaceFilter.

virtual std::string regina::NSurfaceFilterCombination::getFilterName  )  const [virtual]
 

Returns a string description of the filtering method that is this particular subclass of NSurfaceFilter.

Returns:
a string description of this filtering method.

Reimplemented from regina::NSurfaceFilter.

bool regina::NSurfaceFilterCombination::getUsesAnd  )  const [inline]
 

Determines whether this is an and or an or combination.

Returns:
true if this is an and combination, or false if this is an or combination.

NXMLFilterReader* regina::NSurfaceFilterCombination::getXMLFilterReader NPacket parent  )  [static]
 

Returns a newly created XML filter reader that will read the details of a particular type of surface filter.

You may assume that the filter to be read is of the same type as the class in which you are implementing this routine.

The XML filter reader should read exactly what writeXMLFilterData() writes, and vice versa.

parent represents the packet which will become the new filter's parent in the tree structure. This information is for reference only, and need not be used. See the description of parameter parent in NPacket::getXMLReader() for further details.

Python:
Not present.
Parameters:
parent the packet which will become the new filter's parent in the tree structure, or 0 if the new filter is to be tree matriarch.
Returns:
the newly created XML filter reader.

Reimplemented from regina::NSurfaceFilter.

NSurfaceFilter* regina::NSurfaceFilterCombination::readFilter NFile in,
NPacket parent
[static]
 

Reads the details of a normal surface filter from the specified old-style binary file and returns a newly created filter containing that information.

You may assume that the filter is of the same class as the class in which you are implementing this routine. The newly created filter must also be of this type.

The general packet information and the filter ID may be assumed to have already been read from the file, and should not be reread. The readFilter() routine should read exactly what writeFilter() writes, and vice versa.

Properties should not be read from here; this will be done later by another routine.

parent represents the packet which will become the new filter's parent in the tree structure. This information is for reference only, and need not be used. See the description of parameter parent in NPacket::readPacket() for further details.

New filter types should make this routine simply return 0 since this file format is now obsolete, and older calculation engines will not understand newer filter types anyway.

Deprecated:
For the preferred way to read filters from file, see getXMLFilterReader() and class NXMLFilterReader instead.
Precondition:
The given file is open for reading and all above conditions have been satisfied.
Python:
Not present.
Parameters:
in the file from which to read the filter.
parent the packet which will become the new filter's parent in the tree structure, or 0 if the new filter is to be tree matriarch.
Returns:
the filter read from file, or 0 if an error occurred.

Reimplemented from regina::NSurfaceFilter.

void regina::NSurfaceFilterCombination::setUsesAnd bool  value  )  [inline]
 

Sets whether this is an and or an or combination.

Parameters:
value true if this is to be an and combination, or false if this is to be an or combination.

virtual void regina::NSurfaceFilterCombination::writeFilter NFile out  )  const [protected, virtual]
 

Writes the details of this filter to the given old-style binary file.

You may assume that general packet information and the filter ID have already been written. Only the actual data stored for this particular subclass of NSurfaceFilter need be written.

Properties should not be written from here; this will be done later by another routine.

The default implementation for this routine does nothing; new filter types should not implement this routine since this file format is now obsolete, and older calculation engines will simply skip unknown filter types when reading from binary files.

Deprecated:
For the preferred way to write data to file, see writeXMLFilterData() instead.
Precondition:
The given file is open for writing and satisfies the assumptions listed above.
Parameters:
out the file to be written to.

Reimplemented from regina::NSurfaceFilter.

void regina::NSurfaceFilterCombination::writeTextLong std::ostream &  out  )  const [inline, virtual]
 

Writes this object in long text format to the given output stream.

The output should provided the user with all the information they could want. The output should end with a newline.

The default implementation of this routine merely calls writeTextShort() and adds a newline.

Python:
The parameter out does not exist; standard output will be used.
Parameters:
out the output stream to which to write.

Reimplemented from regina::ShareableObject.

virtual void regina::NSurfaceFilterCombination::writeXMLFilterData std::ostream &  out  )  const [protected, virtual]
 

Writes a chunk of XML containing the details of this filter.

You may assume that the filter opening tag (including the filter type) has already been written, and that the filter closing tag will be written immediately after this routine is called. This routine need only write the additional details corresponding to this particular subclass of NSurfaceFilter.

Parameters:
out the output stream to which the XML should be written.

Reimplemented from regina::NSurfaceFilter.


Member Data Documentation

const int regina::NSurfaceFilterCombination::filterID [static]
 

Contains the integer ID for this type of surface filter.

Each distinct filtering class must have a unique ID, and this should be a non-negative integer. See filterregistry.h for further details.

This member must be declared for every filtering class that will be instantiated. A value need not be assigned; filterregistry.h will take care of this task when you register the filtering class.

Reimplemented from regina::NSurfaceFilter.


The documentation for this class was generated from the following file:
Copyright © 1999-2004, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).