Esempio n. 1
0
/*
 * Show the selected color of the appropiate line or page 
 */
void
nxt_to_show(int toscroll)
{
	int obj;
	
	open_vwork();
	
	/* if current color is not shown, page accordingly to show it */ 
	if (curcol < headcol) {							/* page backwards */
		if ((headcol -= toscroll) < 0)	/* update color to start with */
			headcol = 0;	
		draw_boxes();					/* redraw color boxes */
	} else if (curcol >= headcol + MAX_COL_SHOWN) {	/* page forward */
		if ((headcol += toscroll) > numcol - MAX_COL_SHOWN)
			headcol = numcol - MAX_COL_SHOWN;
		draw_boxes();					/* redraw color boxes */
	}
	
	/* deselect previous color and select current one */
	obj = curcol - headcol + headbox;
	if (obj != curbox) {
		outline(curbox, DEHILITE);
		outline(obj, HILITE);
		curbox = obj;			/* update current box selected */
	}
	
	/* update color # and RGB sliders */		
	curslid = COLSLID;
	slidtext();				/* update color # */
	if (bpg)				/* if there is color */
		update_rgb(1);		/* update and draw RGB gun values */
		
	close_vwork();
}
Esempio n. 2
0
void print_var(struct var_struct * p)
{
    int i,j;
    char buf[1000];
    snprintf(buf, 1000, "%s =\n", p->name);
    outline(buf);
    if(!p->p) {
        outline("null\n");
        return;
    }
    else if(is_single_var(p)) {
        if(fabs(**(p->p))>1e7||fabs(**(p->p))<1e-3)
            snprintf(buf, 1000, "%le\n", **(p->p));
        else
            snprintf(buf, 1000, "%lf\n", **(p->p));
        outline(buf);
        return;
    }
    for(i=0;i<p->height;i++){
        if(i==0) outline("[");
        else outline(" ");
        for(j=0;j<p->width;j++) {
            if(fabs(p->p[i][j])>1e7||fabs(**(p->p))<1e-3)
                snprintf(buf, 1000, "%le", p->p[i][j]);
            else
                snprintf(buf, 1000, "%lf", p->p[i][j]);
            outline(buf);
            if(j<p->width-1) outline(" ");
        }
        if(i==p->height-1) outline("]");
        outline("\n");
    }
}
Esempio n. 3
0
static void outprodgroup( PSYMBOL s ) { /* put out all rules with s on LHS */
	PPRODUCTION p;
	PELEMENT e;
	PSYMBOL ss;

	outline();
	outsymbol( s );
	outchar( ' ' );
	barcol = getoutcol() + 1; /* remember indent for next rule */
	outstring( RULESYM );
        contcol = getoutcol() + 1; /* remember indent for continuation */

	/* output first production on same line */
	p = s->data;
	outprod( p );

	while (p->next != NULL) { /* output successive productions */
		p = p->next;
		
		outline();
		outspaces( barcol );
		outstring( "| " );

		outprod( p );
	}

	if (s->starter != NULL) { /* output start set */
		outline();
		outchar( COMMENT );
		outstring( " start set:  " );
        	contcol = getoutcol() + 1; /* remember indent */

		for (e = s->starter; e != NULL; e = e->next) {
			ss = e->data;
			outspacesym( ss, contcol, COMMENT );
			outsymbol( ss );
		}
	}
	if (s->follows != NULL) { /* output follow set */
		outline();
		outchar( COMMENT );
		outstring( " follow set: " );
        	contcol = getoutcol() + 1; /* remember indent */

		for (e = s->follows; e != NULL; e = e->next) {
			ss = e->data;
			outspacesym( ss, contcol, COMMENT );
			outsymbol( ss );
		}
	}
	if ((s->follows != NULL) || (s->starter != NULL)) {
		/* output blank line to separate from the next rule */
		outline();
	}
}
Esempio n. 4
0
void BoxStyle::unoptimizedPaint(QPainter* painter, int xOffset, int yOffset, int contentBoxWidth,
				int contentBoxHeight) const
{
	qreal x = xOffset;
	qreal y = yOffset;

	int outlineWidth = outline_.style()!=Qt::NoPen ? outline_.width() : 0;
	// Move the figure when using antialiasing. The outline will start at a pixel boundary. This makes it sharper.
	if ( painter->testRenderHint(QPainter::Antialiasing) || painter->testRenderHint(QPainter::HighQualityAntialiasing) )
		if ( outline().style() != Qt::NoPen)
		{
			x = xOffset + outlineWidth/2.0;
			y = yOffset + outlineWidth/2.0;
		}

	// Draw shadow
	if ( shadow() != Qt::NoBrush )
	{
		painter->setPen(Qt::NoPen);
		painter->setBrush(shadow());
		painter->drawPath(getRectanglePath(xOffset + xShadowOffset(), yOffset + yShadowOffset(),
				contentBoxWidth, contentBoxHeight));
	}

	// Draw box.
	painter->setPen(outline());

	// Set the brush and fix the gradient if needed.
	if ( background().style() == Qt::LinearGradientPattern
			&& background().gradient()->coordinateMode() == QGradient::LogicalMode )
	{
		QLinearGradient g = *(static_cast<const QLinearGradient*> (background().gradient()));
		g.setStart(x + g.start().x(), y + g.start().y());
		g.setFinalStop(x + g.finalStop().x(), y + g.finalStop().y());
		painter->setBrush(g);

	}
	else if ( background().style()  == Qt::RadialGradientPattern
			&& background().gradient()->coordinateMode() == QGradient::LogicalMode )
	{
		QRadialGradient g = *(static_cast<const QRadialGradient*> (background().gradient()));
		g.setCenter(x + g.center().x(), y + g.center().y());
		g.setFocalPoint(x + g.focalPoint().x(), y + g.focalPoint().y());
		painter->setBrush(g);
	}
	else
	{
		painter->setBrush(background());
	}

	painter->drawPath(getRectanglePath(x, y, contentBoxWidth - outlineWidth, contentBoxHeight - outlineWidth));
}
QSizeF ArtisticTextShape::size() const
{
    if( m_ranges.isEmpty() )
        return nullBoundBox().size();
    else
        return outline().boundingRect().size();
}
Esempio n. 6
0
Body Collision::create_outline_body(PhysicsWorld &phys_world)
{
	PhysicsContext pc = phys_world.get_pc();

	BodyDescription box_desc(phys_world);
	box_desc.set_type(body_dynamic);
	Body box(pc, box_desc);

	//Setup box fixture description.
	//
	//Outlines shouldn't be too complex. Keep it Under 100 points.
	//If it has more, think about splitting it into couple smaller groups.
	//Then create separate fixtures for the same body.
	CollisionOutline outline("test_outline.out");

	ChainShape outline_shape(phys_world);
	outline_shape.create_loop(outline);

	FixtureDescription fixture_desc2(phys_world);
	fixture_desc2.set_shape(outline_shape);
	fixture_desc2.set_restitution(0.6f);
	fixture_desc2.set_friction(0.001f);
	fixture_desc2.set_density(50.0f);

	Fixture box_fixture(pc, box,fixture_desc2);
	return box;
}
Esempio n. 7
0
void EnhancedPathShape::updatePath(const QSizeF &)
{
    clear();

    foreach (EnhancedPathCommand *cmd, m_commands)
        cmd->execute();

    m_viewBound = outline().boundingRect();

    m_mirrorMatrix.reset();
    m_mirrorMatrix.translate(m_viewBound.center().x(), m_viewBound.center().y());
    m_mirrorMatrix.scale(m_mirrorHorizontally ? -1 : 1, m_mirrorVertically ? -1 : 1);
    m_mirrorMatrix.translate(-m_viewBound.center().x(), -m_viewBound.center().y());

    QTransform matrix;
    matrix.translate(m_viewBoxOffset.x(), m_viewBoxOffset.y());
    matrix = m_mirrorMatrix * m_viewMatrix * matrix;

    KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
    for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
        KoSubpath::const_iterator it((*pathIt)->constBegin());
        for (; it != (*pathIt)->constEnd(); ++it) {
            (*it)->map(matrix);
        }
    }
    const int handleCount = m_enhancedHandles.count();
    QList<QPointF> handles;
    for (int i = 0; i < handleCount; ++i)
        handles.append(matrix.map(m_enhancedHandles[i]->position()));
    setHandles(handles);

    normalize();
}
Esempio n. 8
0
void ArtisticTextShape::paint(QPainter &painter, const KViewConverter &converter)
{
    applyConversion( painter, converter );
    painter.setFont( m_font );
    if ( background() )
        background()->paint( painter, outline() );
}
Esempio n. 9
0
static void draw_player_inventory(GameState* gs, Inventory& inv,
		const BBox& bbox, int min_slot, int max_slot, int slot_selected = -1) {
	int mx = gs->mouse_x(), my = gs->mouse_y();
	int slot = min_slot;
	for (int y = bbox.y1; y < bbox.y2; y += TILE_SIZE) {
		for (int x = bbox.x1; x < bbox.x2; x += TILE_SIZE) {
			if (slot >= max_slot)
				break;

			ItemSlot& itemslot = inv.get(slot);

			BBox slotbox(x, y, x + TILE_SIZE, y + TILE_SIZE);
			Colour outline(COL_UNFILLED_OUTLINE);
			if (itemslot.amount > 0 && slot != slot_selected) {
				outline = COL_FILLED_OUTLINE;
				if (slotbox.contains(mx, my)) {
					outline = COL_PALE_YELLOW;
					draw_console_item_description(gs, itemslot.item);
				}
			}

			if (slot != slot_selected)
				draw_player_inventory_slot(gs, itemslot, x, y);
			//draw rectangle over item edges
			gl_draw_rectangle_outline(slotbox, outline);

			slot++;
		}
	}

	if (slot_selected != -1) {
		draw_player_inventory_slot(gs, inv.get(slot_selected),
				gs->mouse_x() - TILE_SIZE / 2, gs->mouse_y() - TILE_SIZE / 2);
	}
}
Esempio n. 10
0
void PgxEditor::highlightCurrentLine()
{
    QList<QTextEdit::ExtraSelection> extraSelections;

    /*QTextEdit::ExtraSelection selection;
    QColor lineColor = QColor(Qt::yellow).lighter(160);
    selection.format.setBackground(lineColor);
    selection.format.setProperty(QTextFormat::FullWidthSelection, true);
    selection.cursor = textCursor();
    selection.cursor.clearSelection();
    extraSelections.append(selection);*/

    QTextEdit::ExtraSelection border;
    QPen outline(Qt::darkGreen, 2, Qt::SolidLine);
    //outline.setJoinStyle(Qt::RoundJoin);
    //outline.setCapStyle(Qt::RoundCap);
    border.format.setProperty(QTextFormat::OutlinePen, outline);
    border.cursor = textCursor();
    extraSelections.append(border);

    QTextEdit::ExtraSelection back_brush;
    QBrush brush(Qt::yellow);
    back_brush.format.setProperty(QTextFormat::BackgroundBrush, brush);
    back_brush.cursor = textCursor();
    extraSelections.append(back_brush);

    setExtraSelections(extraSelections);
}
Esempio n. 11
0
std::vector<CollisionOutline> Sprite_Impl::create_collision_outlines(GraphicContext &gc, int alpha_limit, OutlineAccuracy accuracy) const
{
	std::vector<CollisionOutline> outlines;
	// Fetch frames

	outlines.reserve(frames.size());

	Texture2D last_texture;
	PixelBuffer texture_pixelbuffer;

	for (unsigned int cnt = 0; cnt < frames.size(); cnt++)
	{
		const SpriteFrame &description_frame = frames[cnt];

		if (last_texture != description_frame.texture)
		{
				last_texture = description_frame.texture;
				texture_pixelbuffer = description_frame.texture.get_pixeldata(gc, tf_rgba8).to_cpu(gc);
		}

		PixelBuffer target(description_frame.position.get_width(), description_frame.position.get_height(), tf_rgba8);
		target.set_subimage(texture_pixelbuffer, Point(0, 0), description_frame.position);

		CollisionOutline outline(target, alpha_limit, accuracy);
		outlines.push_back(outline);

	}
	return outlines;

}
Esempio n. 12
0
void
outrumor(void)
{
	int             rn, i;
	FILE           *rumf;
	if (n_rumors <= n_used_rumors ||
	    (rumf = fopen(RUMORFILE, "r")) == (FILE *) 0)
		return;
	if (n_used_rumors < 0)
		init_rumors(rumf);
	if (!n_rumors)
		goto none;
	rn = rn2(n_rumors - n_used_rumors);
	i = 0;
	while (rn || used(i)) {
		(void) skipline(rumf);
		if (!used(i))
			rn--;
		i++;
	}
	usedbits[i / CHARSZ] |= (1 << (i % CHARSZ));
	n_used_rumors++;
	outline(rumf);
none:
	(void) fclose(rumf);
}
Esempio n. 13
0
static void createAndAppendFontSubMenu(const HitTestResult& result, ContextMenuItem& fontMenuItem)
{
    ContextMenu fontMenu(result);

#if PLATFORM(MAC)
    ContextMenuItem showFonts(ActionType, ContextMenuItemTagShowFonts, contextMenuItemTagShowFonts());
#endif
    ContextMenuItem bold(CheckableActionType, ContextMenuItemTagBold, contextMenuItemTagBold());
    ContextMenuItem italic(CheckableActionType, ContextMenuItemTagItalic, contextMenuItemTagItalic());
    ContextMenuItem underline(CheckableActionType, ContextMenuItemTagUnderline, contextMenuItemTagUnderline());
    ContextMenuItem outline(ActionType, ContextMenuItemTagOutline, contextMenuItemTagOutline());
#if PLATFORM(MAC)
    ContextMenuItem styles(ActionType, ContextMenuItemTagStyles, contextMenuItemTagStyles());
    ContextMenuItem showColors(ActionType, ContextMenuItemTagShowColors, contextMenuItemTagShowColors());
#endif

#if PLATFORM(MAC)
    fontMenu.appendItem(showFonts);
#endif
    fontMenu.appendItem(bold);
    fontMenu.appendItem(italic);
    fontMenu.appendItem(underline);
    fontMenu.appendItem(outline);
#if PLATFORM(MAC)
    fontMenu.appendItem(styles);
    fontMenu.appendItem(*separatorItem());
    fontMenu.appendItem(showColors);
#endif

    fontMenuItem.setSubMenu(&fontMenu);
}
Esempio n. 14
0
void slideRowanMultichoice(u8 index) {
	//task *tasks = (task *) 0x3005090;
	u32 **ptr = (u32**) 0x0203B108;
	u16 *		displace = (u16*) 0x02021BC8;
	u16 arg;
	u16 id;
	u8 current;

	/* Wait message */
	if (check_a_pressed(0)) return;

	arg = tasks[index].args[6];

	if (arg > 0) {
		/* Slide sprite right */
		u16 (*mod)(u8,u32,u8) = (u16 (*)(void)) 0x08001B90 + 1;
		mod(2, 0x200, 2);
		tasks[index].args[6] = arg - 1;
		return;
	}

	/* Show multichoice */

	// Load rbox
	u16 (*func)(u32) = (u16 (*)(void)) 0x08003CE4 + 1;
	//id = func(&info_multichoice);

	// New
	tasks[index].args[0xD] = id;
	u16 (*func2)(u16) = (u16 (*)(void)) 0x8003FA0 + 1;
	func2(id);

	// Draw its border
	int (*outline)(u16, u8, u16, u8) = (int (*)(void)) 0x0810F2E8 + 1;
	outline(id, 1, 0x214, 0xE);

	// Clear the contents
	int (*clear)(u16, u8) = (int (*)(void)) 0x0800445C + 1;
	clear(id, 0x11);

	// Draw strings
	// id, font, x, y, bg_color, fg_color, str
	int (*print)(u16, u8, u8, u8, u32, u32, u32*) = (int (*)(void)) 0x0812E51C + 1;

	print(id, 2, 8, 1, 1, 0, caOptionInfoControls);
	print(id, 2, 8, 0x11, 1, 0, caOptionInfoAdventure);
	print(id, 2, 8, 0x21, 1, 0, caOptionInfoNone);

	// Field
	u8 (*field)(u8, u8) = (u8 (*)(void)) 0x080F79D8 + 1;
	current = field(2, 1);

	// Allow moving the selecty thing
	int (*huh)(u8, u8, u8, u8, u8, u8, u32) = (int (*)(void)) 0x0810F7D8 + 1;
	huh(id, 2, 0, 1, current + 2, 3, 0);

	rboxid_to_vram(id, 3);
	
	tasks[index].function = (u32) handleRowanMultichoice;
}
Esempio n. 15
0
void
ColumnDragState::DrawOutline(float pos)
{
	BRect outline(fTitle->Bounds());
	outline.OffsetBy(pos, 0);
	fTitleView->Draw(fTitleView->Bounds(), true, false, fTitle, _DrawOutline, outline);
}
Esempio n. 16
0
void fileRead(FILE *fdr, FILE *ofdr)
{
	char pattern[64][64];
	char data[512];
	int features[64];
	int count=0, num;
	int x, y, i;

	fseek(fdr, 0, SEEK_END);
	num = ftell(fdr) / 512;
	fseek(fdr, 0, SEEK_SET);

	while (count<num) {
		if (fread(data, 512, 1, fdr) != 1) {
			printf("can't open a file\n");
			exit(2);
		}
		printf("%d文字目\n", count);
		expand(data,pattern);
		noise(pattern, 15);
		smooth(pattern);
		normalize(pattern);
		outline(pattern);
		printpattern(pattern);
		extract(pattern, features);

		output(features, ofdr);
		
		count++;
		// while(getchar()!='\n');
	}
}
Esempio n. 17
0
/********************************************************\
 * Description: scrolls window one line up or down      *
 * Returns:     none                                    *
\********************************************************/
void winscroll(WINS *windows, WINDOW *win, int n, int currentLine)
{
    int row, col;                                       /* row and col        */

    getyx(win, row, col);                               /* get cur row/col    */

    scrollok(windows->hex, TRUE);                       /* allow scrolling    */
    scrollok(windows->ascii, TRUE);
    scrollok(windows->address, TRUE);

    wscrl(windows->hex, n);                             /* scroll each win    */
    wscrl(windows->ascii, n);
    wscrl(windows->address, n);

    scrollok(windows->hex, FALSE);                      /*disable scrolling   */
    scrollok(windows->ascii, FALSE);
    scrollok(windows->address, FALSE);

    wmove(windows->hex, (n == 1) ? MAXY:0, 0);		/* place cursor       */
    wmove(windows->ascii, (n == 1) ? MAXY:0, 0);
    wmove(windows->address, (n == 1) ? MAXY:0, 0);

    outline(fpIN, currentLine);				/* output line        */

    wnoutrefresh(windows->hex);                         /* set win refreshes  */
    wnoutrefresh(windows->ascii);
    wnoutrefresh(windows->address);

    wmove(win, row, col);                               /* restore cursor     */
}
Esempio n. 18
0
void
Subdivider::splitInS( Bin& source, int start, int end )
{
    if( source.isnonempty() ) {
        if( start != end ) {
	    int	i = start + (end - start) / 2;
	    Bin left, right;
	    split( source, left, right, 0, spbrkpts.pts[i] );
	    splitInS( left, start, i );
	    splitInS( right, i+1, end );
        } else {
	    if( start == spbrkpts.start || start == spbrkpts.end ) {
		freejarcs( source );
	    } else if( renderhints.display_method == N_OUTLINE_PARAM_S ) {
		outline( source );
		freejarcs( source );
	    } else {
		setArcTypeBezier();
		setNonDegenerate();
		s_index = start;
		splitInT( source, tpbrkpts.start, tpbrkpts.end );
	    }
        }
    } 
}
Esempio n. 19
0
/*
 * Range search for singlebyte locales using the modified UNIX(R) Regular
 * Expression Library DFA.
 */
