CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 53 of file DDCompareTools.h.

Constructor & Destructor Documentation

DDCompareSolid::DDCompareSolid ( )

Definition at line 208 of file DDCompareTools.cc.

Referenced by operator()().

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

Definition at line 210 of file DDCompareTools.cc.

210 : ddco_(ddco) { }
DDCompOptions 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(), runTheMatrix::ret, DDSolid::shape(), and DDReflectionSolid::unreflected().

212  {
213  bool ret(true);
214  switch ( lhs.shape() ) {
215  case dd_not_init:
216  case ddbox:
217  case ddtubs:
218  case ddtrap:
219  case ddcons:
220  case ddpolycone_rz:
221  case ddpolyhedra_rz:
222  case ddpolycone_rrz:
223  case ddpolyhedra_rrz:
224  case ddtorus:
225  case ddpseudotrap:
226  case ddtrunctubs:
227  case ddsphere:
228  case ddorb:
229  case ddellipticaltube:
230  case ddellipsoid:
231  case ddparallelepiped:
232  case ddshapeless:
233  {
234  if ( lhs.name().fullname() != rhs.name().fullname() ) {
235  ret = false;
236  std::cout << "Solid names do not match for solid " << lhs.name().fullname() << " and " << rhs.name().fullname() << std::endl;
237  } else if ( lhs.shape() != rhs.shape() ) {
238  ret = false;
239  std::cout << "Shape types do not match for solids " << lhs.name().fullname()
240  << " and " << rhs.name().fullname()
241  << " even though their names match " << std::endl;
242  } else if ( ! DDCompareDBLVEC()(lhs.parameters(), rhs.parameters()) ) {
243  ret = false;
244  std::cout << "Parameters do not match for solids " << lhs.name().fullname()
245  << " and " << rhs.name().fullname()
246  << " even though their names and shape type match." << std::endl;
247  std::cout << "size: " << lhs.parameters().size() << " " << rhs.parameters().size() << std::endl;
248  }
249  break;
250  }
251  case ddunion:
252  case ddsubtraction:
253  case ddintersection:
254  {
255  if ( ! DDCompareBoolSol(ddco_)(lhs, rhs) ) {
256  ret = false;
257  }
258  break;
259  }
260  case ddreflected:
261  {
262  DDReflectionSolid rs1(lhs);
263  DDReflectionSolid rs2(rhs);
264  if ( ! DDCompareSolid(ddco_)( rs1.unreflected(), rs2.unreflected()) ) {
265  ret = false;
266  std::cout << "Unreflected volumes of DDReflections do not match. Reflections are "
267  << lhs.name().fullname() << " and " << rhs.name().fullname() << std::endl;
268  }
269  break;
270  }
271  default:
272  break;
273  }
274  return ret;
275 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:150
tuple ret
prodAgent to be discontinued
const N & name() const
Definition: DDBase.h:78
Needs to know because of Rotation Matrix of Boolean Relationship.
const std::string fullname() const
Definition: DDName.h:51
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:144
DDCompOptions ddco_
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

DDCompOptions DDCompareSolid::ddco_

Definition at line 57 of file DDCompareTools.h.

Referenced by operator()().