** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: phantom.cpp,v 1.32 2002/05/28 18:43:16 kevin Exp $
+** $Id$
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
const char* Phantom::s_aszPhantomName[] =
{
- {"herman"},
- {"shepp-logan"},
- {"unit-pulse"},
+ "herman",
+ "shepp-logan",
+ "unit-pulse",
};
const char* Phantom::s_aszPhantomTitle[] =
{
- {"Herman Head"},
- {"Shepp-Logan"},
- {"Unit Pulse"},
+ "Herman Head",
+ "Shepp-Logan",
+ "Unit Pulse",
};
const int Phantom::s_iPhantomCount = sizeof(s_aszPhantomName) / sizeof(const char*);
void
Phantom::addPElem (const char *type, const double cx, const double cy, const double u, const double v, const double rot, const double atten)
{
- PhantomElement *pelem = new PhantomElement (type, cx, cy, u, v, rot, atten);
+ PhmElemType pe_type = PhantomElement::convertNameToType (type);
+ if (pe_type == PELEM_INVALID) {
+ sys_error (ERR_WARNING, "Unknown PhantomElement type %s [PhantomElement::PhantomElement]", type);
+ return;
+ }
+ PhantomElement *pelem = new PhantomElement (type, cx, cy, u, v, rot, atten);
m_listPElem.push_front (pelem);
// update phantom limits
type = PELEM_SECTOR;
else if (strcasecmp (typeName, "segment") == 0)
type = PELEM_SEGMENT;
- else
- sys_error (ERR_WARNING, "Unknown PhantomElement type %s [PhantomElement::PhantomElement]", type);
return (type);
}
m_yOutline[cpts] = 0.0;
break;
default:
- sys_error(ERR_WARNING, "illegal pelem type %d [makeVectorOutline]", m_type);
+ sys_error(ERR_WARNING, "Illegal phantom element type %d [makeVectorOutline]", m_type);
return;
}