static int
rc_range(struct iblok *ip, char *last)
{
	char	*p;
	int	c, cstat, nstat;
	Dfa	*dp = e0->e_exp->re_dfa;

	p = ip->ib_cur;
	lineno++;
	cstat = dp->anybol;
	if (dp->acc[cstat])
		goto found;
	for (;;) {
		if ((nstat = dp->trans[cstat][*p & 0377]) == 0) {
			/*
			 * '\0' is used to indicate end-of-line. If a '\0'
			 * character appears in input, it matches '$' but
			 * the DFA remains in dead state afterwards; there
			 * is thus no need to handle this condition
			 * specially to get the same behavior as in plain
			 * regexec().
			 */
			if ((c = *p & 0377) == '\n')
				c = '\0';
			if ((nstat = regtrans(dp, cstat, c, 1)) == 0)
				goto fail;
			dp->trans[cstat]['\n'] = dp->trans[cstat]['\0'];
		}
		if (dp->acc[cstat = nstat - 1]) {
		found:	for (;;) {
				if (vflag == 0) {
		succeed:		outline(ip, last, p - ip->ib_cur);
					if (qflag || lflag)
						return 1;
				} else {
		fail:			ip->ib_cur = p;
					while (*ip->ib_cur++ != '\n');
				}
				if ((p = ip->ib_cur) > last)
					return 0;
				lineno++;
				if (dp->acc[cstat = dp->anybol] == 0)
					goto brk2;
			}
		}
		if (*p++ == '\n') {
			if (vflag) {
				p--;
				goto succeed;
			}
			if ((ip->ib_cur = p) > last)
				return 0;
			lineno++;
			if (dp->acc[cstat = dp->anybol])
				goto found;
		}
		brk2:;
	}
}
Esempio n. 20
0
void sample() { /* write a sample string generated by grammar */
	outsetup();
	srandom( time( NULL ) );
	if (head != NULL) { /* there is a distinguished symbol */
		outsym( head );
	}
	outline();
}
Esempio n. 21
0
init()	{
	int	a,b,c,x,y,p=0,f;

	dis_partstart();
	tw_opengraph();
	init_copper();
	tw_setpalette(fade1);
	memcpy(palette,hzpic+16,768);

	for(a=0;a<88;a++)
		{
		outline(MK_FP(FP_SEG(hzpic),FP_OFF(hzpic)+a*4+784), MK_FP(0x0a000,a+176*50));
		outline(MK_FP(FP_SEG(hzpic),FP_OFF(hzpic)+a*4+784), MK_FP(0x0a000,a+176*50+88));
		}

	for(y=0;y<32;y++)
	{
		for(a=0;a<1500;a++)
		{
			switch(font[y][a]&3)
			{
			case 0x1 : b=0x40; break;
			case 0x2 : b=0x80; break;
			case 0x3 : b=0xc0; break;
			default : b=0;
			}
			font[y][a]=b;
		}
	}

	for(y=0;y<768;y+=3)
	{
		if(y<64*3)
		{
		palette2[y+0]=palette[y+0];
		palette2[y+1]=palette[y+1];
		palette2[y+2]=palette[y+2];
		}
		else if(y<128*3)
		{
			palette2[y+0]=(fade2[y+0]=palette[0x1*3+0])*63+palette[y%(64*3)+0]*(63-palette[0x1*3+0])>>6;
			palette2[y+1]=(fade2[y+1]=palette[0x1*3+1])*63+palette[y%(64*3)+1]*(63-palette[0x1*3+1])>>6;
			palette2[y+2]=(fade2[y+2]=palette[0x1*3+2])*63+palette[y%(64*3)+2]*(63-palette[0x1*3+2])>>6;
		}
		else if(y<192*3)
void ArtisticTextToolSelection::paint(QPainter &painter, const KoViewConverter &converter)
{
    if (!hasSelection())
        return;

    m_currentShape->applyConversion( painter, converter );
    painter.setPen(Qt::NoPen);
    painter.setBrush(QColor(0, 0, 255, 127));
    painter.drawPath(outline());
}
Esempio n. 23
0
void EnhancedPathShape::saveOdf(KShapeSavingContext &context) const
{
    if (isParametricShape()) {
        context.xmlWriter().startElement("draw:custom-shape");
        saveOdfAttributes(context, OdfAllAttributes&~OdfSize);

        // save the right size so that when loading we fit the viewbox
        // to the right size without getting any wrong scaling
        // -> calculate the right size from the current size/viewbound ratio
        const QSizeF currentSize = outline().boundingRect().size();
        context.xmlWriter().addAttributePt("svg:width", m_viewBox.width()*currentSize.width()/m_viewBound.width());
        context.xmlWriter().addAttributePt("svg:height", m_viewBox.height()*currentSize.height()/m_viewBound.height());

        if (parent())
            parent()->saveOdfChildElements(context);
        
        context.xmlWriter().startElement("draw:enhanced-geometry");
        context.xmlWriter().addAttribute("svg:viewBox", QString("%1 %2 %3 %4").arg(m_viewBox.x()).arg(m_viewBox.y()).arg(m_viewBox.width()).arg(m_viewBox.height()));

        if (m_mirrorHorizontally) {
            context.xmlWriter().addAttribute("draw:mirror-horizontal", "true");
        }
        if (m_mirrorVertically) {
            context.xmlWriter().addAttribute("draw:mirror-vertical", "true");
        }
        
        QString modifiers;
        foreach (qreal modifier, m_modifiers)
            modifiers += QString::number(modifier) + ' ';
        context.xmlWriter().addAttribute("draw:modifiers", modifiers.trimmed());

        QString path;
        foreach (EnhancedPathCommand * c, m_commands)
            path += c->toString() + ' ';
        context.xmlWriter().addAttribute("draw:enhanced-path", path.trimmed());

        FormulaStore::const_iterator i = m_formulae.constBegin();
        for (; i != m_formulae.constEnd(); ++i) {
            context.xmlWriter().startElement("draw:equation");
            context.xmlWriter().addAttribute("draw:name", i.key());
            context.xmlWriter().addAttribute("draw:formula", i.value()->toString());
            context.xmlWriter().endElement(); // draw:equation
        }

        foreach (EnhancedPathHandle * handle, m_enhancedHandles)
            handle->saveOdf(context);

        context.xmlWriter().endElement(); // draw:enhanced-geometry
        saveOdfCommonChildElements(context);
        context.xmlWriter().endElement(); // draw:custom-shape

    } else {
        KPathShape::saveOdf(context);
    }
}
Esempio n. 24
0
void endgame(int points,int mx,int my)
{
        char p[20];
        outline(mx,my);
        itoa(points,p,10);
        setcolor(BLUE);
        settextstyle(DEFAULT_FONT,0,3);
        outtextxy(200,100,"POINTS:");
        outtextxy(400,100,p);
        button("EXIT",300,300);
}
Esempio n. 25
0
void
Subdivider::subdivideInS( Bin& source )
{
    if( renderhints.display_method == N_OUTLINE_PARAM ) {
	outline( source );
	freejarcs( source );
    } else {
	setArcTypeBezier();
	setNonDegenerate();
	splitInS( source, spbrkpts.start, spbrkpts.end );
    }
}
Esempio n. 26
0
void KWOutlineShape::paintDecorations(QPainter &painter, const KViewConverter &converter, const KCanvasBase *canvas)
{
    if (! canvas->shapeManager()->selection()->isSelected(this))
        return;

    applyConversion(painter, converter);

    QPen pen = QPen(canvas->resourceManager()->colorResource(KWord::FrameOutlineColor));
    QPointF onePixel = converter.viewToDocument(QPointF(1, 1));
    pen.setWidthF(onePixel.x());
    painter.strokePath(outline(), pen);
}
IntegratorBaseSparse::IntegratorBaseSparse(int r, double timestep, SparseMatrix * massMatrix_, ForceModel * forceModel_, int numConstrainedDOFs_, int * constrainedDOFs_, double dampingMassCoef, double dampingStiffnessCoef): IntegratorBase(r, timestep, dampingMassCoef, dampingStiffnessCoef), massMatrix(massMatrix_), forceModel(forceModel_), numConstrainedDOFs(numConstrainedDOFs_)
{
    systemSolveTime = 0.0;
    forceAssemblyTime = 0.0;

    constrainedDOFs = (int*) malloc (sizeof(int) * numConstrainedDOFs);
    memcpy(constrainedDOFs, constrainedDOFs_, sizeof(int) * numConstrainedDOFs);

    ownDampingMatrix = 1;
    SparseMatrixOutline outline(r);
    dampingMatrix = new SparseMatrix(&outline);
}
Esempio n. 28
0
File: Car.cpp Progetto: genail/gear
CL_CollisionOutline Car::getCollisionOutline() const
{
	CL_CollisionOutline outline(m_impl->m_phyCollisionOutline);

	// transform the outline
	CL_Angle angle(90, cl_degrees);
	angle += m_impl->m_rotation;

	outline.set_angle(angle);
	outline.set_translation(m_impl->m_position.x, m_impl->m_position.y);

	return outline;
}
Esempio n. 29
0
static void
draw_hidden(Quad quad, int mode)
{
  /* draw the outline using white, optionally fill the interior 
     with black */
  glColor3f(1, 1, 1);
  outline(quad);

  if (mode == HIDDEN_LINE) {
    glColor3f(0, 0, 0);
    fill(quad);
  }
}
Esempio n. 30
0
void
Subdivider::samplingSplit( 
    Bin& source, 
    Patchlist& patchlist, 
    int subdivisions, 
    int param )
{
    if( ! source.isnonempty() ) return;

    if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) {
	freejarcs( source );
	return;
    }

    patchlist.getstepsize();

    if( renderhints.display_method == N_OUTLINE_PATCH ) {
        tessellation( source, patchlist );
	outline( source );
	freejarcs( source );
	return;
    } 

    //patchlist.clamp();

    tessellation( source, patchlist );

    if( patchlist.needsSamplingSubdivision() && (subdivisions > 0) ) {
	if( ! patchlist.needsSubdivision( 0 ) )
	    param = 1;
	else if( ! patchlist.needsSubdivision( 1 ) )
	    param = 0;
	else
	    param = 1 - param;

	Bin left, right;
	REAL mid = ( patchlist.pspec[param].range[0] +
		     patchlist.pspec[param].range[1] ) * 0.5;
	split( source, left, right, param, mid );
	Patchlist subpatchlist( patchlist, param, mid );
	samplingSplit( left, subpatchlist, subdivisions-1, param );
	samplingSplit( right, patchlist, subdivisions-1, param );
    } else {
	setArcTypePwl();
	setDegenerate();
	nonSamplingSplit( source, patchlist, subdivisions, param );
	setDegenerate();
	setArcTypeBezier();
    }
}