43 static EGS_PRISM_LOCAL
string __prismX(
"EGS_PrismX");
44 static EGS_PRISM_LOCAL
string __prismY(
"EGS_PrismY");
45 static EGS_PRISM_LOCAL
string __prismZ(
"EGS_PrismZ");
46 static EGS_PRISM_LOCAL
string __prism(
"EGS_Prism");
53 egsWarning(
"createGeometry(prism): null input?\n");
57 int err = input->
getInput(
"type",type);
59 egsWarning(
"createGeometry(prism): missing 'type' input\n");
66 egsWarning(
"createGeometry(prism): missing 'points' input\n");
70 vector<EGS_Float> tmp;
72 if (!err && tmp.size() == 2) {
77 err = input->
getInput(
"open triangle",itmp);
78 if (!err && itmp == 1) {
82 || input->
compare(type,__prismZ)) {
85 egsWarning(
"createGeometry(prism): at least 3 points are required "
86 "to construct a prism\n");
89 vector<EGS_2DVector> points;
90 for (
int j=0; j<np; j++) {
94 if (input->
compare(type,__prismX))
97 else if (input->
compare(type,__prismY))
105 if (input->
compare(type,__prismX))
108 else if (input->
compare(type,__prismY))
119 egsWarning(
"createGeometry(prism): at least 3 points are required"
120 " to construct a prism\n");
123 vector<EGS_Vector> points;
124 for (
int j=0; j<np; j++) {
125 points.push_back(
EGS_Vector(p[3*j],p[3*j+1],p[3*j+2]));
129 points.push_back(points[0]);
133 vector<EGS_2DVector> p2;
135 for (
int j=0; j<np; j++) {
136 p2.push_back(pro.getProjection(points[j]));
137 EGS_Float d = pro.distance(points[j]);
140 "points are not on a plane\n");
A class representing 2D vectors.
A class representing 3D vectors.
int setLabels(EGS_Input *input)
Set the labels from an input block.
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
void setBoundaryTolerance(EGS_Input *inp)
Set the value of the boundary tolerance from the input inp.
EGS_PolygonT< EGS_XProjector > EGS_PolygonYZ
A 3D polygon in the x-plane.
EGS_PrismT< EGS_PolygonYZ > EGS_PrismX
A prism with base in the X-plane.
EGS_PolygonT< EGS_Projector > EGS_Polygon
A 3D polygon in any plane.
void setMedia(EGS_Input *inp)
Set the media in the geometry from the input pointed to by inp.
A projector into any plane.
void setName(EGS_Input *inp)
Set the name of the geometry from the input inp.
EGS_PrismT< EGS_PolygonXZ > EGS_PrismY
A prism with base in the Y-plane.
A projector into the z-plane.
A projector into the y-plane.
EGS_PrismT< EGS_PolygonXY > EGS_PrismZ
A prism with base in the Z-plane.
EGS_PolygonT< EGS_ZProjector > EGS_PolygonXY
A 3D polygon in the z-plane.
A projector into the x-plane.
EGS_PrismT< EGS_Polygon > EGS_Prism
A prism with base in an arbitrary plane.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
A prism geometry: header.
EGS_PolygonT< EGS_YProjector > EGS_PolygonXZ
A 3D polygon in the y-plane.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.