3652 |
UpdateVelocityTable(); |
UpdateVelocityTable(); |
3653 |
} |
} |
3654 |
|
|
3655 |
|
/** @brief Change type of an existing dimension. |
3656 |
|
* |
3657 |
|
* Alters the dimension type of a dimension already existing on this |
3658 |
|
* region. If there is currently no dimension on this Region with type |
3659 |
|
* @a oldType, then this call with throw an Exception. Likewise there are |
3660 |
|
* cases where the requested dimension type cannot be performed. For example |
3661 |
|
* if the new dimension type shall be gig::dimension_samplechannel, and the |
3662 |
|
* current dimension has more than 2 zones. In such cases an Exception is |
3663 |
|
* thrown as well. |
3664 |
|
* |
3665 |
|
* @param oldType - identifies the existing dimension to be changed |
3666 |
|
* @param newType - to which dimension type it should be changed to |
3667 |
|
* @throws gig::Exception if requested change cannot be performed |
3668 |
|
*/ |
3669 |
|
void Region::SetDimensionType(dimension_t oldType, dimension_t newType) { |
3670 |
|
if (oldType == newType) return; |
3671 |
|
dimension_def_t* def = GetDimensionDefinition(oldType); |
3672 |
|
if (!def) |
3673 |
|
throw gig::Exception("No dimension with provided old dimension type exists on this region"); |
3674 |
|
if (newType == dimension_samplechannel && def->zones != 2) |
3675 |
|
throw gig::Exception("Cannot change to dimension type 'sample channel', because existing dimension does not have 2 zones"); |
3676 |
|
def->split_type = __resolveSplitType(newType); |
3677 |
|
} |
3678 |
|
|
3679 |
DimensionRegion* Region::GetDimensionRegionByBit(const std::map<dimension_t,int>& DimCase) { |
DimensionRegion* Region::GetDimensionRegionByBit(const std::map<dimension_t,int>& DimCase) { |
3680 |
uint8_t bits[8] = {}; |
uint8_t bits[8] = {}; |
3681 |
for (std::map<dimension_t,int>::const_iterator it = DimCase.begin(); |
for (std::map<dimension_t,int>::const_iterator it = DimCase.begin(); |