Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NURBS::CtrlPtsIterator Class Reference

#include <G4NURBS.hh>

Public Member Functions

 CtrlPtsIterator (const G4NURBS &in_rNurb, t_indCtrlPt in_startIndex=0)
 
G4bool pick (t_doubleCtrlPt *inout_pDblCtrlPt)
 
G4bool pick (t_floatCtrlPt *inout_pFltCtrlPt)
 

Protected Attributes

const t_CtrlPt *const kmpMax
 
const t_CtrlPtmp
 

Detailed Description

Definition at line 252 of file G4NURBS.hh.

Constructor & Destructor Documentation

◆ CtrlPtsIterator()

G4NURBS::CtrlPtsIterator::CtrlPtsIterator ( const G4NURBS in_rNurb,
t_indCtrlPt  in_startIndex = 0 
)

Definition at line 297 of file G4NURBS.cc.

299 : kmpMax(in_rNurb.mpCtrlPts + in_rNurb.mtotnbrCtrlPts)
300{
301 if (in_startIndex < in_rNurb.mtotnbrCtrlPts )
302 mp = (in_rNurb.mpCtrlPts + in_startIndex);
303 else
304 {
305 G4cerr << "\nERROR: G4NURBS::CtrlPtsIterator: in_startIndex out of range"
306 << "\n\tin_startIndex : " << in_startIndex
307 << ", nbr of CtrlPts : " << in_rNurb.mtotnbrCtrlPts
308 << "\n\t mp set to NULL, calls to picking functions will fail"
309 << G4endl;
310 mp = 0;
311 }
312}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
const t_CtrlPt * mp
Definition: G4NURBS.hh:262
const t_CtrlPt *const kmpMax
Definition: G4NURBS.hh:261
t_CtrlPt * mpCtrlPts
Definition: G4NURBS.hh:350
t_indCtrlPt mtotnbrCtrlPts
Definition: G4NURBS.hh:349

Member Function Documentation

◆ pick() [1/2]

G4bool G4NURBS::CtrlPtsIterator::pick ( t_doubleCtrlPt inout_pDblCtrlPt)

Definition at line 314 of file G4NURBS.cc.

315{
316 for (t_indCoord i = G4NURBS::X; i < G4NURBS::NofC; i++)
317 (*inout_pDblCtrlPt)[i] = (G4double)((*mp)[i]);
318 return (G4bool)((++mp)<kmpMax);
319}
double G4double
Definition: G4Types.hh:64
bool G4bool
Definition: G4Types.hh:67
unsigned int t_indCoord
Definition: G4NURBS.hh:90
@ NofC
Definition: G4NURBS.hh:106

Referenced by operator<<().

◆ pick() [2/2]

G4bool G4NURBS::CtrlPtsIterator::pick ( t_floatCtrlPt inout_pFltCtrlPt)

Definition at line 321 of file G4NURBS.cc.

322{
323 for (t_indCoord i = G4NURBS::X; i < G4NURBS::NofC; i++)
324 (*inout_pFltCtrlPt)[i] = (G4float)((*mp)[i]);
325 return (G4bool)((++mp)<kmpMax);
326}
float G4float
Definition: G4Types.hh:65

Member Data Documentation

◆ kmpMax

const t_CtrlPt* const G4NURBS::CtrlPtsIterator::kmpMax
protected

Definition at line 261 of file G4NURBS.hh.

◆ mp

const t_CtrlPt* G4NURBS::CtrlPtsIterator::mp
protected

Definition at line 262 of file G4NURBS.hh.

Referenced by CtrlPtsIterator().


The documentation for this class was generated from the following files: