Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NURBS.hh File Reference
#include "globals.hh"
#include "G4Visible.hh"
#include "G4ios.hh"
#include "G4Point3D.hh"
#include "G4Vector3D.hh"

Go to the source code of this file.

Classes

class  G4NURBS
 
class  G4NURBS::KnotsIterator
 
class  G4NURBS::CtrlPtsCoordsIterator
 
class  G4NURBS::CtrlPtsIterator
 
struct  G4NURBS::t_Dir
 

Functions

std::ostream & operator<< (std::ostream &inout_OutStream, G4NURBS::t_KnotVectorGenFlag in_KVGFlag)
 
std::ostream & operator<< (std::ostream &inout_outStream, const G4NURBS &in_kNurb)
 

Function Documentation

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream &  inout_outStream,
const G4NURBS in_kNurb 
)

Definition at line 46 of file G4NURBS.cc.

48{
49 inout_outStream
50 // the magic could be changed for good reasons only
51 << "##ojc{NURBS}def[1.01.96.7] Just a magic. Could be added to /etc/magic"
52 << "\n# NURBS Definition File (human and computer readable format)"
53 << "\n# :" << in_kNurb.Whoami()
54 << "\n# U order\tV order : "
55 << '\n' << in_kNurb.GetUorder() << "\t\t" << in_kNurb.GetVorder();
56 // number of knots and knots themselves for U and V
58 /*(*(G4int *)(&dir))++*/ dir=(G4NURBS::t_direction)(((G4int)(dir))+1) )
59 {
60 inout_outStream
61 << "\n# Number of knots along " << G4NURBS::Tochar(dir)
62 << '\n' << in_kNurb.GetnbrKnots(dir)
63 << "\n# " << G4NURBS::Tochar(dir) << " knots vector (as a column)";
64 { // begin knots iteration
65 G4double oneKnot;
66 G4NURBS::KnotsIterator knotI(in_kNurb,dir);
67 G4bool otherKnots;
68 do
69 {
70 otherKnots = knotI.pick(&oneKnot);
71 inout_outStream << "\n\t\t" << oneKnot;
72 }
73 while (otherKnots);
74 } // end of knots iteration
75 } // end of direction loop
76
77 // number of control points in U and V direction
78 // and controlpoints
79 inout_outStream
80 << "\n# Number of control points along U and V"
81 << '\n' << in_kNurb.GetUnbrCtrlPts()
82 << " " << in_kNurb.GetVnbrCtrlPts()
83 << "\n# Control Points (one by line, U increasing first)";
84 { // begin of control points iteration
86 G4NURBS::CtrlPtsIterator cpI(in_kNurb);
87 G4bool otherCPs;
88 do
89 {
90 otherCPs = cpI.pick(&oneCP);
91 inout_outStream
92 << "\n\t" << oneCP[G4NURBS::X]
93 << "\t" << oneCP[G4NURBS::Y]
94 << "\t" << oneCP[G4NURBS::Z]
95 << "\t" << oneCP[G4NURBS::W];
96 }
97 while (otherCPs);
98 } // end of control point iteration
99
100 inout_outStream << "\n# That's all!"
101 << G4endl; // endl do an \n and a flush
102 return inout_outStream;
103}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4double t_doubleCtrlPt[NofC]
Definition: G4NURBS.hh:110
static char Tochar(t_direction in_dir)
Definition: G4NURBS.hh:467
G4int GetnbrKnots(t_direction in_dir) const
Definition: G4NURBS.hh:459
G4int GetUorder() const
Definition: G4NURBS.hh:431
G4int GetVorder() const
Definition: G4NURBS.hh:432
virtual const char * Whoami() const =0
G4int GetUnbrCtrlPts() const
Definition: G4NURBS.hh:435
G4int GetVnbrCtrlPts() const
Definition: G4NURBS.hh:436
t_direction
Definition: G4NURBS.hh:72
@ NofD
Definition: G4NURBS.hh:76

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  inout_OutStream,
G4NURBS::t_KnotVectorGenFlag  in_KVGFlag 
)

Definition at line 369 of file G4NURBS.cc.

371{
372 switch (in_f)
373 {
374 case G4NURBS::UserDefined: io_ostr << "UserDefined"; break;
375 case G4NURBS::Regular: io_ostr << "Regular"; break;
376 case G4NURBS::RegularRep: io_ostr << "RegularRep"; break;
377 default: io_ostr << (G4int)in_f;
378 }
379 return io_ostr;
380}
@ Regular
Definition: G4NURBS.hh:324
@ UserDefined
Definition: G4NURBS.hh:321
@ RegularRep
Definition: G4NURBS.hh:328