// Copyright 2025, ANSYS Inc. Unauthorized use, distribution or duplication is prohibited.
syntax = "proto3";
package ansys.api.discovery.v0.conditions.gravity;

import "ansys/api/dbu/v0/dbumodels.proto";
import "ansys/api/discovery/v0/conditions/condition.proto";
import "ansys/api/discovery/v0/discoverymodels.proto";

option csharp_namespace = "Ansys.Api.Discovery.V0.Conditions";

service Gravity
{
  //Gravity condition methods
  //No create for gravity, it's done automatically, and always applied to all bodies
  rpc ChangeGravityOrientation(ChangeDirectionRequest) returns(ChangeResponse);

  rpc ChangeGravityDX(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeGravityDY(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeGravityDZ(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeGravityTranslationalMagnitude(ChangeQuantityRequest) returns (ChangeResponse);

  rpc ChangeGravityUseBuoyancyEnabled(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeGravityIncludeSelfWeightEnabled(ChangeBooleanRequest) returns (ChangeResponse);
  rpc GetByLabel(ansys.api.discovery.v0.conditions.GetByLabelRequest) returns (GravityDefinition);
}

// Gravity condition definitions
message GravityProperties {
  VectorOfOptionalQuantities acceleration = 1;
  bool include_buoyancy = 2;
  bool include_self_weight = 3;
}

message GravityDefinition {
  ansys.api.dbu.v0.PhysicsEntityIdentifier id = 1;
  ansys.api.dbu.v0.PhysicsEntityIdentifier parent_id = 2;
  string label = 3;
  repeated string locations = 4;
  bool suppressed = 5;
  GravityProperties gravity = 6;
}

