Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
geomtools::face_identifier Class Reference

Identifier of a face attached to a solid shape. More...

#include <bayeux/geomtools/face_identifier.h>

Inheritance diagram for geomtools::face_identifier:
datatools::i_tree_dumpable

Public Types

enum  mode_type { MODE_FACE_INVALID = 0x0, MODE_FACE_BITS = datatools::bit_mask::bit00, MODE_FACE_INDEX = datatools::bit_mask::bit01, MODE_FACE_ANY = MODE_FACE_BITS | MODE_FACE_INDEX }
 Face identification mode. More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Public Member Functions

 face_identifier ()
 Default constructor. More...
 
 face_identifier (uint32_t face_info_, mode_type mode_=MODE_FACE_BITS)
 Constructor. More...
 
bool is_valid () const
 Check the validity of the identifier. More...
 
bool is_ok () const
 Check if the identifier identifies some faces (unique or several/many) More...
 
bool is_unique () const
 Check if the identifier is valid and identifies an unique face. More...
 
bool is_many () const
 Check if the identifier is valid and identifies several faces. More...
 
bool is_none () const
 Check if the identifier is invalid or valid but identifies no face. More...
 
void invalidate ()
 
void reset ()
 Invalidate the identifier. More...
 
mode_type get_mode () const
 Return the face identification mode. More...
 
bool has_mode () const
 Check if the identifier has a valid mode. More...
 
bool is_face_bits_mode () const
 check if the identifier uses face bits More...
 
bool is_face_index_mode () const
 Check if the identifier uses face index. More...
 
uint32_t get_parts_depth () const
 Return the depth of the parts. More...
 
bool has_parts () const
 Return if the face identifier has parts. More...
 
bool has_part (unsigned int depth_) const
 Check if some parts numbers are defined. More...
 
bool is_invalid_part (unsigned int depth_) const
 Check if a part number is invalid. More...
 
bool is_any_part (unsigned int depth_) const
 Check if a part number matches the any value. More...
 
bool match_part (unsigned int depth_, uint32_t part_) const
 Check if a part number matches a given value. More...
 
void reset_part (unsigned int depth_)
 Reset the part number. More...
 
void set_any_part (unsigned int depth_)
 Set the part number to any value. More...
 
void set_any_parts ()
 Set all part numbers to any value. More...
 
void set_part (unsigned int depth_, uint32_t)
 Set the part number. More...
 
uint32_t get_part (unsigned int depth_) const
 Return the part number. More...
 
void prepend_part (uint32_t part_)
 Prepend a part. More...
 
void append_part (uint32_t part_)
 Append a part. More...
 
void append_parts (const std::vector< uint32_t > &parts_)
 Append an array of parts. More...
 
bool can_inherit_parts (unsigned int depth_=1) const
 Check if an inherited. More...
 
void inherit_parts (face_identifier &fid_, unsigned int depth_=1) const
 Build the inherited part. More...
 
const std::vector< uint32_t > & get_parts () const
 Return the array of parts. More...
 
bool is_face_bits_valid () const
 Set the face bits is valid. More...
 
void set_face_bits_any ()
 Set the bits to address any face. More...
 
bool is_face_bits_any () const
 Check if the bits address any face. More...
 
bool has_face_bits (uint32_t) const
 Check if some face bits are active. More...
 
bool has_face_bit (uint32_t) const
 Check if a given face bit is active. More...
 
void set_face_bits (uint32_t bits_)
 Set some face bits. More...
 
void set_face_bit (uint32_t bit_)
 Set a single face bit. More...
 
uint32_t get_face_bits () const
 Return the face bits. More...
 
void reset_face_bits ()
 Reset the face bits. More...
 
bool match_face_bits (uint32_t bits_) const
 Check if the face bits number matches some given value. More...
 
void reset_face_index ()
 Reset the index of a face. More...
 
void set_face_index (uint32_t)
 Set the index of a face. More...
 
uint32_t get_face_index () const
 Return the index of a face. More...
 
