// Proto file representing the EDB Path class

syntax = "proto3";

package ansys.api.edb.v1;

import "ansys/api/edb/v1/edb_messages.proto";
import "ansys/api/edb/v1/polygon_data.proto";
import "ansys/api/edb/v1/refs.proto";

enum PathEndCapStyle {
  ROUND = 0;
  FLAT = 1;
  EXTENDED = 2;
  CLIPPED = 3;
  INVALID_END_CAP = -1;
}

enum PathCornerStyle {
  ROUND_CORNER = 0;
  SHARP_CORNER = 1;
  MITER_CORNER = 2;
}

service PathService {
  rpc Create (PathCreationMessage) returns (EDBObjMessage) {}

  // Render Path
  rpc Render (PathRenderMessage) returns (PolygonDataMessage) {}

  // Get Polygon Data
  rpc GetPolygonData (EDBObjMessage) returns (PolygonDataMessage) {}

  // Get Center Line
  rpc GetCenterLine (EDBObjMessage) returns (PolygonDataMessage) {}

  // Set Center Line
  rpc SetCenterLine (SetCenterLineMessage) returns (google.protobuf.Empty) {}
  
  // Get End Cap Style
  rpc GetEndCapStyle (EDBObjMessage) returns (EndCapStyleMessage) {}
  
  // Set End Cap Style
  rpc SetEndCapStyle (SetEndCapStyleMessage) returns (google.protobuf.Empty) {}
  
  // Get Clip Info
  rpc GetClipInfo (EDBObjMessage) returns (ClipInfoMessage) {}
  
  // Set Clip Info
  rpc SetClipInfo (SetClipInfoMessage) returns (google.protobuf.Empty) {}

  // Get Corner Style
  rpc GetCornerStyle (EDBObjMessage) returns (CornerStyleMessage) {}
  
  // Set Corner Style
  rpc SetCornerStyle (SetCornerStyleMessage) returns (google.protobuf.Empty) {}

  // Get Width
  rpc GetWidth (EDBObjMessage) returns (WidthMessage) {}
  
  // Set Width
  rpc SetWidth (SetWidthMessage) returns (google.protobuf.Empty) {}

  // Get Miter Ratio
  rpc GetMiterRatio (EDBObjMessage) returns (MiterRatioMessage) {}
  
  // Set Miter Ratio
  rpc SetMiterRatio (SetMiterRatioMessage) returns (google.protobuf.Empty) {}
}

// Message for Create
message PathCreationMessage {
  EDBObjMessage layout = 1;
  LayerRefMessage layer = 2;
  NetRefMessage net = 3;
  ValueMessage width = 4;
  PathEndCapStyle end_cap1 = 5;
  PathEndCapStyle end_cap2 = 6;
  PathCornerStyle corner = 7;
  PolygonDataMessage points = 8;
}

// Message for Render
message PathRenderMessage {
  ValueMessage width = 1;
  PathEndCapStyle end_cap1 = 2;
  PathEndCapStyle end_cap2 = 3;
  PathCornerStyle corner_style = 4;
  PolygonDataMessage path = 5;
}

// Message for Setting Center Line
message SetCenterLineMessage{
  EDBObjMessage target = 1;
  PolygonDataMessage center_line = 2;
}

// Message for Get EndCapStyle
message EndCapStyleMessage{
  PathEndCapStyle end_cap1 = 1;
  PathEndCapStyle end_cap2 = 2;
}

// Message for Set EndCapStyle
message SetEndCapStyleMessage{
  EDBObjMessage target = 1;
  EndCapStyleMessage end_cap = 2;
}

// Message for Get ClipInfo
message ClipInfoMessage{
  PolygonDataMessage clipping_poly = 1;
  bool keep_inside = 2;
}

// Message for Set ClipInfo
message SetClipInfoMessage{
  EDBObjMessage target = 1;
  PolygonDataMessage clipping_poly = 2;
  bool keep_inside = 3;
}

// Message for Get Corner Style
message CornerStyleMessage{
  PathCornerStyle corner_style = 1;
}

// Message for Set Corner Style
message SetCornerStyleMessage{
  EDBObjMessage target = 1;
  CornerStyleMessage corner_style = 2;
}

// Message for Get Width
message WidthMessage{
  ValueMessage width = 1;
}

// Message for Set Width
message SetWidthMessage{
  EDBObjMessage target = 1;
  WidthMessage width = 2;
}

// Message for Get Miter Ratio
message MiterRatioMessage{
  ValueMessage miter_ratio = 1;
}

// Message for Set Miter Ratio
message SetMiterRatioMessage{
  EDBObjMessage target = 1;
  MiterRatioMessage miter_ratio = 2;
}