WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
Connection.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) ATTX INC 2025. All Rights Reserved.
3 *
4 * This software and associated documentation (the "Software") are the
5 * proprietary and confidential information of ATTX INC. The Software is
6 * furnished under a license agreement between ATTX and the user organization
7 * and may be used or copied only in accordance with the terms of the agreement.
8 * Refer to 'license/attx_license.adoc' for standard license terms.
9 *
10 * EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11 * INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12 * REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13 * transmitted in any form or by any means, for any purpose, without the express
14 * written permission of ATTX INC.
15 ******************************************************************************/
16#ifndef CPP_APP_CONNECTION_H
17#define CPP_APP_CONNECTION_H
18
19#include <array>
20#include <string>
21#include <vector>
22
23#include "nlohmann/json.hpp"
24
26
27namespace warptwin {
30 PARAM = -1, // One-off input value set on startup
31 INPUT = -2, // Input to be set regularly (mapped to upstream source typically)
32 LOG = -3, // Input specifically marked as logging for multiple inputs
33 ALL_INPUT = -4, // Special value to indicate all inputs to a node
34 OUTPUT = 1 // Output
35};
36
51
53const std::vector<std::pair<connection_type_e, std::string>> INPUT_CONN_TYPES = {
55
57struct Connection {
59 std::string name;
60
63
66
69
71 std::array<unsigned int, 2> size;
72
74 std::vector<std::vector<std::string>> values;
75
78
81
83 std::vector<long> log_connection_ids;
84
87
90
92 std::string displayname;
93
95 std::string description;
96
99 void fromJson(const nlohmann::json &j);
100
103 nlohmann::json toJson();
104
106 void dump();
107};
108
109} // namespace warptwin
110
111#endif
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
gui_data_types_e
Type definition for valid connections in the warptwin GUI.
Definition Connection.h:38
@ FRAME_PTR
Definition Connection.h:44
@ UNDEFINED
Definition Connection.h:45
@ QUATERNION
Definition Connection.h:43
@ NUMERIC
Definition Connection.h:39
@ STD_VECTOR
Definition Connection.h:49
@ VECTOR3
Definition Connection.h:42
@ POINTER
Definition Connection.h:41
@ MATRIX
Definition Connection.h:46
@ TIME
Definition Connection.h:48
@ STRING
Definition Connection.h:40
@ ARRAY
Definition Connection.h:47
connection_type_e
Hold acceptable values for connection type.
Definition Connection.h:29
@ LOG
Definition Connection.h:32
@ ALL_INPUT
Definition Connection.h:33
@ OUTPUT
Definition Connection.h:34
@ INPUT
Definition Connection.h:31
@ PARAM
Definition Connection.h:30
const std::vector< std::pair< connection_type_e, std::string > > INPUT_CONN_TYPES
Hold all connection type enum values to loop through.
Definition Connection.h:53
Hold all information related to a connection point in the ImGUI UX.
Definition Connection.h:57
int writable
Boolean indicating whether the connection is writable (true) or not (false).
Definition Connection.h:77
std::string displayname
GUI display name of the connection.
Definition Connection.h:92
gui_data_types_e data_type
The data type associated with the connection.
Definition Connection.h:68
int user_set
Flag to indicate whether user has set this value via the GUI.
Definition Connection.h:89
long unique_id
The unique ID of the connection given by the ImGUI UX or other.
Definition Connection.h:62
std::vector< std::vector< std::string > > values
The values held within the connection. All values are stored as string.
Definition Connection.h:74
long paired_connection_id
The connection to which this connection is paired, given by unique ID.
Definition Connection.h:80
connection_type_e connection_type
The type of connection.
Definition Connection.h:65
long parent_node_id
The parent to this connection, given by its unique ID number.
Definition Connection.h:86
std::array< unsigned int, 2 > size
The size of the connection as rows, columns.
Definition Connection.h:71
void dump()
Output all connection information.
Definition Connection.cpp:84
void fromJson(const nlohmann::json &j)
Create Connection object from json.
Definition Connection.cpp:21
nlohmann::json toJson()
Create json object from Connection.
Definition Connection.cpp:55
std::string description
Description of the connection parsed from warptwin files.
Definition Connection.h:95
std::string name
The name of the connection.
Definition Connection.h:59
std::vector< long > log_connection_ids
Store multiple inputs for logging connections that allow it.
Definition Connection.h:83