591 |
|
|
592 |
{ |
{ |
593 |
"Type": "2", |
"Type": "2", |
|
"Name": "SqAndLineConnector", |
|
|
"Data": "float px1, py1, px2, py2, dz1, dz2, red, green, blue, alpha, sqAlpha, lineWidth, sqLineWidth;", |
|
|
"Params": """float px1, float py1, float px2, float py2, float dz1, float dz2, |
|
|
float red, float green, float blue, float alpha, float sqAlpha, float lineWidth, float sqLineWidth""", |
|
|
"ParamCode": """ this->px1 = px1; this->py1 = py1; |
|
|
this->px2 = px2; this->py2 = py2; |
|
|
this->dz1 = dz1; this->dz2 = dz2; |
|
|
this->red = red; this->green = green; |
|
|
this->blue = blue; this->alpha = alpha; |
|
|
this->sqAlpha = sqAlpha; |
|
|
this->lineWidth = lineWidth; this->sqLineWidth = sqLineWidth;""", |
|
|
"RenderCode": """ |
|
|
bool colored = true; |
|
|
if (red < 0 || green < 0 || blue < 0 || alpha < 0) colored = false; |
|
|
Pt box1 = coords1.getSqSize(); |
|
|
Pt box2 = coords2.getSqSize(); |
|
|
ZPt p1 = coords1.transform(ZPt(box1.x*px1,box1.y*py1,0)); |
|
|
ZPt p2 = coords2.transform(ZPt(box2.x*px2,box2.y*py2,0)); |
|
|
p1.z += dz1; |
|
|
p2.z += dz2; |
|
|
if (colored) glPushAttrib(GL_CURRENT_BIT); |
|
|
glPushAttrib(GL_ENABLE_BIT); |
|
|
glDisable(GL_TEXTURE_2D); |
|
|
if (colored) glColor4f(red, green, blue, alpha); |
|
|
|
|
|
glLineWidth(lineWidth); |
|
|
|
|
|
glBegin(GL_LINE_STRIP); |
|
|
glVertex3f(p1.x, p1.y, p1.z); |
|
|
glVertex3f(p2.x, p2.y, p2.z); |
|
|
glEnd(); |
|
|
|
|
|
glLineWidth(sqLineWidth); |
|
|
|
|
|
// square box 1 |
|
|
glBegin(GL_LINE_LOOP); |
|
|
p1 = coords1.transform(ZPt(0,0,0)); |
|
|
glVertex3f(p1.x, p1.y, p1.z); |
|
|
p1 = coords1.transform(ZPt(box1.x, 0, 0)); |
|
|
glVertex3f(p1.x, p1.y, p1.z); |
|
|
p1 = coords1.transform(ZPt(box1.x, box1.y,0)); |
|
|
glVertex3f(p1.x, p1.y, p1.z); |
|
|
p1 = coords1.transform(ZPt(0, box1.y, 0)); |
|
|
glVertex3f(p1.x, p1.y, p1.z); |
|
|
glEnd(); |
|
|
|
|
|
/* don't draw at all. |
|
|
// square box 2 |
|
|
glBegin(GL_LINE_LOOP); |
|
|
p2 = coords2.transform(ZPt(0,0,0)); |
|
|
glVertex3f(p2.x, p2.y, p2.z); |
|
|
p2 = coords2.transform(ZPt(box2.x, 0,0)); |
|
|
glVertex3f(p2.x, p2.y, p2.z); |
|
|
p2 = coords2.transform(ZPt(box2.x, box2.y, 0)); |
|
|
glVertex3f(p2.x, p2.y, p2.z); |
|
|
p2 = coords2.transform(ZPt(0, box2.y, 0)); |
|
|
glVertex3f(p2.x, p2.y, p2.z); |
|
|
glEnd(); |
|
|
*/ |
|
|
|
|
|
if (colored) glPopAttrib(); |
|
|
glPopAttrib(); |
|
|
""" |
|
|
}, |
|
|
|
|
|
{ |
|
|
"Type": "2", |
|
594 |
"Name": "SqFilletConnection", |
"Name": "SqFilletConnection", |
595 |
"Data": "float width;int flags; float blendw; int power;", |
"Data": "float width;int flags; float blendw; int power;", |
596 |
"Params": "float width, int flags, float blendw, int power", |
"Params": "float width, int flags, float blendw, int power", |