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 325 of file DDCompareTools.cc.

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

Definition at line 327 of file DDCompareTools.cc.

327 : ddco_(ddco) { }
DDCompOptions ddco_

Member Function Documentation

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

Definition at line 328 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().

328  {
329  bool ret(true);
330  if ( lhs.name().fullname() != rhs.name().fullname() ) {
331  ret = false;
332  std::cout << "BooleanSolid names do not match ";
333  } else if ( lhs.shape() != rhs.shape() ) {
334  ret = false;
335  std::cout << "BooleanSolid shape types do not match ";
336  } else if ( ! DDCompareDBLVEC(ddco_.distTol_)(lhs.parameters(), rhs.parameters()) ) {
337  ret = false;
338  std::cout << "BooleanSolid parameters do not match ";
339  } else if ( ! DDCompareSolid(ddco_)(lhs.solidA(), rhs.solidA()) ) {
340  ret = false;
341  std::cout << "BooleanSolid SolidA solids do not match ";
342  } else if ( ! DDCompareSolid(ddco_)(lhs.solidB(), rhs.solidB()) ) {
343  ret= false;
344  std::cout << "BooleanSolid SolidB solids do not match ";
345  } else if ( ! DDCompareDDTrans(ddco_.distTol_)(lhs.translation(), rhs.translation()) ) {
346  ret = false;
347  std::cout << "BooleanSolid Translations do not match ";
348  } else if ( ! DDCompareDDRot(ddco_)(lhs.rotation(), rhs.rotation()) ) {
349  ret = false;
350  std::cout << "BooleanSolid Rotations do not match ";
351  }
352  if ( ! ret ) {
353  std::cout << "for boolean solids "
354  << lhs.name().fullname() << " and "
355  << rhs.name().fullname() << std::endl;
356  }
357  return ret;
358 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:146
const N & name() const
Definition: DDBase.h:78
Needs to know about rotmat because of BooleanSolid.
DDTranslation translation(void) const
Definition: DDSolid.cc:542
DDSolid solidB(void) const
Definition: DDSolid.cc:554
DDRotation rotation(void) const
Definition: DDSolid.cc:536
const std::string fullname() const
Definition: DDName.h:53
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:140
DDCompOptions ddco_
DDSolid solidA(void) const
Definition: DDSolid.cc:548
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()().