CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Friends

DDAlgo Class Reference

#include <DDAlgo.h>

Inheritance diagram for DDAlgo:
DDBase< DDName, AlgoPos * >

List of all members.

Public Member Functions

int copyno () const
 DDAlgo (const DDName &name)
 DDAlgo ()
int end () const
bool go () const
int incr () const
std::string label () const
void next ()
const parE_typeparE () const
const parS_typeparS () const
DDRotationMatrix rotation ()
void setParameters (int start, int end, int incr, const parS_type &, const parE_type &)
int start () const
DDTranslation translation ()

Private Member Functions

 DDAlgo (const DDName &, AlgoPos *)

Friends

DDAlgo DDalgo (const DDName &, AlgoPos *)
std::ostream & operator<< (std::ostream &, const DDAlgo &)

Detailed Description

Definition at line 21 of file DDAlgo.h.


Constructor & Destructor Documentation

DDAlgo::DDAlgo ( )

Definition at line 27 of file DDAlgo.cc.

DDAlgo::DDAlgo ( const DDName name)
DDAlgo::DDAlgo ( const DDName name,
AlgoPos a 
) [private]

Definition at line 37 of file DDAlgo.cc.

References DDI::Singleton< I >::instance(), and DDBase< DDName, AlgoPos * >::prep_.

                                               : DDBase<DDName,AlgoPos*>()

{ 
  prep_ = StoreT::instance().create(name,a);
}

Member Function Documentation

int DDAlgo::copyno ( void  ) const

copy-number calculation

Definition at line 90 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

Referenced by label().

{
  return rep().copyno();
}
int DDAlgo::end ( void  ) const

the 'end' parameter

Definition at line 57 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

{
  return rep().end();
}
bool DDAlgo::go ( ) const

continue calling the algorithm unless go() returns false

Definition at line 111 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

Referenced by DDCompactView::algoPosPart().

{
  return rep().go();
}
int DDAlgo::incr ( ) const

the 'incr' parameter

Definition at line 62 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

{
  return rep().incr();
}
std::string DDAlgo::label ( ) const

copy-number delivered as std::string

Definition at line 97 of file DDAlgo.cc.

References copyno().

Referenced by DDCompactView::algoPosPart().

{
  char buffer [50]; 
  /*int n =*/ sprintf(buffer,"%d",copyno());
  return std::string(buffer);
}
void DDAlgo::next ( void  )

prepare the algorithm for its next iteration or set its state to 'terminate' in case all iterations have already been done

Definition at line 105 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

Referenced by DDCompactView::algoPosPart().

{
  rep().next();
}
const parE_type & DDAlgo::parE ( ) const

double valued user parameter, values already evaluated from expressions

Definition at line 72 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

{
  return rep().parE();
}
const parS_type & DDAlgo::parS ( ) const

std::string valued user parameter

Definition at line 67 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

{
  return rep().parS();
}
DDRotationMatrix DDAlgo::rotation ( void  )

rotation calculations

Definition at line 84 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

Referenced by DDCompactView::algoPosPart().

{
  return rep().rotation();
}
void DDAlgo::setParameters ( int  start,
int  end,
int  incr,
const parS_type ps,
const parE_type pe 
)

sets user defined parameters

Definition at line 45 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

Referenced by DDLAlgoPosPart::processElement().

{
   rep().setParameters(start, end, incr, ps, pe);
}                        
int DDAlgo::start ( ) const

the 'start' parameter

Definition at line 52 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

{
  return rep().start();
}
DDTranslation DDAlgo::translation ( void  )

translation calculations

Definition at line 78 of file DDAlgo.cc.

References DDBase< DDName, AlgoPos * >::rep().

Referenced by DDCompactView::algoPosPart().

{
  return rep().translation();
}

Friends And Related Function Documentation

DDAlgo DDalgo ( const DDName n,
AlgoPos a 
) [friend]

create a DDCore compatible algorithm

Definition at line 117 of file DDAlgo.cc.

{
  return DDAlgo(n,a);
}
std::ostream& operator<< ( std::ostream &  os,
const DDAlgo algo 
) [friend]

Definition at line 7 of file DDAlgo.cc.

{
 DDBase<DDName,AlgoPos*>::def_type defined(algo.isDefined());
  if (defined.first) {
    os << *(defined.first) << " ";
    if (defined.second) {
      algo.rep().stream(os); 
    }
    else {
      os << "* algorithm not defined * ";  
    }
  }  
  else {
    os << "* algorithm not declared * ";  
  }  
  return os;
  
}