The Original CHomP Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
chomp::homengin::cellistfile Class Reference

Text list of cubical cells. More...

#include <cubfiles.h>

Inheritance diagram for chomp::homengin::cellistfile:
chomp::homengin::cubfile

Public Member Functions

 cellistfile (const char *filename)
 The constructor. More...
 
int dim () const
 What is the dimension of the set of cubes? More...
 
int count () const
 How many cubes are there in the set? More...
 
bool bitmaptype () const
 Is this a bitmap type of set of cubes? More...
 
bool elementary () const
 Is this a set of elementary cubes, as opposed to full cubes? More...
 
int boundingbox (int *mincoord, int *maxcoord) const
 Determines the bounding box of the set of cubical cells. More...
 
int readcubes (chomp::homology::CubicalComplex &s) const
 Reads a set of cubical cells from the file. More...
 
int readcubes (chomp::homology::SetOfCubes &s) const
 Reads a cubical set from the file. More...
 
int readcubes (int *&sizes, char *&bytes, int padding=0, bool power2=false) const
 Reads a bitmap from a file. More...
 
- Public Member Functions inherited from chomp::homengin::cubfile
 cubfile (const char *_filename)
 The default constructor. More...
 
virtual ~cubfile ()
 The destructor. More...
 
const char * filename () const
 What is the name of the associated disk file? More...
 
virtual int dim () const
 What is the dimension of the set of cubes? More...
 
virtual int count () const
 How many cubes are there in the set? More...
 
virtual bool bitmaptype () const
 Is this a bitmap type of set of cubes? More...
 
virtual bool elementary () const
 Is this a set of elementary cubes, as opposed to full cubes? More...
 
virtual bool spacewrapping () const
 Does this set include the definition of space wrapping? More...
 
virtual int * spacewrapping (int *table) const
 Fills in the space wrapping table if applicable. More...
 
virtual void setwrapping (const int *table, int count=0)
 Sets the space wrapping according to the given table. More...
 
virtual int boundingbox (int *mincoord, int *maxcoord) const
 Determines the bounding box of the set of cubes. More...
 
int volume (int chunk=0, bool power2=false) const
 Determine the volume of the bounding box of the set of cubes. More...
 
virtual int readcubes (chomp::homology::CubicalComplex &s) const
 Reads a set of cubical cells from the file. More...
 
virtual int readcubes (chomp::homology::SetOfCubes &s) const
 Reads a set of cubes from the file. More...
 
virtual int readcubes (int *&sizes, char *&bytes, int padding=0, bool power2=false) const
 Reads a bitmap from a file. More...
 

Static Public Member Functions

static const char * name ()
 The name of this type of a cubical set. More...
 
static std::ostream & describe (std::ostream &out)
 Describes this particular type of a set of cubes. More...
 
static bool compatible (const char *filename)
 Verifies if the file format is compatible with this cubfile type. More...
 
- Static Public Member Functions inherited from chomp::homengin::cubfile
static const char * name ()
 The name of this type of a cubical set. More...
 
static std::ostream & describe (std::ostream &out)
 Describes this particular type of a set of cubes. More...
 
static bool compatible (const char *filename)
 Verifies if the file format is compatible with this cubfile type. More...
 

Private Member Functions

void analyze () const
 Analyzes the file to determine the number of cubes and the scope of their coordinates. More...
 

Static Private Attributes

static cubfile_traits< cellistfilet
 Add this type of a cubical set to the list. More...
 

Additional Inherited Members

- Protected Attributes inherited from chomp::homengin::cubfile
std::string _filename
 The name of the corresponding disk file. More...
 
int _dim
 The dimension of the space, 0 if unknown. More...
 
int _count
 The number of cubes in the set, -1 if unknown. More...
 
std::vector< int > _min
 The minimal coordinates of the cubes' corners (bounding box). More...
 
std::vector< int > _max
 The maximal coordinates of the cubes' corners (bounding box). More...
 
std::vector< int > _wrapping
 The space wrapping information if any. More...
 

Detailed Description

Text list of cubical cells.

Definition at line 431 of file cubfiles.h.

Constructor & Destructor Documentation

◆ cellistfile()

chomp::homengin::cellistfile::cellistfile ( const char *  filename)
inline

The constructor.

Definition at line 508 of file cubfiles.h.

