G4ProjectedSurface.hh

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 // Class G4ProjectedSurface
00031 //
00032 // Class description:
00033 // 
00034 // Definition of a projected surface.
00035 
00036 // Authors: J.Sulkimo, P.Urban.
00037 // Revisions by: L.Broglia, G.Cosmo.
00038 // ----------------------------------------------------------------------
00039 #ifndef __G4ProjectedSurface_h
00040 #define __G4ProjectedSurface_h 1
00041 
00042 #include "G4BezierSurface.hh"
00043 
00044 class G4ProjectedSurface : public G4Surface
00045 {
00046   friend class G4BSplineSurface;
00047   friend void CopySurface(G4ProjectedSurface& proj);
00048   
00049  public:  // with description
00050 
00051   G4ProjectedSurface();
00052   virtual ~G4ProjectedSurface();
00053     // Default constructor and destructor.
00054 
00055   void CalcBBox();
00056     // Finds the bounds of the 2D-projected nurb, it
00057     // calculates the bounds for a bounding rectangle
00058     // to the surface. The bounding rectangle is used
00059     // for a preliminary check of intersection.
00060         
00061  public:  // without description
00062 
00063   inline G4Vector3D SurfaceNormal(const G4Point3D& Pt) const;
00064     // Returns normal to surface (G4Vector3D(0,0,0)).
00065 
00066  private:
00067 
00068   G4ProjectedSurface(const G4ProjectedSurface&);
00069   G4ProjectedSurface& operator=(const G4ProjectedSurface&);
00070     // Private copy constructor and assignment operator.
00071 
00072   void CopySurface();
00073     // Copies the projected surface into a bezier surface
00074     // and adds it to the List of bezier surfaces.
00075 
00076   void ConvertToBezier (G4SurfaceList& p, G4SurfaceList& b);
00077     // Converts surface into a Bezier surface to b.
00078 
00079   inline G4int GetOrder(G4int direction) const;
00080   inline void PutOrder(G4int direction, G4int value);
00081   
00082   void SplitNURBSurface();
00083     // Divides the surface in two parts. Uses the oslo-algorithm to calculate
00084     // the new knot-vectors and control-points for the subsurfaces.
00085 
00086   G4int  CheckBezier();
00087     // Checks if the surface is a Bezier surface by verifying
00088     // if internal knots exist. If no internal knots exist the quantity
00089     // of knots is 2*order of the surface. Returns 1 if the surface 
00090     // is a Bezier.
00091 
00092   void CalcOsloMatrix();
00093     // Calculates the oslo-matrix, which is used in mapping the new
00094     // knot-vector and the control-point values.
00095     // This algorithm is described in the paper "Making the Oslo-algorithm
00096     // more efficient" in SIAM J.NUMER.ANAL. Vol.23, No. 3, June '86.
00097 
00098   void MapSurface(G4ProjectedSurface* srf);
00099     // Maps the new control-points into the new surface.
00100     // This algorithm is described in the paper "Making the Oslo-algorithm
00101     // more efficient" in SIAM J.NUMER.ANAL. Vol.23, No. 3, June '86.
00102 
00103   inline G4int Amax(G4int i, G4int j) const;
00104   inline G4int Amin(G4int i, G4int j) const;
00105   inline G4int AhIndex(G4int j, G4int t, G4int iorder) const;
00106 
00107  protected:
00108 
00109   static G4int Splits;
00110   G4ControlPoints *ctl_points;
00111     // Test variables
00112 
00113  private:
00114 
00115   short dir;
00116   G4KnotVector *u_knots;
00117   G4KnotVector *v_knots;
00118   
00119   G4SurfaceList* projected_list;
00120   G4SurfaceList* bezier_list;   
00121         
00122   G4int order[2];
00123   G4KnotVector *new_knots;
00124   G4int ord;
00125   G4int lower,upper;
00126   
00127   G4OsloMatrix* oslo_m;
00128   G4Point3D vmin;
00129   G4Point3D vmax;
00130 };      
00131 
00132 #include "G4ProjectedSurface.icc"
00133 
00134 #endif

Generated on Mon May 27 17:49:26 2013 for Geant4 by  doxygen 1.4.7