45 static EGS_PRISM_LOCAL
string __prismX(
"EGS_PrismX");
46 static EGS_PRISM_LOCAL
string __prismY(
"EGS_PrismY");
47 static EGS_PRISM_LOCAL
string __prismZ(
"EGS_PrismZ");
48 static EGS_PRISM_LOCAL
string __prism(
"EGS_Prism");
55 egsWarning(
"createGeometry(prism): null input?\n");
59 int err = input->
getInput(
"type",type);
61 egsWarning(
"createGeometry(prism): missing 'type' input\n");
68 egsWarning(
"createGeometry(prism): missing 'points' input\n");
72 vector<EGS_Float> tmp;
74 if (!err && tmp.size() == 2) {
79 err = input->
getInput(
"open triangle",itmp);
80 if (!err && itmp == 1) {
84 || input->
compare(type,__prismZ)) {
87 egsWarning(
"createGeometry(prism): at least 3 points are required "
88 "to construct a prism\n");
91 vector<EGS_2DVector> points;
92 for (
int j=0; j<np; j++) {
96 if (input->
compare(type,__prismX))
99 else if (input->
compare(type,__prismY))
107 if (input->
compare(type,__prismX))
110 else if (input->
compare(type,__prismY))
121 egsWarning(
"createGeometry(prism): at least 3 points are required"
122 " to construct a prism\n");
125 vector<EGS_Vector> points;
126 for (
int j=0; j<np; j++) {
127 points.push_back(
EGS_Vector(p[3*j],p[3*j+1],p[3*j+2]));
131 points.push_back(points[0]);
135 vector<EGS_2DVector> p2;
137 for (
int j=0; j<np; j++) {
138 p2.push_back(pro.getProjection(points[j]));
139 EGS_Float d = pro.distance(points[j]);
142 "points are not on a plane\n");
A class representing 2D vectors.
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
void setMedia(EGS_Input *inp)
Set the media in the geometry from the input pointed to by inp.
void setName(EGS_Input *inp)
Set the name of the geometry from the input inp.
int setLabels(EGS_Input *input)
Set the labels from an input block.
void setBoundaryTolerance(EGS_Input *inp)
Set the value of the boundary tolerance from the input inp.
A projector into any plane.
A class representing 3D vectors.
A projector into the x-plane.
A projector into the y-plane.
A projector into the z-plane.
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
EGS_PolygonT< EGS_XProjector > EGS_PolygonYZ
A 3D polygon in the x-plane.
EGS_PolygonT< EGS_Projector > EGS_Polygon
A 3D polygon in any plane.
EGS_PolygonT< EGS_ZProjector > EGS_PolygonXY
A 3D polygon in the z-plane.
EGS_PolygonT< EGS_YProjector > EGS_PolygonXZ
A 3D polygon in the y-plane.
A prism geometry: header.
EGS_PrismT< EGS_PolygonYZ > EGS_PrismX
A prism with base in the X-plane.
EGS_PrismT< EGS_Polygon > EGS_Prism
A prism with base in an arbitrary plane.
EGS_PrismT< EGS_PolygonXZ > EGS_PrismY
A prism with base in the Y-plane.
EGS_PrismT< EGS_PolygonXY > EGS_PrismZ
A prism with base in the Z-plane.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.