CMS 3D CMS Logo

Public Member Functions

DDLReflectionSolid Class Reference

DDLReflectionSolid processes ReflectionSolid elements. More...

#include <DDLReflectionSolid.h>

Inheritance diagram for DDLReflectionSolid:
DDLSolid DDXMLElement

List of all members.

Public Member Functions

 DDLReflectionSolid (DDLElementRegistry *myreg)
 Constructor.
void preProcessElement (const std::string &name, const std::string &nmspace, DDCompactView &cpv)
 Called by loadAttributes AFTER attributes are loaded.
void processElement (const std::string &name, const std::string &nmspace, DDCompactView &cpv)
 Processing the element.
 ~DDLReflectionSolid (void)
 Destructor.

Detailed Description

DDLReflectionSolid processes ReflectionSolid elements.

Author:
Michael Case

DDLReflectionSolid.h - description ------------------- begin: Mon Mar 4, 2002 email: case@ucdhep.ucdavis.edu

This is the ReflectionSolid processor.

Definition at line 23 of file DDLReflectionSolid.h.


Constructor & Destructor Documentation

DDLReflectionSolid::DDLReflectionSolid ( DDLElementRegistry myreg)

Constructor.

Definition at line 21 of file DDLReflectionSolid.cc.

  : DDLSolid( myreg )
{}
DDLReflectionSolid::~DDLReflectionSolid ( void  )

Destructor.

Definition at line 25 of file DDLReflectionSolid.cc.

{}

Member Function Documentation

void DDLReflectionSolid::preProcessElement ( const std::string &  name,
const std::string &  nmspace,
DDCompactView cpv 
) [virtual]

Called by loadAttributes AFTER attributes are loaded.

The preProcessElement method can assume that the attributes are loaded and perform any code that is necessary at the start of an element.

This would allow users to call their own code to setup anything necessary for the continued processing of the child elements.

Reimplemented from DDXMLElement.

Definition at line 30 of file DDLReflectionSolid.cc.

References DDXMLElement::clear(), DDLElementRegistry::getElement(), and DDXMLElement::myRegistry_.

{
  myRegistry_->getElement("rSolid")->clear();
}
void DDLReflectionSolid::processElement ( const std::string &  name,
const std::string &  nmspace,
DDCompactView cpv 
) [virtual]

Processing the element.

The processElement method completes any necessary work to process the XML element.

For example, this can be used to call the DDCore to make the geometry in memory. There is a default for this so that if not declared in the inheriting class, no processing is done.

Reimplemented from DDXMLElement.

Definition at line 37 of file DDLReflectionSolid.cc.

References gather_cfg::cout, DCOUT_V, DDXMLElement::getDDName(), DDLElementRegistry::getElement(), DDXMLElement::myRegistry_, DDSolidFactory::reflection(), DDLSolid::setReference(), and DDXMLElement::size().

{
  DCOUT_V('P', "DDLReflectionSolid::processElement started");

  // get solid reference:
  DDXMLElement* myrSolid = myRegistry_->getElement("rSolid");

  if (myrSolid->size() != 1)
  {
    std::cout << "WARNING:  A ReflectionSolid had more than one rSolid.  "
              << "The first one was used." << std::endl;
    std::cout << "The element to look for is " << getDDName(nmspace) << std::endl;
  }

  DDSolid solid = DDSolid(myrSolid->getDDName(nmspace));
  DDSolid ddreflsol = DDSolidFactory::reflection(getDDName(nmspace), solid);

  DDLSolid::setReference(nmspace, cpv);

  DCOUT_V('P', "DDLReflectionSolid::processElement completed");
}