CMS 3D CMS Logo

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

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

#include <DDCompareTools.h>

Inheritance diagram for DDCompareSolid:

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 63 of file DDCompareTools.h.

Constructor & Destructor Documentation

DDCompareSolid::DDCompareSolid ( )

Definition at line 167 of file DDCompareTools.cc.

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

Definition at line 169 of file DDCompareTools.cc.

169 : ddco_(ddco) { }
DDCompOptions ddco_

Member Function Documentation

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

Definition at line 171 of file DDCompareTools.cc.

References gather_cfg::cout, dd_not_init, ddbox, ddco_, ddcons, ddcuttubs, ddellipticaltube, ddextrudedpolygon, ddintersection, ddpolycone_rrz, ddpolycone_rz, ddpolyhedra_rrz, ddpolyhedra_rz, ddpseudotrap, ddshapeless, ddsphere, ddsubtraction, ddtorus, ddtrap, ddtrunctubs, ddtubs, ddunion, DDName::fullname(), DDBase< N, C >::name(), DDSolid::parameters(), and DDSolid::shape().

171  {
172  bool ret(true);
173  switch ( lhs.shape() ) {
175  case DDSolidShape::ddbox:
178  case DDSolidShape::ddtrap:
191  {
192  if ( lhs.name().fullname() != rhs.name().fullname() ) {
193  ret = false;
194  std::cout << "Solid names do not match for solid " << lhs.name().fullname() << " and " << rhs.name().fullname() << std::endl;
195  } else if ( lhs.shape() != rhs.shape() ) {
196  ret = false;
197  std::cout << "Shape types do not match for solids " << lhs.name().fullname()
198  << " and " << rhs.name().fullname()
199  << " even though their names match " << std::endl;
200  } else if ( ! DDCompareDBLVEC()(lhs.parameters(), rhs.parameters()) ) {
201  ret = false;
202  std::cout << "Parameters do not match for solids " << lhs.name().fullname()
203  << " and " << rhs.name().fullname()
204  << " even though their names and shape type match." << std::endl;
205  std::cout << "size: " << lhs.parameters().size() << " " << rhs.parameters().size() << std::endl;
206  }
207  break;
208  }
212  {
213  if ( ! DDCompareBoolSol(ddco_)(lhs, rhs) ) {
214  ret = false;
215  }
216  break;
217  }
218  default:
219  break;
220  }
221  return ret;
222 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:144
const N & name() const
Definition: DDBase.h:74
Needs to know because of Rotation Matrix of Boolean Relationship.
const std::string fullname() const
Definition: DDName.h:43
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:138
DDCompOptions ddco_

Member Data Documentation

DDCompOptions DDCompareSolid::ddco_

Definition at line 67 of file DDCompareTools.h.

Referenced by operator()().