Graphviz 12.0.1~dev.20240716.0800
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 <cgraph/alloc.h>
12#include "viewportcamera.h"
13#include "gui.h"
14#include <math.h>
15#include <glcomp/glcompbutton.h>
16#include <glcomp/glcomplabel.h>
17#include <glcomp/glcomppanel.h>
18
19
21 return gv_alloc(sizeof(viewport_camera));
22}
23
26 vi->camera_count + 1,
27 sizeof(viewport_camera*));
28 vi->camera_count++;
30 vi->active_camera = vi->camera_count - 1;
31 return vi->cameras[vi->camera_count - 1];
32}
33
35{
37 /*add test cameras */
39 c->targetx = view->panx;
40 c->targety = view->pany;
41 c->targetz = view->panz;
42 c->x = view->panx;
43 c->y = view->pany;
44 c->z = view->zoom;
45
46 c->r = view->zoom * -1;
47}
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:38
float pany
Definition smyrnadefs.h:273
size_t camera_count
Definition smyrnadefs.h:327
float panx
Definition smyrnadefs.h:272
viewport_camera ** cameras
Definition smyrnadefs.h:326
float zoom
Definition smyrnadefs.h:275
float panz
Definition smyrnadefs.h:274
size_t active_camera
<number of cameras
Definition smyrnadefs.h:328
static viewport_camera * add_camera_to_viewport(ViewInfo *vi)
static viewport_camera * new_viewport_camera(void)
void menu_click_add_camera(void)