CMS 3D CMS Logo

Public Member Functions | Public Attributes

DDCompareSolid Struct Reference

Needs to know about rotmat because of BooleanSolid. More...

#include <DDCompareTools.h>

Inheritance diagram for DDCompareSolid:
binary_function

List of all members.

Public Member Functions

 DDCompareSolid ()
 DDCompareSolid (const DDCompOptions &ddco)
bool operator() (const DDSolid &lhs, const DDSolid &rhs) const

Public Attributes

DDCompOptions ddco_

Detailed Description

Needs to know about rotmat because of BooleanSolid.

Definition at line 53 of file DDCompareTools.h.


Constructor & Destructor Documentation

DDCompareSolid::DDCompareSolid ( )

Definition at line 208 of file DDCompareTools.cc.

Referenced by operator()().

: ddco_() { }
DDCompareSolid::DDCompareSolid ( const DDCompOptions ddco)

Definition at line 210 of file DDCompareTools.cc.

: ddco_(ddco) { }

Member Function Documentation

bool DDCompareSolid::operator() ( const DDSolid lhs,
const DDSolid rhs 
) const

Definition at line 212 of file DDCompareTools.cc.

References gather_cfg::cout, dd_not_init, ddbox, ddco_, DDCompareSolid(), ddcons, ddellipsoid, ddellipticaltube, ddintersection, ddorb, ddparallelepiped, ddpolycone_rrz, ddpolycone_rz, ddpolyhedra_rrz, ddpolyhedra_rz, ddpseudotrap, ddreflected, ddshapeless, ddsphere, ddsubtraction, ddtorus, ddtrap, ddtrunctubs, ddtubs, ddunion, DDName::fullname(), DDBase< N, C >::name(), DDSolid::parameters(), run_regression::ret, DDSolid::shape(), and DDReflectionSolid::unreflected().

                                                                            {
  bool ret(true);
    switch ( lhs.shape() ) {
    case dd_not_init:
    case ddbox:
    case ddtubs:
    case ddtrap: 
    case ddcons:
    case ddpolycone_rz:
    case ddpolyhedra_rz:
    case ddpolycone_rrz:
    case ddpolyhedra_rrz:
    case ddtorus:
    case ddpseudotrap:
    case ddtrunctubs:
    case ddsphere:
    case ddorb:
    case ddellipticaltube:
    case ddellipsoid:
    case ddparallelepiped:
    case ddshapeless: 
      {
        if ( lhs.name().fullname() != rhs.name().fullname() ) {
          ret = false;
          std::cout << "Solid names do not match for solid " << lhs.name().fullname() << " and " << rhs.name().fullname() << std::endl;
        } else if ( lhs.shape() != rhs.shape() ) {
          ret = false;
          std::cout << "Shape types do not match for solids " << lhs.name().fullname() 
                    << " and " << rhs.name().fullname() 
                    << " even though their names match " << std::endl;
        } else if ( ! DDCompareDBLVEC()(lhs.parameters(), rhs.parameters()) ) {
          ret = false;
          std::cout << "Parameters do not match for solids " << lhs.name().fullname() 
                    << " and " << rhs.name().fullname() 
                    << " even though their names and shape type match." << std::endl;
          std::cout << "size: " << lhs.parameters().size() << " " << rhs.parameters().size() << std::endl;
        } 
        break;
      }
    case ddunion:
    case ddsubtraction:
    case ddintersection: 
      {
        if ( ! DDCompareBoolSol(ddco_)(lhs, rhs) ) {
          ret = false;
        }
        break;
      }
    case ddreflected:
      {
        DDReflectionSolid rs1(lhs);
        DDReflectionSolid rs2(rhs);
        if ( ! DDCompareSolid(ddco_)( rs1.unreflected(), rs2.unreflected()) ) {
          ret = false;
          std::cout << "Unreflected volumes of DDReflections do not match. Reflections are " 
                    << lhs.name().fullname() << " and " << rhs.name().fullname() << std::endl;
        }
        break;
      }
    default:
      break;
    }
    return ret;
}

Member Data Documentation

Definition at line 57 of file DDCompareTools.h.

Referenced by operator()().