本文整理汇总了C++中ImpressionistDoc::getLineSize方法的典型用法代码示例。如果您正苦于以下问题:C++ ImpressionistDoc::getLineSize方法的具体用法?C++ ImpressionistDoc::getLineSize怎么用?C++ ImpressionistDoc::getLineSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImpressionistDoc
的用法示例。
在下文中一共展示了ImpressionistDoc::getLineSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BrushBegin
void ScatteredLinesBrush::BrushBegin(const ImpBrush::Point source, const ImpBrush::Point target)
{
ImpressionistDoc* pDoc = GetDocument();
ImpressionistUI* dlg=pDoc->m_pUI;
int dWidth = pDoc->getLineSize();
glLineWidth((float)dWidth);
BrushMove( source, target );
}
示例2: BrushMove
void LineBrush::BrushMove( const ImpBrush::Point source, const ImpBrush::Point target )
{
ImpressionistDoc* pDoc = GetDocument();
ImpressionistUI* dlg=pDoc->m_pUI;
if ( pDoc == NULL ) {
printf( "LineBrush::BrushMove document is NULL\n" );
return;
}
int size = pDoc->getSize();
int width = pDoc->getLineSize();
int angle = pDoc->getLineAngle();
int direction = pDoc->getStrokeDirection();
if(direction == STROKE_DIRECTION_GRADIENT)
{
//
// Use sobel gradient
//
angle = SobelGradient(source);
}
GLint Ax,Ay,Bx,By,Qx,Qy;
//
// Compute Line points
//
Ax = target.x - (.5*size);
Bx = target.x + (.5*size);
Ay = target.y;
By = target.y;
//
// Translate, Rotate, Translate
//
glPushMatrix();
glTranslatef(target.x, target.y, 0);
glRotatef (angle, 0.0, 0.0, 1.0);
glTranslatef(-target.x, -target.y, 0);
SetColor( source );
glBegin( GL_LINES );
glVertex2i( Ax, Ay );
glVertex2i( Bx, By );
glEnd();
glPopMatrix();
}
示例3: BrushMove
void ScatteredLinesBrush::BrushMove(const ImpBrush::Point source, const ImpBrush::Point target)
{
// Get the basic pointers to document and UI.
ImpressionistDoc* pDoc = GetDocument();
ImpressionistUI* dlg=pDoc->m_pUI;
// Draw Random Lines
m_ccount >= INT_MAX ? m_ccount = 0 : m_ccount++;
srand(time(NULL) + m_ccount);
ImpBrush::Point temp_point;
GLint total_lines = 4;
GLint A1x, A2x, AxMid, A1y, A2y, Ox, Oy;
if ( pDoc == NULL ) {
printf( "SingleLineBrush::BrushMove document is NULL\n" );
return;
}
// Get the size, width, angle, and direction of the stroke
int dSize = pDoc->getSize();
int dWidth = pDoc->getLineSize();
int dAngle = pDoc->getLineAngle();
int dDirection = pDoc->getStrokeDirection();
// Overwrite stroke if GRADIENT chosen
if (dDirection == STROKE_DIRECTION_GRADIENT)
{
dAngle = SobelGradient(source);
}
// Compute Line Points
Ox = target.x - (.5 * dSize);
Oy = target.y - (.5 * dSize);
GLint rand_lines = rand() % total_lines + 1;
for (int i = 0; i < rand_lines; i++)
{
// Get Y first
A1y = rand() % dSize + Oy;
A2y = A1y;
// Get X1 and X2 ( start and end lines )
A1x = rand() % dSize + Ox;
A2x = A1x + dSize;
AxMid = .5*(A1x + A2x);
temp_point.x = source.x + (AxMid - target.x);
temp_point.y = source.y + (A1y - target.y);
SetColor(temp_point);
// Translate, Rotate, Translate
glPushMatrix();
glTranslatef(target.x, target.y, 0);
glRotatef(dAngle, 0.0, 0.0, 1.0);
glTranslatef(-target.x, -target.y, 0);
glBegin(GL_LINES);
glVertex2i(A1x, A1y);
glVertex2i(A2x, A2y);
glEnd();
glPopMatrix();
}
}