293 bool reverseCallingOrder;
295 void setOrder(
const StrategyType& strategy_lo,
const StrategyType& strategy_hi) {
296 if ((strategy_lo.type() == Strategy::PERIODIC || strategy_hi.type() == Strategy::PERIODIC) &&
297 strategy_lo.type() != Strategy::MIRROR && strategy_hi.type() != Strategy::MIRROR &&
298 strategy_lo.type() != strategy_hi.type()
299 )
writelog(
LOG_WARNING,
"Periodic and non-periodic edges used on opposite sides of one direction.");
301 if (strategy_hi.canMoveOutsideBoundingBox()) {
302 if (strategy_lo.canMoveOutsideBoundingBox())
303 throw Exception(
"edges on both sides can move point outside bounding box.");
304 reverseCallingOrder =
true;
306 reverseCallingOrder =
false;
313 void setStrategies(
const StrategyType& strategy_lo,
const StrategyType& strategy_hi) {
314 setOrder(strategy_lo, strategy_hi);
315 this->strategy_lo = strategy_lo;
316 this->strategy_hi = strategy_hi;
319 void setBoth(
const StrategyType& s) { setStrategies(s, s); }
321 void setLo(
const StrategyType& strategy_lo) {
322 setOrder(strategy_lo, getHi());
323 this->strategy_lo = strategy_lo;
327 return strategy_lo.getStrategy();
330 void setHi(
const StrategyType& strategy_hi) {
331 setOrder(getLo(), strategy_hi);
332 this->strategy_hi = strategy_hi;
336 return strategy_hi.getStrategy();
344 void set(
bool setNewHi,
const StrategyType& strategy) {
345 if (setNewHi) setHi(strategy);
else setLo(strategy);
353 const StrategyType&
get(
bool _getHi)
const {
354 return _getHi ? getHi() : getLo();
359 if (reverseCallingOrder) {
360 strategy_hi.applyIfHi(bbox, p, result_material, &strategy_lo.getStrategy());
361 if (result_material)
return;
362 strategy_lo.applyIfLo(bbox, p, result_material, &strategy_hi.getStrategy());
364 strategy_lo.applyIfLo(bbox, p, result_material, &strategy_hi.getStrategy());
365 if (result_material)
return;
366 strategy_hi.applyIfHi(bbox, p, result_material, &strategy_lo.getStrategy());
370 bool isSymmetric()
const {
return strategy_lo.type() == Strategy::MIRROR || strategy_hi.type() == Strategy::MIRROR; }
372 bool isPeriodic()
const {
return strategy_lo.type() == Strategy::PERIODIC && strategy_hi.type() == Strategy::PERIODIC; }