void set_face_index_any ()
 Set the bits to address any index. More...
 
bool is_face_index_any () const
 Check if the face identifier address any index. More...
 
bool is_face_index_valid () const
 Check if the face identifier address a valid index. More...
 
bool match_face_index (uint32_t index_) const
 Check if the face index matches some given value. More...
 
void to_string (std::string &word_) const
 Convert to a string. More...
 
std::string to_string () const
 Return a string. More...
 
bool parse (const std::string &from_)
 Parse. More...
 
bool match (const face_identifier &fid_) const
 Check if a given face identifier matches the signature. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Static Public Member Functions

static const face_identifierface_bits_any ()
 Return a singleton face identifier with any bit. More...
 
static const face_identifierface_index_any ()
 Return a singleton face identifier with any index. More...
 
static const face_identifierface_invalid ()
 Return a singleton invalid face identifier. More...
 
- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 

Static Public Attributes

static const uint32_t FACE_BITS_NONE = 0x0
 No valid or known face bit. More...
 
static const uint32_t FACE_BITS_ANY = 0xFFFFFFFF
 All faces are selected. More...
 
static const uint32_t FACE_INDEX_NONE = 0xFFFFFFFF
 Special value for undefined/invalid face index. More...
 
static const uint32_t FACE_INDEX_MIN = 0
 Special value for min face index. More...
 
static const uint32_t FACE_INDEX_MAX = 0xFFFFFFFD
 Special value for max face index. More...
 
static const uint32_t FACE_INDEX_ANY = 0xFFFFFFFE
 Special value for any face index (wildcard) More...
 
static const uint32_t PART_INDEX_NONE = 0xFFFFFFFF
 Special value for undefined/invalid part index. More...
 
static const uint32_t PART_INDEX_MIN = 0
 Special value for min part index. More...
 
static const uint32_t PART_INDEX_DEFAULT = PART_INDEX_MIN
 Special value for default part index. More...
 
static const uint32_t PART_INDEX_MAX = 0xFFFFFFFD
 Special value for max part index. More...
 
static const uint32_t PART_INDEX_ANY = 0xFFFFFFFE
 Special value for any part index (wildcard) More...
 

Protected Member Functions

void _set_defaults ()
 Set default attributes values. More...
 

Friends

std::ostream & operator<< (std::ostream &out_, const face_identifier &face_id_)
 Output streaming. More...
 

Detailed Description

Identifier of a face attached to a solid shape.

Member Enumeration Documentation

◆ mode_type

Face identification mode.

Enumerator
MODE_FACE_INVALID 

Invalid face identification mode.

MODE_FACE_BITS 

Face identification uses identification bits.

MODE_FACE_INDEX 

Face identification uses indexing.

MODE_FACE_ANY 

Face identification uses any mode.

Constructor & Destructor Documentation

◆ face_identifier() [1/2]

geomtools::face_identifier::face_identifier ( )

Default constructor.

◆ face_identifier() [2/2]

geomtools::face_identifier::face_identifier ( uint32_t  face_info_,
mode_type  mode_ = MODE_FACE_BITS 
)

Constructor.

Member Function Documentation

◆ _set_defaults()

void geomtools::face_identifier::_set_defaults ( )
protected

Set default attributes values.

◆ append_part()

void geomtools::face_identifier::append_part ( uint32_t  part_)

Append a part.

◆ append_parts()

void geomtools::face_identifier::append_parts ( const std::vector< uint32_t > &  parts_)

Append an array of parts.

◆ can_inherit_parts()

bool geomtools::face_identifier::can_inherit_parts ( unsigned int  depth_ = 1) const

Check if an inherited.

◆ face_bits_any()

static const face_identifier& geomtools::face_identifier::face_bits_any ( )
static

Return a singleton face identifier with any bit.

◆ face_index_any()

static const face_identifier& geomtools::face_identifier::face_index_any ( )
static

Return a singleton face identifier with any index.

◆ face_invalid()

