本文整理汇总了C++中ImpressionistDoc::getDensity方法的典型用法代码示例。如果您正苦于以下问题:C++ ImpressionistDoc::getDensity方法的具体用法?C++ ImpressionistDoc::getDensity怎么用?C++ ImpressionistDoc::getDensity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImpressionistDoc
的用法示例。
在下文中一共展示了ImpressionistDoc::getDensity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BrushMove
void CsprayBrush::BrushMove( const Point source, const Point target )
{
ImpressionistDoc* pDoc = GetDocument();
ImpressionistUI* dlg=pDoc->m_pUI;
if ( pDoc == NULL ) {
printf( "CsprayBrush::BrushMove document is NULL\n" );
return;
}
int size = pDoc->getSize();
int density = pDoc->getDensity();
int alpha = pDoc->getAlpha();
glEnable(GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
SetColor( source , alpha);
for (int i = 0;i<density;i++){
float r = rand() %10 ;
r = r*size/10;
oneCircle(target.x+r*cos(6.28*i/density) , target.y+r*sin(6.28*i/density), rand()%3);
}
}
示例2: BrushMove
void SprayBrush::BrushMove( const Point source, const Point target )
{
ImpressionistDoc* pDoc = GetDocument();
ImpressionistUI* dlg=pDoc->m_pUI;
if ( pDoc == NULL ) {
printf( "SprayBrush::BrushMove document is NULL\n" );
return;
}
int size = pDoc->getSize();
int density = pDoc->getDensity();
int alpha = pDoc->getAlpha();
glEnable(GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
for (int i = 0; i<density; i++)
{
glPointSize( rand()%5+1 );
glBegin( GL_POINTS );
SetColor( source , alpha );
glVertex2d( target.x - size/2 + rand()%size, target.y -size/2 + rand()%size);
glEnd();
}
}