Ejemplo n.º 1
0
void El_Window::draw_arrow
     (
         Pt2dr p0, Pt2dr p1, Line_St LAxe, Line_St LPointe,
         REAL size_pointe, REAL pos , REAL teta
     )
{
     draw_seg(p0,p1,LAxe);

     Pt2dr q0 = barry(1-pos,p0,p1);
     Pt2dr dir_pte = Pt2dr::FromPolar(1.0,teta);
     Pt2dr tgt = vunit(p0-p1) * size_pointe;

     draw_seg(q0,q0+tgt*dir_pte,LPointe);
     draw_seg(q0,q0+tgt/dir_pte,LPointe);
}
Ejemplo n.º 2
0
void	draw_vert(t_env e)
{
	t_vect	*tmp;
	t_vect	*tmp2;
	t_coord cord;
	int		a;

	tmp = e.v;
	tmp2 = e.v;
	a = 0;
	while (a <= e.nb_c)
	{
		a++;
		tmp2 = tmp2->next;
	}
	while (tmp && tmp2)
	{
		if (tmp->v_z || tmp2->v_z)
		{
			cord.x = tmp2->v_x;
			cord.y = tmp2->v_y;
			cord.color = 0xFFFFFF;
			draw_seg(e, tmp->v_x + LAR / 2, tmp->v_y + LON / 2, cord);
		}
		tmp = tmp->next;
		tmp2 = tmp2->next;
	}
}
Ejemplo n.º 3
0
void Data_El_Geom_GWin::draw_seg_cliped
(
       Pt2dr p0,
       Pt2dr p1,
       Data_Line_St * lst,
       Box2dr         box,
       bool auto_flush
)
{
   if (_dnext)
      _dnext->draw_seg_cliped(p0,p1,lst,box,auto_flush);

   Seg2d s = Seg2d(p0,p1).clip(box);
   if (! s.empty())
      draw_seg(s.p0(),s.p1(),lst,auto_flush);
}
Ejemplo n.º 4
0
void El_Window::draw_ellipse_loc
     (
     Pt2dr aCentre,REAL A,REAL B,REAL C,Line_St aLst,
         INT Nb
      )
{
   InvertParamEllipse(A,B,C,A,B,C);

   Pt2dr LastP;
   for (INT aK= 0 ; aK<= Nb ; aK++)
   {
        Pt2dr P = aCentre+ImAppSym(A,B,C,Pt2dr::FromPolar(1.0,(aK*2*PI)/Nb));
    if (aK !=0)
           draw_seg(LastP,P,aLst);
    // cout << LastP << P << "\n";
    LastP = P;
   }
}
Ejemplo n.º 5
0
void		boucle_principal(t_bal *bal, t_brick *brick, t_env *e)
{
	t_seg	s;

	while (1)
	{
		if (map_end(e))
			change_map(e);
		if (glfwWindowShouldClose(e->window))
			break ;
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
		draw_bricks(e, brick);
		draw_seg(&s, e);
		if (e->space == 0)
			bal->x1 = e->x_bar + 0.125;
		draw_circle(bal, e);
		draw_barre(e->x_bar, -0.90);
		if (e->space == 1 && e->pauz == 1)
			move_bal(bal, e);
		glfwSwapBuffers(e->window);
		glfwPollEvents();
	}
}
Ejemplo n.º 6
0
void El_Window::draw_poly(const std::vector<Pt2dr> & aV,Line_St aLst,bool isFerm)
{
   int aNb = (int) aV.size();
   for (int aK=0 ; aK<aNb-!isFerm ; aK++)
       draw_seg(aV[aK],aV[(aK+1)%aNb],aLst);
}