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

Referenced by operator()().

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

Definition at line 223 of file DDCompareTools.cc.

223 : ddco_(ddco) { }
DDCompOptions ddco_

Member Function Documentation

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

Definition at line 225 of file DDCompareTools.cc.

References gather_cfg::cout, dd_not_init, ddbox, ddco_, DDCompareSolid(), ddcons, ddcuttubs, ddellipsoid, ddellipticaltube, ddextrudedpolygon, 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(), DDSolid::shape(), and DDReflectionSolid::unreflected().

225  {
226  bool ret(true);
227  switch ( lhs.shape() ) {
228  case dd_not_init:
229  case ddbox:
230  case ddtubs:
231  case ddcuttubs:
232  case ddtrap:
233  case ddcons:
234  case ddpolycone_rz:
235  case ddpolyhedra_rz:
236  case ddpolycone_rrz:
237  case ddpolyhedra_rrz:
238  case ddextrudedpolygon:
239  case ddtorus:
240  case ddpseudotrap:
241  case ddtrunctubs:
242  case ddsphere:
243  case ddorb:
244  case ddellipticaltube:
245  case ddellipsoid:
246  case ddparallelepiped:
247  case ddshapeless:
248  {
249  if ( lhs.name().fullname() != rhs.name().fullname() ) {
250  ret = false;
251  std::cout << "Solid names do not match for solid " << lhs.name().fullname() << " and " << rhs.name().fullname() << std::endl;
252  } else if ( lhs.shape() != rhs.shape() ) {
253  ret = false;
254  std::cout << "Shape types do not match for solids " << lhs.name().fullname()
255  << " and " << rhs.name().fullname()
256  << " even though their names match " << std::endl;
257  } else if ( ! DDCompareDBLVEC()(lhs.parameters(), rhs.parameters()) ) {
258  ret = false;
259  std::cout << "Parameters do not match for solids " << lhs.name().fullname()
260  << " and " << rhs.name().fullname()
261  << " even though their names and shape type match." << std::endl;
262  std::cout << "size: " << lhs.parameters().size() << " " << rhs.parameters().size() << std::endl;
263  }
264  break;
265  }
266  case ddunion:
267  case ddsubtraction:
268  case ddintersection:
269  {
270  if ( ! DDCompareBoolSol(ddco_)(lhs, rhs) ) {
271  ret = false;
272  }
273  break;
274  }
275  case ddreflected:
276  {
277  DDReflectionSolid rs1(lhs);
278  DDReflectionSolid rs2(rhs);
279  if ( ! DDCompareSolid(ddco_)( rs1.unreflected(), rs2.unreflected()) ) {
280  ret = false;
281  std::cout << "Unreflected volumes of DDReflections do not match. Reflections are "
282  << lhs.name().fullname() << " and " << rhs.name().fullname() << std::endl;
283  }
284  break;
285  }
286  default:
287  break;
288  }
289  return ret;
290 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:147
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:52
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:141
DDCompOptions ddco_

Member Data Documentation

DDCompOptions DDCompareSolid::ddco_

Definition at line 67 of file DDCompareTools.h.

Referenced by operator()().