Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -5,74 +5,85 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4KnotVector.hh,v 1.3 1999/12/15 14:49:57 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4KnotVector.hh,v 1.6 2000/11/08 14:22:02 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4KnotVector
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Utility class for operations on a vector of knots.
|
||||
|
||||
// Authors: J.Sulkimo, P.Urban.
|
||||
// Revisions by: L.Broglia, G.Cosmo.
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef __KNOTVECTOR_H
|
||||
#define __KNOTVECTOR_H
|
||||
#include <math.h>
|
||||
//#include "STEPaggregate.h"
|
||||
#include "geomdefs.hh"
|
||||
|
||||
#include <math.h>
|
||||
#include "geomdefs.hh"
|
||||
|
||||
class G4KnotVector
|
||||
{
|
||||
public:
|
||||
|
||||
public: // with description
|
||||
|
||||
G4KnotVector();
|
||||
// G4KnotVector(const int Size, const int* MultiList, STEPaggregate& Aggr);
|
||||
// G4KnotVector(const int Size, STEPaggregate& Aggr);
|
||||
G4KnotVector(const int sz);
|
||||
G4KnotVector(const G4KnotVector& old_kv);
|
||||
G4KnotVector(G4int sz);
|
||||
~G4KnotVector();
|
||||
// Constructors & destructor.
|
||||
|
||||
// Gets number of knots
|
||||
inline int GetSize()const {return k_size;};
|
||||
G4KnotVector(const G4KnotVector& orig);
|
||||
// Copy constructor.
|
||||
|
||||
// Retrieves knot from knot vector index knot_number
|
||||
inline G4double GetKnot(const int knot_number){return knots[knot_number];}
|
||||
G4KnotVector& operator=(const G4KnotVector& right);
|
||||
// Assignment operator.
|
||||
|
||||
// Sets knot vector index knot_number to value
|
||||
inline void PutKnot(const int knot_number, const G4double value)
|
||||
{
|
||||
knots[knot_number]=value;
|
||||
}
|
||||
inline G4int GetSize() const;
|
||||
// Gets number of knots.
|
||||
|
||||
// Adds the internal knots to the new knot vector
|
||||
G4KnotVector* MultiplyKnotVector( const int num, const G4double value);
|
||||
inline G4double GetKnot(G4int knot_number) const;
|
||||
// Retrieves knot from knot vector index knot_number.
|
||||
|
||||
// Creates the new vector by merging the old vector with the
|
||||
// knots in the vector knots_to_add
|
||||
G4double* MergeKnotVector( const G4double *knots_to_add, const int add_size);
|
||||
inline void PutKnot(G4int knot_number, G4double value);
|
||||
// Sets knot vector index knot_number to value.
|
||||
|
||||
// Finds out how many Times val occurs in the knot vector
|
||||
int CheckKnotVector(const G4double val);
|
||||
G4KnotVector* MultiplyKnotVector(G4int num, G4double value);
|
||||
// Adds the internal knots to the new knot vector.
|
||||
|
||||
// Copies either the first half or the second half of
|
||||
// the new knot vector values to the knot vectors of the
|
||||
// new surfaces created by splitting
|
||||
void ExtractKnotVector( G4KnotVector* kv, const int upper, const int lower);
|
||||
G4double* MergeKnotVector(const G4double *knots_to_add, G4int add_size);
|
||||
// Creates the new vector by merging the old vector with the
|
||||
// knots in the vector knots_to_add.
|
||||
|
||||
// Searches the knot vector for the value and returns the index
|
||||
// This is used in the Evaluation of the intersection to find
|
||||
// out between which knots the intersection point is on the b-spline
|
||||
// surface
|
||||
int GetKnotIndex(G4double k_value, const int order);
|
||||
G4int CheckKnotVector(G4double val) const;
|
||||
// Finds out how many times val occurs in the knot vector.
|
||||
|
||||
void ExtractKnotVector(G4KnotVector* kv, G4int upper, G4int lower);
|
||||
// Copies either the first half or the second half of
|
||||
// the new knot vector values to the knot vectors of the
|
||||
// new surfaces created by splitting.
|
||||
|
||||
G4int GetKnotIndex(G4double k_value, G4int order) const;
|
||||
// Searches the knot vector for the value and returns the index
|
||||
// This is used in the evaluation of the intersection to find
|
||||
// out between which knots the intersection point is on the b-spline
|
||||
// surface.
|
||||
|
||||
private:
|
||||
|
||||
// Number of knots
|
||||
int k_size;
|
||||
inline G4double ApxEq(G4double x, G4double y) const;
|
||||
|
||||
private:
|
||||
|
||||
G4int k_size;
|
||||
// Number of knots.
|
||||
|
||||
// Knot vector
|
||||
G4double *knots;
|
||||
|
||||
inline G4double ApxEq(const G4double x,const G4double y)
|
||||
{
|
||||
return (fabs(x - y) < kCarTolerance);
|
||||
}
|
||||
// Knot vector.
|
||||
|
||||
};
|
||||
|
||||
#include "G4KnotVector.icc"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user