void MolStyle::setup( BondStyle bondStyle, AtomStyle atomStyle,
double singleBondRadius,
+ bool renderMultipleBonds,
double multipleBondRadius,
double multipleBondShift,
double atomRadiusFactor )
m_bondStyle = bondStyle;
m_atomStyle = atomStyle;
m_singleBondRadius = singleBondRadius;
+ m_renderMultipleBonds = renderMultipleBonds;
m_multipleBondRadius = multipleBondRadius;
m_multipleBondShift = multipleBondShift;
m_atomRadiusFactor = atomRadiusFactor;
s + t * m_blue,
m_alpha };
- glMaterialfv(GL_FRONT, GL_AMBIENT, ambientColor);
- glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuseColor);
- glMaterialfv(GL_FRONT, GL_SPECULAR, specularColor);
- glMaterialf(GL_FRONT, GL_SHININESS, 50.0);
+ glMaterialfv( GL_FRONT, GL_AMBIENT, ambientColor );
+ glMaterialfv( GL_FRONT, GL_DIFFUSE, diffuseColor );
+ glMaterialfv( GL_FRONT, GL_SPECULAR, specularColor );
+ glMaterialf( GL_FRONT, GL_SHININESS, 50.0 );
}
VertexArray::VertexArray( GLenum mode,
double u1 = double(c1) / m_detail;
double u2 = double(c2) / m_detail;
- vector3 v;
- v.SetX( v0->x() + u1 * (v1->x() - v0->x()) + u2 * (v2->x() - v0->x()) );
- v.SetY( v0->y() + u1 * (v1->y() - v0->y()) + u2 * (v2->y() - v0->y()) );
- v.SetZ( v0->z() + u1 * (v1->z() - v0->z()) + u2 * (v2->z() - v0->z()) );
+ vector3 v = *v0 + u1 * ( *v1 - *v0 ) + u2 * ( *v2 - *v0 );
v.normalize();
Vector *vertex =
/** The radius ( = half-thickness ) of single bonds */
double m_singleBondRadius;
+ /** If true, multiple bonds will be rendered as such. If false,
+ * they will be rendered as single bonds */
+ double m_renderMultipleBonds;
/** The radius ( = half-thickness ) of each bond inside a
* multiple bond */
double m_multipleBondRadius;
* the members. */
void setup( BondStyle bondStyle, AtomStyle atomStyle,
double singleBondRadius,
+ bool renderMultipleBonds,
double multipleBondRadius,
double multipleBondShift,
double atomRadiusFactor );
vector3 v3 = ( v1 + v2 ) / 2;
int order;
- if( bond->IsSingle() ) order = 1;
+ if( m_molStyle.m_renderMultipleBonds == false
+ || bond->IsSingle() ) order = 1;
else if( bond->IsDouble() ) order = 2;
else if( bond->IsTriple() ) order = 3;
else
case 0: // sticks-style
m_molStyle.setup( MolStyle::BONDS_USE_ATOMS_COLORS,
MolStyle::ATOMS_USE_FIXED_RADIUS,
- 0.20, 0.06, 0.14, 0.20 );
+ 0.20, false, 0.06, 0.14, 0.20 );
break;
case 1: // atoms: smaller van der Waals, bonds: gray
m_molStyle.setup( MolStyle::BONDS_GRAY,
MolStyle::ATOMS_USE_VAN_DER_WAALS_RADIUS,
- 0.08, 0.08, 0.14, 0.20 );
+ 0.08, true, 0.08, 0.14, 0.20 );
break;
case 2: // atoms: smaller van der Waals, bonds: use atom colors
m_molStyle.setup( MolStyle::BONDS_USE_ATOMS_COLORS,
MolStyle::ATOMS_USE_VAN_DER_WAALS_RADIUS,
- 0.08, 0.08, 0.14, 0.20 );
+ 0.08, true, 0.08, 0.14, 0.20 );
break;
case 3: // atoms: real van der Waals, bonds: disabled
m_molStyle.setup( MolStyle::BONDS_DISABLED,
MolStyle::ATOMS_USE_VAN_DER_WAALS_RADIUS,
- 0.00, 0.00, 0.00, 1.00 );
+ 0.00, false, 0.00, 0.00, 1.00 );
break;
default: break;