G4Conic.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // ----------------------------------------------------------------------
00030 // GEANT 4 class source file
00031 //
00032 // G4conic.cc
00033 //
00034 // ----------------------------------------------------------------------
00035 
00036 #include "G4Conic.hh"
00037 
00038 G4Conic::G4Conic () : pShift(0)
00039 {
00040 }
00041 
00042 G4Conic::~G4Conic()
00043 {
00044 }
00045 
00046 G4Conic::G4Conic(const G4Conic& right)
00047   : G4Curve(), position(right.position), pShift(right.pShift)
00048 {
00049   bBox      = right.bBox;
00050   start     = right.start;
00051   end       = right.end;
00052   pStart    = right.pStart;
00053   pEnd      = right.pEnd;
00054   pRange    = right.pRange;
00055   bounded   = right.bounded;
00056   sameSense = right.sameSense;
00057 }
00058 
00059 G4Conic& G4Conic::operator=(const G4Conic& right)
00060 {
00061   if (&right == this) return *this;
00062 
00063   pShift   = right.pShift;
00064   position = right.position;
00065   bBox      = right.bBox;
00066   start     = right.start;
00067   end       = right.end;
00068   pStart    = right.pStart;
00069   pEnd      = right.pEnd;
00070   pRange    = right.pRange;
00071   bounded   = right.bounded;
00072   sameSense = right.sameSense;
00073 
00074   return *this;
00075 }
00076 
00077 /*
00078 void
00079 G4ConicalCurve::ProjectCurve(const G4Plane& Pl1, const G4Plane& Pl2)
00080 {  
00081   // Curve start
00082   Project(ProjStart, Start, Pl1, Pl2);
00083   // Curve end
00084   Project(ProjEnd, End, Pl1, Pl2);
00085   // Placement
00086   Position.ProjectPlacement(Pl1,Pl2);
00087 }
00088 
00089 G4int
00090 G4ConicalCurve::HitPartOfCurve(G4double Angle, G4double Solution,
00091                                const G4Point2d& ProjHit)
00092 {
00093         // Check if Solution1 is part of the curve i.e. in the "pie"
00094         G4double TmpSol1 = Solution - ProjHit.X();
00095         G4Point2d ArcHit1(TmpSol1, ProjHit.Y());
00096         G4double Cross1 = CrossProduct( ProjStart, ArcHit1);
00097         G4double Cross2 = CrossProduct( ArcHit1  , ProjEnd);
00098         if( (Angle<=0 && Cross1<=0 && Cross2 <=0) ||
00099             (Angle> 0 && !(Cross1>=0 && Cross2 >=0)) )
00100             // Solution1 is on the curve
00101           return 1;
00102         return 0;
00103 }
00104 */

Generated on Mon May 27 17:47:57 2013 for Geant4 by  doxygen 1.4.7