508 : cubfile (filename)
509{
510 return;
511} /* cellistfile::cellistfile */
cubfile(const char *_filename)
The default constructor.
Definition: cubfiles.h:230
const char * filename() const
What is the name of the associated disk file?
Definition: cubfiles.h:78

Member Function Documentation

◆ analyze()

void chomp::homengin::cellistfile::analyze ( ) const
private

Analyzes the file to determine the number of cubes and the scope of their coordinates.

Referenced by boundingbox(), and count().

◆ bitmaptype()

bool chomp::homengin::cellistfile::bitmaptype ( ) const
inlinevirtual

Is this a bitmap type of set of cubes?

Reimplemented from chomp::homengin::cubfile.

Definition at line 449 of file cubfiles.h.

450 {
451 return false;
452 }

◆ boundingbox()

int chomp::homengin::cellistfile::boundingbox ( int *  mincoord,
int *  maxcoord 
) const
inlinevirtual

Determines the bounding box of the set of cubical cells.

Reimplemented from chomp::homengin::cubfile.

Definition at line 461 of file cubfiles.h.

462 {
463 if (!_min. size ())
464 analyze ();
465 return cubfile::boundingbox (mincoord, maxcoord);
466 }
void analyze() const
Analyzes the file to determine the number of cubes and the scope of their coordinates.
std::vector< int > _min
The minimal coordinates of the cubes' corners (bounding box).
Definition: cubfiles.h:218
virtual int boundingbox(int *mincoord, int *maxcoord) const
Determines the bounding box of the set of cubes.
Definition: cubfiles.h:143

References chomp::homengin::cubfile::_min, analyze(), and chomp::homengin::cubfile::boundingbox().

◆ compatible()

static bool chomp::homengin::cellistfile::compatible ( const char *  filename)
static

Verifies if the file format is compatible with this cubfile type.

◆ count()

int chomp::homengin::cellistfile::count ( ) const
inlinevirtual

How many cubes are there in the set?

Reimplemented from chomp::homengin::cubfile.

Definition at line 441 of file cubfiles.h.

442 {
443 if (_count < 0)
444 analyze ();
445 return _count;
446 }
int _count
The number of cubes in the set, -1 if unknown.
Definition: cubfiles.h:215

References chomp::homengin::cubfile::_count, and analyze().

◆ describe()

static std::ostream & chomp::homengin::cellistfile::describe ( std::ostream &  out)
static

Describes this particular type of a set of cubes.

◆ dim()

int chomp::homengin::cellistfile::dim ( ) const
virtual

What is the dimension of the set of cubes?

Reimplemented from chomp::homengin::cubfile.

◆ elementary()

bool chomp::homengin::cellistfile::elementary ( ) const
inlinevirtual

Is this a set of elementary cubes, as opposed to full cubes?

Reimplemented from chomp::homengin::cubfile.

Definition at line 455 of file cubfiles.h.

456 {
457 return true;
458 }

◆ name()

static const char * chomp::homengin::cellistfile::name ( )
inlinestatic

The name of this type of a cubical set.

Definition at line 469 of file cubfiles.h.

470 {
471 return "text list of cubical cells";
472 }

◆ readcubes() [1/3]

int chomp::homengin::cellistfile::readcubes ( chomp::homology::CubicalComplex s) const
virtual

Reads a set of cubical cells from the file.

Reimplemented from chomp::homengin::cubfile.

◆ readcubes() [2/3]

int chomp::homengin::cellistfile::readcubes ( chomp::homology::SetOfCubes s) const
inlinevirtual

Reads a cubical set from the file.

Reimplemented from chomp::homengin::cubfile.

Definition at line 484 of file cubfiles.h.

485 {
486 throw "Trying to read cubical cells as a set of full cubes.";
487 }

◆ readcubes() [3/3]

int chomp::homengin::cellistfile::readcubes ( int *&  sizes,
char *&  bytes,
int  padding = 0,
bool  power2 = false 
) const
inlinevirtual

Reads a bitmap from a file.

Reimplemented from chomp::homengin::cubfile.

Definition at line 490 of file cubfiles.h.

492 {
493 throw "Trying to read cubical cells as a bitmap.";
494 }

Member Data Documentation

◆ t

cubfile_traits<cellistfile> chomp::homengin::cellistfile::t
staticprivate

Add this type of a cubical set to the list.

Definition at line 502 of file cubfiles.h.


The documentation for this class was generated from the following file: