// Declaration of Part Class for SiC Blanket

#ifndef PART_H
#define PART_H
class Part

{ private:

// Part Identity
   string partid;
   
// Geometrical Data
// ... reference points and connectors ...

   int 		num_ref_pts_inner, 		num_ref_pts_outer;
   int 		resolution_inner[100], 	resolution_outer[100];
   double 	ref_pts_inner[100][2], 	ref_pts_outer[100][2];
   string 	connectors_inner[100], 	connectors_outer[100];
   double 	plane_delta[10], 		normal_delta[10];
   
// ... contours ...
   int 		len_ctr_inner, len_ctr_outer;
   double 	(*contour_inner)[2];
   double 	(*contour_outer)[2];
   double 	*depth_inner, *depth_outer;
   
// ... spatial integrals ...
   double 	part_volume;
   double 	enclvol; // LCC added
   double 	surface_area_inner, surface_area_outer;
   double 	perimeter_inner, perimeter_outer;
   
// Material Data
   int 		len_material;
   string 	material_name[50];
   double 	material_density[50];
   double 	material_cost_unit_mass[50];
   int 		material_cost_base[50];
   double 	density_fraction[50];
   double 	volume_fraction[50];
   double 	total_mass;
   double 	mass_of_liquid_metal;
   double 	partial_cost[50];
   double 	total_cost;
   string   material_description[50]; // more lengthy decription of material
//   string   purpose[50];     // purpose, place of use

public:

// Functions that Operate on Data
// ... Contour Descriptions by Reference Points and Connectors ...

   void get_contour_descriptions(int ptsi, int ptso,
                                 int resi[100], int reso[100],
                                 double refi[100][2], double refo[100][2],
                                 string coni[100], string cono[100]);
   void get_name(string id);
   string name();
   void get_contour_size(int lenctr, string flag);
   void get_contours(double c_in[][2], double  c_out[][2], double z_in[], double z_out[]);
   void get_depth(double z_in[], double z_out[]);
   double bounding_box(int bx, string flag);
   double bounding_box_equatorial(int bx, string flag);
   double contour(int num, int coord, string flag);
   double reference_point(int num, int coord, string flag);
   int contour_size(string flag);
   
// ... Connectors ...
   void connector_line(int ref_start, int con_start, int con_end, string con_id);
   void connector_circle(double xcen, double ycen, int ref_start, int con_start,
                         int con_end, string con_id);
   void connector_target_curve(double target[10000][2], int targlen,
                               int ref_start, int con_start,
                               int * con_end, string con_id);
   void connect(double center_inner[100][2], double center_outer[100][2],
                double target[10000][2], int targlen);
   void disentangle(int * n, string cflag);
   int intersect(double x1s, double y1s, double x1e, double y1e,
                 double x2s, double y2s, double x2e, double y2e,
                 double * xint, double * yint, double bigreal);
                  
// Spatial Integrals
   void 	get_volume();
   double 	volume();
   void 	get_enclosed_volume(double enclosed_volume); // LCC added
   double 	enclosed_volume(); // LCC added
   void 	add_to_volume(double extra);
   void 	get_shell_volume(double thickness);
   void 	get_surface_areas();
   double 	surface_area(string con_id);
   void 	get_perimeters();
   double 	perimeter(string con_id);
   
// Cross Sections
   void 	get_cross_section(int ncs, double pd, double nd);
   double 	cross_section_width(int ncs);
   double 	cross_section_depth(int ncs);
   
// Material and Cost Operators
   void 	get_number_of_material_components(int num);
   void 	get_material_component(string matname, double vfrac, double denfrac, int matn);
   string	description(string matname); // LCC added
   double 	density(string matname);
   double 	cost_unit_mass(string matname);
   int 		cost_base(string matname);
   void 	get_cost(int baseYear);
   void 	get_sub_cost(int count, double cost);
   void 	get_mass();
   void 	add_to_cost(double extra);
   void 	add_to_mass(double extra);
   double 	cost();
   double 	sub_cost(int count);
   double 	mass();
   int      number_material_components();
   string 	material_composition();
   string 	part_components(int num); // LCC added
   string   part_printout(); // LCC added
   double 	inflation(int yearFrom, int yearTo);
   double 	liquid_metal_mass();
   
// Display Data
   void show();
   
// Part Destructor
   ~Part()
   { delete [] contour_inner;
     delete [] contour_outer;
     delete [] depth_inner;
     delete [] depth_outer; }
};

#endif
