Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
Identifier of a face attached to a solid shape. More...
#include <bayeux/geomtools/face_identifier.h>
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_identifier & | face_bits_any () |
Return a singleton face identifier with any bit. More... | |
static const face_identifier & | face_index_any () |
Return a singleton face identifier with any index. More... | |
static const face_identifier & | face_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... | |
Identifier of a face attached to a solid shape.
geomtools::face_identifier::face_identifier | ( | ) |
Default constructor.
geomtools::face_identifier::face_identifier | ( | uint32_t | face_info_, |
mode_type | mode_ = MODE_FACE_BITS |
||
) |
Constructor.
|
protected |
Set default attributes values.
void geomtools::face_identifier::append_part | ( | uint32_t | part_ | ) |
Append a part.
void geomtools::face_identifier::append_parts | ( | const std::vector< uint32_t > & | parts_ | ) |
Append an array of parts.
bool geomtools::face_identifier::can_inherit_parts | ( | unsigned int | depth_ = 1 | ) | const |
Check if an inherited.
|
static |
Return a singleton face identifier with any bit.
|
static |
Return a singleton face identifier with any index.
|
static |
Return a singleton invalid face identifier.
uint32_t geomtools::face_identifier::get_face_bits | ( | ) | const |
Return the face bits.
uint32_t geomtools::face_identifier::get_face_index | ( | ) | const |
Return the index of a face.
mode_type geomtools::face_identifier::get_mode | ( | ) | const |
Return the face identification mode.
uint32_t geomtools::face_identifier::get_part | ( | unsigned int | depth_ | ) | const |
Return the part number.
const std::vector<uint32_t>& geomtools::face_identifier::get_parts | ( | ) | const |
Return the array of parts.
uint32_t geomtools::face_identifier::get_parts_depth | ( | ) | const |
Return the depth of the parts.
bool geomtools::face_identifier::has_face_bit | ( | uint32_t | ) | const |
Check if a given face bit is active.
bool geomtools::face_identifier::has_face_bits | ( | uint32_t | ) | const |
Check if some face bits are active.
bool geomtools::face_identifier::has_mode | ( | ) | const |
Check if the identifier has a valid mode.
bool geomtools::face_identifier::has_part | ( | unsigned int | depth_ | ) | const |
Check if some parts numbers are defined.
bool geomtools::face_identifier::has_parts | ( | ) | const |
Return if the face identifier has parts.
void geomtools::face_identifier::inherit_parts | ( | face_identifier & | fid_, |
unsigned int | depth_ = 1 |
||
) | const |
Build the inherited part.
void geomtools::face_identifier::invalidate | ( | ) |
Invalidate the identifier
bool geomtools::face_identifier::is_any_part | ( | unsigned int | depth_ | ) | const |
Check if a part number matches the any value.
bool geomtools::face_identifier::is_face_bits_any | ( | ) | const |
Check if the bits address any face.
bool geomtools::face_identifier::is_face_bits_mode | ( | ) | const |
check if the identifier uses face bits
bool geomtools::face_identifier::is_face_bits_valid | ( | ) | const |
Set the face bits is valid.
bool geomtools::face_identifier::is_face_index_any | ( | ) | const |
Check if the face identifier address any index.
bool geomtools::face_identifier::is_face_index_mode | ( | ) | const |
Check if the identifier uses face index.
bool geomtools::face_identifier::is_face_index_valid | ( | ) | const |
Check if the face identifier address a valid index.
bool geomtools::face_identifier::is_invalid_part | ( | unsigned int | depth_ | ) | const |
Check if a part number is invalid.
bool geomtools::face_identifier::is_many | ( | ) | const |
Check if the identifier is valid and identifies several faces.
bool geomtools::face_identifier::is_none | ( | ) | const |
Check if the identifier is invalid or valid but identifies no face.
bool geomtools::face_identifier::is_ok | ( | ) | const |
Check if the identifier identifies some faces (unique or several/many)
bool geomtools::face_identifier::is_unique | ( | ) | const |
Check if the identifier is valid and identifies an unique face.
bool geomtools::face_identifier::is_valid | ( | ) | const |
Check the validity of the identifier.
bool geomtools::face_identifier::match | ( | const face_identifier & | fid_ | ) | const |
Check if a given face identifier matches the signature.
bool geomtools::face_identifier::match_face_bits | ( | uint32_t | bits_ | ) | const |
Check if the face bits number matches some given value.
bool geomtools::face_identifier::match_face_index | ( | uint32_t | index_ | ) | const |
Check if the face index matches some given value.
bool geomtools::face_identifier::match_part | ( | unsigned int | depth_, |
uint32_t | part_ | ||
) | const |
Check if a part number matches a given value.
bool geomtools::face_identifier::parse | ( | const std::string & | from_ | ) |
Parse.
void geomtools::face_identifier::prepend_part | ( | uint32_t | part_ | ) |
Prepend a part.
void geomtools::face_identifier::reset | ( | ) |
Invalidate the identifier.
void geomtools::face_identifier::reset_face_bits | ( | ) |
Reset the face bits.
void geomtools::face_identifier::reset_face_index | ( | ) |
Reset the index of a face.
void geomtools::face_identifier::reset_part | ( | unsigned int | depth_ | ) |
Reset the part number.
void geomtools::face_identifier::set_any_part | ( | unsigned int | depth_ | ) |
Set the part number to any value.
void geomtools::face_identifier::set_any_parts | ( | ) |
Set all part numbers to any value.
void geomtools::face_identifier::set_face_bit | ( | uint32_t | bit_ | ) |
Set a single face bit.
void geomtools::face_identifier::set_face_bits | ( | uint32_t | bits_ | ) |
Set some face bits.
void geomtools::face_identifier::set_face_bits_any | ( | ) |
Set the bits to address any face.
void geomtools::face_identifier::set_face_index | ( | uint32_t | ) |
Set the index of a face.
void geomtools::face_identifier::set_face_index_any | ( | ) |
Set the bits to address any index.
void geomtools::face_identifier::set_part | ( | unsigned int | depth_, |
uint32_t | |||
) |
Set the part number.
void geomtools::face_identifier::to_string | ( | std::string & | word_ | ) | const |
Convert to a string.
std::string geomtools::face_identifier::to_string | ( | ) | const |
Return a string.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
|
friend |
Output streaming.
|
static |
All faces are selected.
|
static |
No valid or known face bit.
|
static |
Special value for any face index (wildcard)
|
static |
Special value for max face index.
|
static |
Special value for min face index.
|
static |
Special value for undefined/invalid face index.
|
static |
Special value for any part index (wildcard)
|
static |
Special value for default part index.
|
static |
Special value for max part index.
|
static |
Special value for min part index.
|
static |
Special value for undefined/invalid part index.