CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
DDCompareBoolSol Struct Reference

Needs to know because of Rotation Matrix of Boolean Relationship. More...

#include <DDCompareTools.h>

Inheritance diagram for DDCompareBoolSol:

Public Member Functions

 DDCompareBoolSol ()
 
 DDCompareBoolSol (const DDCompOptions &ddco)
 
bool operator() (const DDBooleanSolid &lhs, const DDBooleanSolid &rhs) const
 

Public Attributes

DDCompOptions ddco_
 

Detailed Description

Needs to know because of Rotation Matrix of Boolean Relationship.

Definition at line 78 of file DDCompareTools.h.

Constructor & Destructor Documentation

DDCompareBoolSol::DDCompareBoolSol ( )

Definition at line 326 of file DDCompareTools.cc.

326 : ddco_() { }
DDCompOptions ddco_
DDCompareBoolSol::DDCompareBoolSol ( const DDCompOptions ddco)

Definition at line 328 of file DDCompareTools.cc.

328 : ddco_(ddco) { }
DDCompOptions ddco_

Member Function Documentation

bool DDCompareBoolSol::operator() ( const DDBooleanSolid lhs,
const DDBooleanSolid rhs 
) const

Definition at line 329 of file DDCompareTools.cc.

References gather_cfg::cout, ddco_, DDCompOptions::distTol_, DDName::fullname(), DDBase< N, C >::name(), DDSolid::parameters(), DDBooleanSolid::rotation(), DDSolid::shape(), DDBooleanSolid::solidA(), DDBooleanSolid::solidB(), and DDBooleanSolid::translation().

329  {
330  bool ret(true);
331  if ( lhs.name().fullname() != rhs.name().fullname() ) {
332  ret = false;
333  std::cout << "BooleanSolid names do not match ";
334  } else if ( lhs.shape() != rhs.shape() ) {
335  ret = false;
336  std::cout << "BooleanSolid shape types do not match ";
337  } else if ( ! DDCompareDBLVEC(ddco_.distTol_)(lhs.parameters(), rhs.parameters()) ) {
338  ret = false;
339  std::cout << "BooleanSolid parameters do not match ";
340  } else if ( ! DDCompareSolid(ddco_)(lhs.solidA(), rhs.solidA()) ) {
341  ret = false;
342  std::cout << "BooleanSolid SolidA solids do not match ";
343  } else if ( ! DDCompareSolid(ddco_)(lhs.solidB(), rhs.solidB()) ) {
344  ret= false;
345  std::cout << "BooleanSolid SolidB solids do not match ";
346  } else if ( ! DDCompareDDTrans(ddco_.distTol_)(lhs.translation(), rhs.translation()) ) {
347  ret = false;
348  std::cout << "BooleanSolid Translations do not match ";
349  } else if ( ! DDCompareDDRot(ddco_)(lhs.rotation(), rhs.rotation()) ) {
350  ret = false;
351  std::cout << "BooleanSolid Rotations do not match ";
352  }
353  if ( ! ret ) {
354  std::cout << "for boolean solids "
355  << lhs.name().fullname() << " and "
356  << rhs.name().fullname() << std::endl;
357  }
358  return ret;
359 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:150
const N & name() const
Definition: DDBase.h:78
Needs to know about rotmat because of BooleanSolid.
DDTranslation translation(void) const
Definition: DDSolid.cc:656
DDSolid solidB(void) const
Definition: DDSolid.cc:668
DDRotation rotation(void) const
Definition: DDSolid.cc:650
const std::string fullname() const
Definition: DDName.h:52
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:144
DDCompOptions ddco_
DDSolid solidA(void) const
Definition: DDSolid.cc:662
Allows to compare name or not. If not, compares only values of the rotation matrix.

Member Data Documentation

DDCompOptions DDCompareBoolSol::ddco_

Definition at line 82 of file DDCompareTools.h.

Referenced by operator()().