/*
// Do Not Remove this Comment:
//
// MESSAGES™ by XPLICIT COMPUTING, INC
// GOOGLE PROTOCOL BUFFER 3 DEFINITIONS
//
// Copyright 2020-2023 Xplicit Computing, Inc.
//
// Please see file README.md for usage and license info. README.md must be copied along
// with these *.proto as part of the license agreement. Direct questions or concerns to:
// info@xplicitcomputing.com
//
// SPDX-License-Identifier: BSD-3-Clause
// OSI-License-URL: https://opensource.org/licenses/BSD-3-Clause
*/



syntax = "proto3";

package Messages;

import "vector.proto";
import "spatial.proto";



message GraphicsControl                                                                            
{
    uint32 mode = 1;                                                                                    // render program enumeration: 0-explicit raster, 1-implicit raster, 2-explicit ray, 3-implicit ray
    uint32 style = 2;                                                                                   // bitfield flags, see common/style.h
    //reserved
    repeated float color = 4;
    float alpha = 5;
    float point_width = 6;
    float line_width = 7;   
    //reserved
    bool visible = 10;
    //reserved
}


message Representation
{
    string property_key = 1;
    uint32 color_map = 2;
    uint32 component = 3;
    bool auto_range = 4;
    bool use_default_key = 5;
    bool color_out_of_range = 6;
    bool use_magnitude = 7;
    //
    float displacement_multiplier = 9;
    repeated float range = 10;
    //reserved
}


message Visual
{
    Zone region = 1;
    GraphicsControl control = 2;
    Representation representation = 3;
    //reserved
    repeated uint32 points = 5;
    repeated uint32 lines = 6;
    repeated uint32 triangles = 7;
    repeated uint32 indices_per_element = 8;                                                            // only used on composite elements (e.g. QUAD4 represented using triangles)
    repeated uint32 elements_to_indices = 9;                                                            // only used on composite elements (e.g. QUAD4 represented using triangles)
    repeated uint32 indices_to_elements = 10;                                                           // only used on composite elements (e.g. QUAD4 represented using triangles)
    repeated Vector32 extras = 15;                                                                      // optional data such as displacement vectors and positions (if not nodal positions)
}


message Meta                                                                                            // metaobject backbone -- created and staged in server visuals (for transmission) to populate client metaobjects
{
    string name = 1;                                                                                    // unique identifier that persists between sessions
    int64 uid = 2;                                                                                     // unique id for each system assigned, valid only within a given session
    string directory = 3;
    string symbol = 4;    
    string owner = 5;
    string comments = 6;
    string series = 7;
    string sys_info = 8;
    string geom_info = 9;
    int64 parent = 10;
    int64 created = 11;                                                                                // unix time
    int64 saved = 12;
    int64 modified = 13;
    uint64 iteration = 14;
    uint64 save_interval = 15;
    bool enabled = 16;
    bool locked = 17;
    bool auto_save = 18;
    bool lightweight = 19;
    Revision revision = 20;
    Revision version = 21;  
    Extrema bounds = 22;
    string url = 23;
    GraphicsControl appearance = 24;
    repeated int64 children = 25;                                                                       // uid's (only good within a given session. see concept.proto for persistent relationships)
    repeated int32 groups = 26;                                                                         // region id's
    repeated int32 loops = 27;                                                                          // region id's
    repeated int32 surfaces = 28;                                                                       // region id's
    repeated int32 volumes = 29;                                                                        // region id's
    repeated double global_transform = 30;                                                              // double16 (glm::dmat4) global transformation matrix
    repeated double global_rate = 31;                                                                   // double16 (glm::dmat4) global transformation matrix
    repeated double global_accel = 32;                                                                  // double16 (glm::dmat4) global transformation matrix
    repeated string properties = 33;                                                                    // serialized property-keys, used to request Vector32 or Vector64 data
    repeated Visual media = 34;                                                                         // optional visual media populated by server
    repeated float symbol_transform = 35;
    //reserved
    uint32 length_units = 40;                   // 0-7: mm, cm, m, km, in, ft, yd, mi (defined in common/space.h)                                                                     // as defined in common/space.hpp: mm=0, cm=1, m=2, km=3, in=4, ft=5, yd=6, mi=7
}


message SliceControl                                                                                    // deprecated - will utilize Variables message moving forward
{
    string name = 1;
    repeated double center = 2;
    repeated double normal = 3;
    bool intersect = 4;
    bool negative = 5;
    bool positive = 6;
}


message CameraControl
{
    repeated float subject = 1;					//global position of interest that is being tracked, xyz of length 3
    repeated float offset = 2;					//global offset that camera might be centered on, dydxdz of length 3
    repeated float angle = 3;					//viewer/camera angle, of length 3 (6 for future stereoscopic)
    float scene_time = 4;
    float magnification = 5;
    float time_constant = 6;
    float pan_sensitivity = 7;
    float rotation_sensitivity = 8;
    float zoom_sensitivity = 9;
    float znear = 10;
    float zfar = 11;
    float aov = 12;                                                                                     // angle of view of focal lens (perspective mode)
    repeated uint32 resolution = 13;
    //reserved
    bool perspective = 15;
    bool smooth = 16;
    bool orbit = 17;
    bool follow = 18;
}