static const face_identifier& geomtools::face_identifier::face_invalid ( )
static

Return a singleton invalid face identifier.

◆ get_face_bits()

uint32_t geomtools::face_identifier::get_face_bits ( ) const

Return the face bits.

◆ get_face_index()

uint32_t geomtools::face_identifier::get_face_index ( ) const

Return the index of a face.

◆ get_mode()

mode_type geomtools::face_identifier::get_mode ( ) const

Return the face identification mode.

◆ get_part()

uint32_t geomtools::face_identifier::get_part ( unsigned int  depth_) const

Return the part number.

◆ get_parts()

const std::vector<uint32_t>& geomtools::face_identifier::get_parts ( ) const

Return the array of parts.

◆ get_parts_depth()

uint32_t geomtools::face_identifier::get_parts_depth ( ) const

Return the depth of the parts.

◆ has_face_bit()

bool geomtools::face_identifier::has_face_bit ( uint32_t  ) const

Check if a given face bit is active.

◆ has_face_bits()

bool geomtools::face_identifier::has_face_bits ( uint32_t  ) const

Check if some face bits are active.

◆ has_mode()

bool geomtools::face_identifier::has_mode ( ) const

Check if the identifier has a valid mode.

◆ has_part()

bool geomtools::face_identifier::has_part ( unsigned int  depth_) const

Check if some parts numbers are defined.

◆ has_parts()

bool geomtools::face_identifier::has_parts ( ) const

Return if the face identifier has parts.

◆ inherit_parts()

void geomtools::face_identifier::inherit_parts ( face_identifier fid_,
unsigned int  depth_ = 1 
) const

Build the inherited part.

◆ invalidate()

void geomtools::face_identifier::invalidate ( )

Invalidate the identifier

See also
reset

◆ is_any_part()

bool geomtools::face_identifier::is_any_part ( unsigned int  depth_) const

Check if a part number matches the any value.

◆ is_face_bits_any()

bool geomtools::face_identifier::is_face_bits_any ( ) const

Check if the bits address any face.

◆ is_face_bits_mode()

bool geomtools::face_identifier::is_face_bits_mode ( ) const

check if the identifier uses face bits

◆ is_face_bits_valid()

bool geomtools::face_identifier::is_face_bits_valid ( ) const

Set the face bits is valid.

◆ is_face_index_any()

bool geomtools::face_identifier::is_face_index_any ( ) const

Check if the face identifier address any index.

◆ is_face_index_mode()

bool geomtools::face_identifier::is_face_index_mode ( ) const

Check if the identifier uses face index.

◆ is_face_index_valid()

bool geomtools::face_identifier::is_face_index_valid ( ) const

Check if the face identifier address a valid index.

◆ is_invalid_part()

bool geomtools::face_identifier::is_invalid_part ( unsigned int  depth_) const

Check if a part number is invalid.

◆ is_many()

bool geomtools::face_identifier::is_many ( ) const

Check if the identifier is valid and identifies several faces.

◆ is_none()

bool geomtools::face_identifier::is_none ( ) const

Check if the identifier is invalid or valid but identifies no face.

◆ is_ok()

bool geomtools::face_identifier::is_ok ( ) const

Check if the identifier identifies some faces (unique or several/many)

◆ is_unique()

bool geomtools::face_identifier::is_unique ( ) const

Check if the identifier is valid and identifies an unique face.

◆ is_valid()

bool geomtools::face_identifier::is_valid ( ) const

Check the validity of the identifier.

◆ match()

bool geomtools::face_identifier::match ( const face_identifier fid_) const

Check if a given face identifier matches the signature.

◆ match_face_bits()

bool geomtools::face_identifier::match_face_bits ( uint32_t  bits_) const

Check if the face bits number matches some given value.

◆ match_face_index()

bool geomtools::face_identifier::match_face_index ( uint32_t  index_) const

Check if the face index matches some given value.

◆ match_part()

bool geomtools::face_identifier::match_part ( unsigned int  depth_,
uint32_t  part_ 
) const

