本文整理汇总了C++中Patch::SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Patch::SetPosition方法的具体用法?C++ Patch::SetPosition怎么用?C++ Patch::SetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patch
的用法示例。
在下文中一共展示了Patch::SetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Texture
Dial::Dial ( void ) {
thickness = 10.0;
radius = 100.0;
tilt = 30.0;
label_width = 50.0;
Slab *slab;
Disk *disk;
Cylinder *cylinder;
Patch *rectangle;
char path[1024];
sprintf( path, "%s%s", AfdTexturePath, "bmp\\ten.bmp" );
ten_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
sprintf( path, "%s%s", AfdTexturePath, "bmp\\five.bmp" );
five_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
sprintf( path, "%s%s", AfdTexturePath, "bmp\\zero.bmp" );
zero_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
sprintf( path, "%s%s", AfdTexturePath, "bmp\\meters.bmp" );
meters_texture = new Texture( path, label_width * 2.0, label_width / 2.0 );
needle = new Slab( thickness / 4.0, 0.90 * radius, thickness / 2.0 );
needle->SetOffset( 0.0, radius / 2.0, thickness / 2.0 );
needle->SetColor( ORANGE );
AddComponent( needle );
rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
rectangle->SetPosition( radius + label_width / 2.0, 0.0, 0.0 );
rectangle->SetTexture( ten_texture );
AddComponent( rectangle );
rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
rectangle->SetPosition( 0.0, radius + label_width / 2.0, 0.0 );
rectangle->SetTexture( five_texture );
AddComponent( rectangle );
rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
rectangle->SetPosition( - ( radius + label_width / 2.0 ), 0.0, 0.0 );
rectangle->SetTexture( zero_texture );
AddComponent( rectangle );
rectangle = new Patch( 2 * label_width , label_width / 2.0 );
rectangle->SetPosition( 0.0, - radius - label_width / 2.0, 0.0 );
rectangle->SetTexture( meters_texture );
// AddComponent( rectangle );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetOrientation( -18.0, k_vector );
slab->SetColor( BLACK );
AddComponent( slab );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetOrientation( -36.0, k_vector );
slab->SetColor( BLACK );
AddComponent( slab );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetOrientation( -54.0, k_vector );
slab->SetColor( BLACK );
AddComponent( slab );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetOrientation( -72.0, k_vector );
slab->SetColor( BLACK );
AddComponent( slab );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetOrientation( -90.0, k_vector );
slab->SetColor( BLACK );
AddComponent( slab );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetColor( BLACK );
AddComponent( slab );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetOrientation( 18.0, k_vector );
slab->SetColor( BLACK );
AddComponent( slab );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetOrientation( 36.0, k_vector );
slab->SetColor( BLACK );
AddComponent( slab );
slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
slab->SetOrientation( 54.0, k_vector );
slab->SetColor( BLACK );
AddComponent( slab );
//.........这里部分代码省略.........