Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
viewportcamera.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include "viewportcamera.h"
12#include "gui.h"
13#include <math.h>
14#include <glcomp/glcompbutton.h>
15#include <glcomp/glcomplabel.h>
16#include <glcomp/glcomppanel.h>
17#include <util/alloc.h>
18
20 return gv_alloc(sizeof(viewport_camera));
21}
22
25 vi->camera_count + 1,
26 sizeof(viewport_camera*));
27 vi->camera_count++;
29 vi->active_camera = vi->camera_count - 1;
30 return vi->cameras[vi->camera_count - 1];
31}
32
34{
36 /*add test cameras */
38 c->targetx = view->panx;
39 c->targety = view->pany;
40 c->targetz = view->panz;
41 c->x = view->panx;
42 c->y = view->pany;
43 c->z = view->zoom;
44
45 c->r = view->zoom * -1;
46}
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
Definition alloc.h:73
static void * gv_alloc(size_t size)
Definition alloc.h:47
ViewInfo * view
Definition viewport.c:37
float pany
Definition smyrnadefs.h:256
size_t camera_count
Definition smyrnadefs.h:306
float panx
Definition smyrnadefs.h:255
viewport_camera ** cameras
Definition smyrnadefs.h:305
float zoom
Definition smyrnadefs.h:258
float panz
Definition smyrnadefs.h:257
size_t active_camera
<number of cameras
Definition smyrnadefs.h:307
static viewport_camera * add_camera_to_viewport(ViewInfo *vi)
static viewport_camera * new_viewport_camera(void)
void menu_click_add_camera(void)