// Proto file representing the EDB RTree class

syntax = "proto3";

package ansys.api.edb.v1;

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

service RTreeService {
  rpc Create (google.protobuf.DoubleValue) returns (EDBObjMessage) {}
  
  rpc GetExtent (EDBObjMessage) returns (BoxMessage) {}
  
  rpc InsertIntObject (RTreeObjMessage) returns (google.protobuf.Empty) {}
  
  rpc DeleteIntObject (RTreeObjMessage) returns (google.protobuf.Empty) {}
  
  rpc Empty (EDBObjMessage) returns (google.protobuf.BoolValue) {}
  
  rpc Search (RTreeSearchMessage) returns (IntegersPropertyMessage) {}

  rpc NearestNeighbor(RTreeObjMessage) returns (NearestNeighborResponseMessage) {}

  rpc TouchingGeometry (RTreeGeometryRequestMessage) returns (IntegersPropertyMessage) {}

  rpc ConnectedGeometry(RTreeGeometryRequestMessage) returns (IntegersPropertyMessage) {}

  rpc GetConnectedGeometrySets (EDBObjMessage) returns (GeometrySetsMessage) {}

  rpc IncrementVisit(EDBObjMessage) returns (google.protobuf.Empty) {}

  rpc IsVisited (RTreeObjMessage) returns (google.protobuf.BoolValue) {}

  rpc Visit(RTreeObjMessage) returns (google.protobuf.Empty) {}

  rpc GetVisit(EDBObjMessage) returns (google.protobuf.Int64Value) {}
}

message RTreeObjMessage {
  EDBObjMessage target = 1;
  PolygonDataMessage polygon = 2;
  uint64 prop = 3;
}

message RTreeSearchMessage {
  EDBObjMessage target = 1;
  BoxMessage box = 2;
  bool bb_search = 3;
}

message NearestNeighborResponseMessage {
  uint64 id = 1;
  BoxMessage coordinates = 2;
}

message RTreeGeometryRequestMessage {
  EDBObjMessage target = 1;
  PolygonDataMessage polygon = 2;
  int64 prop = 3;
  bool increment_visit = 4;
}

message GeometrySetsMessage {
  repeated int64 id = 1;
  repeated int64 sizes = 2;
}