// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // History: // 20.10.2009 G.Barrand : creation. // #include "HepPolyhedronProcessor.h" #include "globals.hh" HepPolyhedronProcessor::HepPolyhedronProcessor(){} HepPolyhedronProcessor::~HepPolyhedronProcessor(){} //private for the moment. HepPolyhedronProcessor::HepPolyhedronProcessor(const HepPolyhedronProcessor&){} HepPolyhedronProcessor& HepPolyhedronProcessor::operator=(const HepPolyhedronProcessor&){return *this;} //public void HepPolyhedronProcessor::push_back(Operation a_op,const HepPolyhedron& a_polyhedron) { m_ops.push_back(op_t(a_op,a_polyhedron)); } void HepPolyhedronProcessor::clear() { m_ops.clear();} bool HepPolyhedronProcessor::is_same_op() const { if(!m_ops.size()) return true; Operation op = m_ops[0].first; std::vector::const_iterator it; for(it=m_ops.begin();it!=m_ops.end();++it) { if((*it).first!=op) return false; } return true; } #include static bool is_in(unsigned int a_index, const std::list& a_is) { std::list::const_iterator it; for(it=a_is.begin();it!=a_is.end();++it) { if(*it==a_index) return true; } return false; } static void dump(const std::vector& a_is) { unsigned int number = a_is.size(); for(unsigned int index=0;index is_t; virtual bool visit(const is_t&) = 0; public: bijection_visitor(unsigned int a_number):m_number(a_number){} bool visitx() { m_is.resize(m_number,0); std::list is; return visit(0,is); } private: bool visit(unsigned int a_level,std::list& a_is) { for(unsigned int index=0;index& a_is ) { HepPolyhedron result(a_poly); unsigned int number = m_ops.size(); int num_shift = BooleanProcessor::get_num_shift(); for(int ishift=0;ishift