A normal surface filter that simply combines other filters. More...
#include <sfcombination.h>
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 | |
static NXMLFilterReader * | getXMLFilterReader (NPacket *parent) |
Returns a newly created XML filter reader that will read the details of a particular type of surface filter. | |
static NSurfaceFilter * | readFilter (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 | |
static 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. |
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.
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.
cloneMe | the surface filter to clone. |
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
.
surface | the normal surface under investigation. |
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.
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.
Reimplemented from regina::NSurfaceFilter.
bool regina::NSurfaceFilterCombination::getUsesAnd | ( | ) | const [inline] |
Determines whether this is an and or an or combination.
true
if this is an and combination, or false
if this is an or combination. static 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.
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. |
Reimplemented from regina::NSurfaceFilter.
static 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.
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. |
Reimplemented from regina::NSurfaceFilter.
void regina::NSurfaceFilterCombination::setUsesAnd | ( | bool | value | ) | [inline] |
Sets whether this is an and or an or combination.
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.
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.
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.
out | the output stream to which the XML should be written. |
Reimplemented from regina::NSurfaceFilter.
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.