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

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

Definition at line 260 of file DDCompareTools.cc.

260 : ddco_(ddco) { }
DDCompOptions ddco_

Member Function Documentation

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

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

261  {
262  bool ret(true);
263  if ( lhs.name().fullname() != rhs.name().fullname() ) {
264  ret = false;
265  std::cout << "BooleanSolid names do not match ";
266  } else if ( lhs.shape() != rhs.shape() ) {
267  ret = false;
268  std::cout << "BooleanSolid shape types do not match ";
269  } else if ( ! DDCompareDBLVEC(ddco_.distTol_)(lhs.parameters(), rhs.parameters()) ) {
270  ret = false;
271  std::cout << "BooleanSolid parameters do not match ";
272  } else if ( ! DDCompareSolid(ddco_)(lhs.solidA(), rhs.solidA()) ) {
273  ret = false;
274  std::cout << "BooleanSolid SolidA solids do not match ";
275  } else if ( ! DDCompareSolid(ddco_)(lhs.solidB(), rhs.solidB()) ) {
276  ret= false;
277  std::cout << "BooleanSolid SolidB solids do not match ";
278  } else if ( ! DDCompareDDTrans(ddco_.distTol_)(lhs.translation(), rhs.translation()) ) {
279  ret = false;
280  std::cout << "BooleanSolid Translations do not match ";
281  } else if ( ! DDCompareDDRot(ddco_)(lhs.rotation(), rhs.rotation()) ) {
282  ret = false;
283  std::cout << "BooleanSolid Rotations do not match ";
284  }
285  if ( ! ret ) {
286  std::cout << "for boolean solids "
287  << lhs.name().fullname() << " and "
288  << rhs.name().fullname() << std::endl;
289  }
290  return ret;
291 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:144
const N & name() const
Definition: DDBase.h:78
Needs to know about rotmat because of BooleanSolid.
DDTranslation translation(void) const
Definition: DDSolid.cc:605
DDSolid solidB(void) const
Definition: DDSolid.cc:617
DDRotation rotation(void) const
Definition: DDSolid.cc:599
const std::string fullname() const
Definition: DDName.h:52
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:138
DDCompOptions ddco_
DDSolid solidA(void) const
Definition: DDSolid.cc:611
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()().