|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4SurfBits provides a simple container of bits, to be used for optimization of tessellated surfaces. The size of the container is automatically extended when a bit number is either set or tested. More...
#include <G4SurfBits.hh>
Public Member Functions | |
| G4SurfBits (unsigned int nbits=0) | |
| ~G4SurfBits () | |
| G4SurfBits (const G4SurfBits &) | |
| G4SurfBits & | operator= (const G4SurfBits &) |
| void | ResetAllBits (G4bool value=false) |
| void | ResetBitNumber (unsigned int bitnumber) |
| void | SetBitNumber (unsigned int bitnumber, G4bool value=true) |
| G4bool | TestBitNumber (unsigned int bitnumber) const |
| G4bool | operator[] (unsigned int bitnumber) const |
| void | set (unsigned int nbits, const char *array) |
| void | set (unsigned int nbits, const G4int *array) |
| void | Get (char *array) const |
| void | Get (G4int *array) const |
| void | Clear () |
| void | Compact () |
| unsigned int | GetNbits () const |
| unsigned int | GetNbytes () const |
| void | Print () const |
| void | Output (std::ostream &) const |
Public Attributes | |
| unsigned char * | fAllBits = nullptr |
G4SurfBits provides a simple container of bits, to be used for optimization of tessellated surfaces. The size of the container is automatically extended when a bit number is either set or tested.
Definition at line 56 of file G4SurfBits.hh.
| G4SurfBits::G4SurfBits | ( | unsigned int | nbits = 0 | ) |
Constructor given the number of bits.
| [in] | nbits | The number of bits. |
Definition at line 35 of file G4SurfBits.cc.
Referenced by G4SurfBits(), and operator=().
| G4SurfBits::~G4SurfBits | ( | ) |
Destructor. Clears all allocated bits.
Definition at line 80 of file G4SurfBits.cc.
| G4SurfBits::G4SurfBits | ( | const G4SurfBits & | original | ) |
Copy constructor and assignment operator.
Definition at line 47 of file G4SurfBits.cc.
| void G4SurfBits::Clear | ( | ) |
Utilities to clear or reduce the space used.
Definition at line 88 of file G4SurfBits.cc.
| void G4SurfBits::Compact | ( | ) |
Definition at line 99 of file G4SurfBits.cc.
| void G4SurfBits::Get | ( | char * | array | ) | const |
Optimized getters. Each of these will replace the contents of the parameter array with the bits in the receiver. The parameter array must be large enough to hold all of the bits in the receiver. Note on semantics: any bits in the parameter array that go beyond the number of the bits in the receiver will have an unspecified value. For example, if calling Get(Int*) with an array of one integer and the G4SurfBits object has less than 32 bits, then the remaining bits in the integer will have an unspecified value.
Definition at line 187 of file G4SurfBits.cc.
Referenced by Get().
| void G4SurfBits::Get | ( | G4int * | array | ) | const |
Definition at line 205 of file G4SurfBits.cc.
|
inline |
|
inline |
Definition at line 122 of file G4SurfBits.hh.
| G4SurfBits & G4SurfBits::operator= | ( | const G4SurfBits & | rhs | ) |
Definition at line 57 of file G4SurfBits.cc.
|
inline |
Accessor operator.
| void G4SurfBits::Output | ( | std::ostream & | os | ) | const |
Definition at line 122 of file G4SurfBits.cc.
| void G4SurfBits::Print | ( | ) | const |
Logging functions.
Definition at line 137 of file G4SurfBits.cc.
| void G4SurfBits::ResetAllBits | ( | G4bool | value = false | ) |
Methods for bit manipulation.
Definition at line 154 of file G4SurfBits.cc.
|
inline |
Referenced by G4MultiUnion::DistanceToOutVoxels().
| void G4SurfBits::set | ( | unsigned int | nbits, |
| const char * | array ) |
Optimized setters. Each of these will replace the contents of the receiver with the bitvector in the parameter array. The number of bits is changed to 'nbits'. If nbits is smaller than fNBits, the receiver will NOT be compacted.
Definition at line 175 of file G4SurfBits.cc.
Referenced by G4Voxelizer::DisplayListNodes(), and set().
| void G4SurfBits::set | ( | unsigned int | nbits, |
| const G4int * | array ) |
Definition at line 197 of file G4SurfBits.cc.
|
inline |
Referenced by G4MultiUnion::DistanceToOutVoxels().
|
inline |
| unsigned char* G4SurfBits::fAllBits = nullptr |
Definition at line 132 of file G4SurfBits.hh.
Referenced by Clear(), Compact(), G4SurfBits(), G4SurfBits(), Get(), G4Voxelizer::GetCandidatesVoxelArray(), G4Voxelizer::GetCandidatesVoxelArray(), operator=(), Output(), Print(), ResetAllBits(), set(), and ~G4SurfBits().