smntc
an in-memory multimodal graph database
Loading...
Searching...
No Matches
Scene.c
Go to the documentation of this file.
1#include "errors.h"
2#include "Scene.h"
3#include "Graph.h"
4#include "Shape.h"
5#include "Colors.h"
6
7struct Shape Scene_addShape(const struct Scene *this, int *error)
8{
9 unsigned int vertex = Graph_addVertex(this->graph, error);
10
11 if (*error) {
12 struct Shape shape = {0};
13 return shape;
14 }
15
16 Graph_addEdge(this->graph, this->vertex, vertex, error);
17
18 if (*error) {
19 struct Shape shape = {0};
20 return shape;
21 }
22
23 struct Shape shape = {
24 .vertex = vertex,
25 .graph = this->graph,
26 .colors = this->colors
27 };
28
29 return shape;
30}
void Graph_addEdge(struct Graph *this, unsigned int source, unsigned int target, int *error)
It adds a directed edge from a source vertex to a target vertex.
Definition Graph.c:298
unsigned int Graph_addVertex(struct Graph *this, int *error)
It adds a vertex into a graph storage.
Definition Graph.c:136
struct Shape Scene_addShape(const struct Scene *this, int *error)
Definition Scene.c:7
Definition Scene.h:7
Definition Shape.h:8
struct Colord * colors
Definition Shape.h:11
struct Graph * graph
Definition Shape.h:10
unsigned int vertex
Definition Shape.h:9