本文整理汇总了C++中D_PAD::Draw3D方法的典型用法代码示例。如果您正苦于以下问题:C++ D_PAD::Draw3D方法的具体用法?C++ D_PAD::Draw3D怎么用?C++ D_PAD::Draw3D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类D_PAD
的用法示例。
在下文中一共展示了D_PAD::Draw3D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: glColorMaterial
void MODULE::Draw3D(Pcb3D_GLCanvas * glcanvas)
/*********************************************/
{
D_PAD * pad = m_Pads;
#if 0
if( ! DisplayOpt.Show_Modules_Cmp )
{
if(m_Layer == CMP_N) return;
}
if( ! DisplayOpt.Show_Modules_Cu )
{
if(m_Layer == CUIVRE_N) return;
}
#endif
/* Draw pads */
glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
glNormal3f( 0.0, 0.0, 1.0); // Normal is Z axis
for( ; pad != NULL; pad = (D_PAD*) pad->Pnext )
{
pad->Draw3D(glcanvas);
}
/* Draw module shape: 3D shape if exists (or module edge if not exists)*/
Struct3D_Master * Struct3D = m_3D_Drawings;
bool As3dShape = FALSE;
glPushMatrix();
glTranslatef(m_Pos.x * g_Parm_3D_Visu.m_BoardScale,
-m_Pos.y * g_Parm_3D_Visu.m_BoardScale,
g_Parm_3D_Visu.m_LayerZcoord[m_Layer] );
if ( m_Orient )
{
glRotatef( (double)m_Orient / 10, 0.0, 0.0, 1.0 );
}
if ( m_Layer == CUIVRE_N )
{
glRotatef( 180.0, 0.0, 1.0, 0.0 );
glRotatef( 180.0, 0.0, 0.0, 1.0 );
}
DataScale3D = g_Parm_3D_Visu.m_BoardScale*UNITS3D_TO_UNITSPCB;
for ( ; Struct3D != NULL; Struct3D = (Struct3D_Master *) Struct3D->Pnext )
{
if ( ! Struct3D->m_Shape3DName.IsEmpty() )
{
As3dShape = TRUE;
Struct3D->ReadData();
}
}
glPopMatrix();
if ( ! As3dShape)
{
EDA_BaseStruct * Struct = m_Drawings;
glNormal3f( 0.0, 0.0, 1.0); // Normal is Z axis
for( ;Struct != NULL; Struct = Struct->Pnext )
{
switch( Struct->m_StructType )
{
case TYPETEXTEMODULE:
break;
case TYPEEDGEMODULE:
((EDGE_MODULE *) Struct)->Draw3D(glcanvas);
break;
default: break;
}
}
}
}