A normal surface filter that filters by basic properties of the normal surface. More...
#include <sfproperties.h>
Public Member Functions | |
NSurfaceFilterProperties () | |
Creates a new surface filter that accepts all normal surfaces. | |
NSurfaceFilterProperties (const NSurfaceFilterProperties &cloneMe) | |
Creates a new surface filter that is a clone of the given surface filter. | |
const std::set< NLargeInteger > & | getECs () const |
Returns the set of allowable Euler characteristics. | |
unsigned long | getNumberOfECs () const |
Returns the number of allowable Euler characteristics. | |
NLargeInteger | getEC (unsigned long index) const |
Returns the allowable Euler characteristic at the given index in the set. | |
NBoolSet | getOrientability () const |
Returns the set of allowable orientabilities. | |
NBoolSet | getCompactness () const |
Returns the set of allowable compactness properties. | |
NBoolSet | getRealBoundary () const |
Returns the set of allowable has-real-boundary properties. | |
void | addEC (const NLargeInteger &ec) |
Adds the given Euler characteristic to the set of allowable Euler characteristics. | |
void | removeEC (const NLargeInteger &ec) |
Removes the given Euler characteristic from the set of allowable Euler characteristics. | |
void | removeAllECs () |
Empties the set of allowable Euler characteristics. | |
void | setOrientability (const NBoolSet &value) |
Sets the set of allowable orientabilities. | |
void | setCompactness (const NBoolSet &value) |
Sets the set of allowable compactness properties. | |
void | setRealBoundary (const NBoolSet &value) |
Sets the set of allowable has-real-boundary properties. | |
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. | |
virtual void | writeProperties (NFile &out) const |
Writes to the given old-style binary file any properties associated specifically with this particular subclass of NSurfaceFilter. | |
virtual void | readIndividualProperty (NFile &infile, unsigned propType) |
Reads an individual property from an old-style binary file. |
A normal surface filter that filters by basic properties of the normal surface.
If a property of the surface (such as Euler characteristic or orientability) cannot be determined, the surface will pass any test based on that particular property. For instance, say a surface is required to be both orientable and compact, and say that orientability cannot be determined. Then the surface will be accepted solely on the basis of whether or not it is compact.
regina::NSurfaceFilterProperties::NSurfaceFilterProperties | ( | ) | [inline] |
Creates a new surface filter that accepts all normal surfaces.
regina::NSurfaceFilterProperties::NSurfaceFilterProperties | ( | const NSurfaceFilterProperties & | 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::NSurfaceFilterProperties::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.
void regina::NSurfaceFilterProperties::addEC | ( | const NLargeInteger & | ec | ) | [inline] |
Adds the given Euler characteristic to the set of allowable Euler characteristics.
See getECs() for further details.
ec | the new allowable Euler characteristic. |
NBoolSet regina::NSurfaceFilterProperties::getCompactness | ( | ) | const [inline] |
Returns the set of allowable compactness properties.
Note that this is a subset of { true, false }
. Any surface whose compactness property is not in this set will not be accepted by this filter.
NLargeInteger regina::NSurfaceFilterProperties::getEC | ( | unsigned long | index | ) | const |
Returns the allowable Euler characteristic at the given index in the set.
See getECs() for further details.
index | the index in the set of allowable Euler characteristics; this must be between 0 and getNumberOfECs()-1 inclusive. |
const std::set< NLargeInteger > & regina::NSurfaceFilterProperties::getECs | ( | ) | const [inline] |
Returns the set of allowable Euler characteristics.
Any surface whose Euler characteristic is not in this set will not be accepted by this filter. The set will be given in ascending order with no element repeated.
If this set is empty, all Euler characteristics will be accepted.
virtual int regina::NSurfaceFilterProperties::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::NSurfaceFilterProperties::getFilterName | ( | ) | const [virtual] |
Returns a string description of the filtering method that is this particular subclass of NSurfaceFilter.
Reimplemented from regina::NSurfaceFilter.
unsigned long regina::NSurfaceFilterProperties::getNumberOfECs | ( | ) | const [inline] |
Returns the number of allowable Euler characteristics.
See getECs() for further details.
NBoolSet regina::NSurfaceFilterProperties::getOrientability | ( | ) | const [inline] |
Returns the set of allowable orientabilities.
Note that this is a subset of { true, false }
. Any surface whose orientability is not in this set will not be accepted by this filter.
NBoolSet regina::NSurfaceFilterProperties::getRealBoundary | ( | ) | const [inline] |
Returns the set of allowable has-real-boundary properties.
Note that this is a subset of { true, false }
. Any surface whose has-real-boundary property is not in this set will not be accepted by this filter.
static NXMLFilterReader* regina::NSurfaceFilterProperties::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::NSurfaceFilterProperties::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.
virtual void regina::NSurfaceFilterProperties::readIndividualProperty | ( | NFile & | infile, | |
unsigned | propType | |||
) | [protected, virtual] |
Reads an individual property from an old-style binary file.
The property type and bookmarking details should not read; merely the contents of the property that are written to file between NFile::writePropertyHeader() and NFile::writePropertyFooter(). See the NFile::writePropertyHeader() notes for details.
The property type of the property to be read will be passed in propType. If the property type is unrecognised, this routine should simply do nothing and return. If the property type is recognised, this routine should read the property and process it accordingly (e.g., store it in whatever data object is currently being read).
infile | the file from which to read the property. This should be open for reading and at the position immediately after writePropertyHeader() would have been called during the corresponding write operation. | |
propType | the property type of the property about to be read. |
Reimplemented from regina::NSurfaceFilter.
void regina::NSurfaceFilterProperties::removeAllECs | ( | ) | [inline] |
Empties the set of allowable Euler characteristics.
See getECs() for further details.
Note that this will mean that this filter will allow any Euler characteristic to pass.
void regina::NSurfaceFilterProperties::removeEC | ( | const NLargeInteger & | ec | ) | [inline] |
Removes the given Euler characteristic from the set of allowable Euler characteristics.
See getECs() for further details.
Note that if the allowable set is completely emptied, this filter will allow any Euler characteristic to pass.
ec | the allowable Euler characteristic to remove. |
void regina::NSurfaceFilterProperties::setCompactness | ( | const NBoolSet & | value | ) | [inline] |
Sets the set of allowable compactness properties.
See getCompactness() for further details.
value | the new set of allowable compactness properties. |
void regina::NSurfaceFilterProperties::setOrientability | ( | const NBoolSet & | value | ) | [inline] |
Sets the set of allowable orientabilities.
See getOrientability() for further details.
value | the new set of allowable orientabilities. |
void regina::NSurfaceFilterProperties::setRealBoundary | ( | const NBoolSet & | value | ) | [inline] |
Sets the set of allowable has-real-boundary properties.
See getRealBoundary() for further details.
value | the new set of allowable has-real-boundary properties. |
void regina::NSurfaceFilterProperties::writeFilter | ( | NFile & | out | ) | const [inline, 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.
virtual void regina::NSurfaceFilterProperties::writeProperties | ( | NFile & | out | ) | const [protected, virtual] |
Writes to the given old-style binary file any properties associated specifically with this particular subclass of NSurfaceFilter.
This routine should consist of a call to the superclass implementation followed by a series of writePropertyHeader() and writePropertyFooter() calls with property information being written inside these pairs.
This routine should not call writeAllPropertiesFooter().
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.
virtual void regina::NSurfaceFilterProperties::writeTextLong | ( | std::ostream & | out | ) | const [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::NSurfaceFilterProperties::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::NSurfaceFilterProperties::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.