smntc
an in-memory multimodal graph database
Loading...
Searching...
No Matches
Shape.c
Go to the documentation of this file.
1#include "errors.h"
2#include "Shape.h"
3#include "Colors.h"
4#include "Graph.h"
5#include "Frame.h"
6
7struct Frame Shape_addFrame(const struct Shape *this, int *error)
8{
9 unsigned int vertex = Graph_addVertex(this->graph, error);
10
11 if (*error) {
12 struct Frame frame = {0};
13 return frame;
14 }
15
16 Graph_addEdge(this->graph, this->vertex, vertex, error);
17
18 if (*error) {
19 struct Frame frame = {0};
20 return frame;
21 }
22
23 struct Frame frame = {
24 .vertex = vertex,
25 .graph = this->graph,
26 .colors = this->colors
27 };
28
29 return frame;
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 Frame Shape_addFrame(const struct Shape *this, int *error)
Definition Shape.c:7
Definition Frame.h:6
struct Graph * graph
Definition Frame.h:8
struct Colors * colors
Definition Frame.h:9
unsigned int vertex
Definition Frame.h:7
Definition Shape.h:8