// // ******************************************************************** // * 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. * // ******************************************************************** // // // $Id: G4CompositeCurve.cc,v 1.13 2006/06/29 18:41:54 gunter Exp $ // GEANT4 tag $Name: geant4-09-02-ref-02 $ // // ---------------------------------------------------------------------- // GEANT 4 class source file // // G4CircularCurve.cc // // ---------------------------------------------------------------------- #include "G4CompositeCurve.hh" #include "G4Line.hh" G4CompositeCurve::G4CompositeCurve(){} G4CompositeCurve::G4CompositeCurve(const G4Point3DVector& vertices) { G4CurveVector cv; for (size_t i=0; iInit(p1, p2-p1); l->SetBounds(p1, p2); cv.push_back(l); } Init(cv); } G4CompositeCurve::~G4CompositeCurve() { // Remove segments and delete all its contents G4Curve* a = 0; while (segments.size()>0) { a = segments.back(); segments.pop_back(); for (G4CurveVector::iterator i=segments.begin(); i!=segments.end(); i++) { if (*i==a) { segments.erase(i); i--; } } if ( a ) delete a; } } G4String G4CompositeCurve::GetEntityType() const { return G4String("G4CompositeCurve"); } G4Curve* G4CompositeCurve::Project(const G4Transform3D& tr) { G4CurveVector newSegments; G4Curve* a = 0; G4Curve* c = 0; for (size_t i=0; iProject(tr); if (c==0) { // Remove newSegments and delete all its contents while (newSegments.size()>0) { a = newSegments.back(); newSegments.pop_back(); for (G4CurveVector::iterator i=newSegments.begin(); i!=newSegments.end(); i++) { if (*i==a) { newSegments.erase(i); i--; } } if ( a ) delete a; } return 0; } newSegments.push_back(c); } G4CompositeCurve* r= new G4CompositeCurve; r->Init(newSegments); return r; } ///////////////////////////////////////////////////////////////////////////// G4double G4CompositeCurve::GetPMax() const { G4Exception("G4CompositeCurve::GetPMax()", "NotApplicable", FatalException, "Not applicable to base class."); return 0; } G4Point3D G4CompositeCurve::GetPoint(G4double) const { G4Exception("G4CompositeCurve::GetPoint()", "NotApplicable", FatalException, "Not applicable to base class."); // Fake return value return G4Point3D(); } G4double G4CompositeCurve::GetPPoint(const G4Point3D&) const { G4Exception("G4CompositeCurve::GetPPoint()", "NotApplicable", FatalException, "Not applicable to base class."); return 0; } //////////////////////////////////////////////////////////////////////////// /* void G4CompositeCurve::IntersectRay2D(const G4Ray& ray, G4CurveRayIntersection& is) { is.Reset(); for (G4int i=0; iBBox(); bBox.Init(b->GetBoxMin(), b->GetBoxMax()); for (size_t i=1; iBBox(); bBox.Extend(b->GetBoxMin()); bBox.Extend(b->GetBoxMax()); } // init for efficient parameter <-> 3D point conversions }