Check if a part number matches a given value.

◆ parse()

bool geomtools::face_identifier::parse ( const std::string &  from_)

Parse.

◆ prepend_part()

void geomtools::face_identifier::prepend_part ( uint32_t  part_)

Prepend a part.

◆ reset()

void geomtools::face_identifier::reset ( )

Invalidate the identifier.

◆ reset_face_bits()

void geomtools::face_identifier::reset_face_bits ( )

Reset the face bits.

◆ reset_face_index()

void geomtools::face_identifier::reset_face_index ( )

Reset the index of a face.

◆ reset_part()

void geomtools::face_identifier::reset_part ( unsigned int  depth_)

Reset the part number.

◆ set_any_part()

void geomtools::face_identifier::set_any_part ( unsigned int  depth_)

Set the part number to any value.

◆ set_any_parts()

void geomtools::face_identifier::set_any_parts ( )

Set all part numbers to any value.

◆ set_face_bit()

void geomtools::face_identifier::set_face_bit ( uint32_t  bit_)

Set a single face bit.

◆ set_face_bits()

void geomtools::face_identifier::set_face_bits ( uint32_t  bits_)

Set some face bits.

◆ set_face_bits_any()

void geomtools::face_identifier::set_face_bits_any ( )

Set the bits to address any face.

◆ set_face_index()

void geomtools::face_identifier::set_face_index ( uint32_t  )

Set the index of a face.

◆ set_face_index_any()

void geomtools::face_identifier::set_face_index_any ( )

Set the bits to address any index.

◆ set_part()

void geomtools::face_identifier::set_part ( unsigned int  depth_,
uint32_t   
)

Set the part number.

◆ to_string() [1/2]

void geomtools::face_identifier::to_string ( std::string &  word_) const

Convert to a string.

◆ to_string() [2/2]

std::string geomtools::face_identifier::to_string ( ) const

Return a string.

◆ tree_dump()

virtual void geomtools::face_identifier::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out_,
const face_identifier face_id_ 
)
friend

Output streaming.

Member Data Documentation

◆ FACE_BITS_ANY

const uint32_t geomtools::face_identifier::FACE_BITS_ANY = 0xFFFFFFFF
static

All faces are selected.

◆ FACE_BITS_NONE

const uint32_t geomtools::face_identifier::FACE_BITS_NONE = 0x0
static

No valid or known face bit.

◆ FACE_INDEX_ANY

const uint32_t geomtools::face_identifier::FACE_INDEX_ANY = 0xFFFFFFFE
static

Special value for any face index (wildcard)

◆ FACE_INDEX_MAX

const uint32_t geomtools::face_identifier::FACE_INDEX_MAX = 0xFFFFFFFD
static

Special value for max face index.

◆ FACE_INDEX_MIN

const uint32_t geomtools::face_identifier::FACE_INDEX_MIN = 0
static

Special value for min face index.

◆ FACE_INDEX_NONE

const uint32_t geomtools::face_identifier::FACE_INDEX_NONE = 0xFFFFFFFF
static

Special value for undefined/invalid face index.

◆ PART_INDEX_ANY

const uint32_t geomtools::face_identifier::PART_INDEX_ANY = 0xFFFFFFFE
static

Special value for any part index (wildcard)

◆ PART_INDEX_DEFAULT

const uint32_t geomtools::face_identifier::PART_INDEX_DEFAULT = PART_INDEX_MIN
static

Special value for default part index.

◆ PART_INDEX_MAX

const uint32_t geomtools::face_identifier::PART_INDEX_MAX = 0xFFFFFFFD
static

Special value for max part index.

◆ PART_INDEX_MIN

const uint32_t geomtools::face_identifier::PART_INDEX_MIN = 0
static

Special value for min part index.

◆ PART_INDEX_NONE

const uint32_t geomtools::face_identifier::PART_INDEX_NONE = 0xFFFFFFFF
static

Special value for undefined/invalid part index.


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