Beispiel #1
0
void StraightRodPair::buildMezzanine(const RodTemplate& rodTemplate) {
  // compute Z list (only once since the second mezzanine has just inverted signs for z) 
  vector<double> zList = computeZList(rodTemplate.rbegin(), rodTemplate.rend(), startZ(), BuildDir::LEFT, zPlusParity(), false);
  vector<double> zListNeg;
  std::transform(zList.begin(), zList.end(), std::back_inserter(zListNeg), std::negate<double>());

  buildModules(zPlusModules_, rodTemplate, zList, BuildDir::LEFT, zPlusParity(), 1); // CUIDADO mezzanine layer rings in reverse order????
  maxZ(startZ());

  buildModules(zMinusModules_, rodTemplate, zListNeg, BuildDir::RIGHT, zPlusParity(), -1);
}
Beispiel #2
0
/**
 * Returns the intersection of this 3D area with another 3D area. If there is
 *   no intersection, an invalid 3D area will be returned.
 *
 * @param otherArea the area to intersect this 3D area with
 * @return the 3D area that is the intersection
 */
Area3D Area3D::intersect(const Area3D &otherArea) const {
    Area3D result;

    // Check validity because of comparison operators.
    if (isValid() && otherArea.isValid()) {
        Displacement startX(std::max(getStartX(), otherArea.getStartX()));
        Displacement startY(std::max(getStartY(), otherArea.getStartY()));
        Displacement startZ(std::max(getStartZ(), otherArea.getStartZ()));
        Displacement endX(std::min(getEndX(), otherArea.getEndX()));
        Displacement endY(std::min(getEndY(), otherArea.getEndY()));
        Displacement endZ(std::min(getEndZ(), otherArea.getEndZ()));


        if (startX <= endX && startY <= endY && startZ <= endZ)
            result = Area3D(startX, startY, startZ, endX, endY, endZ);
    }

    return result;
}