From 8b639d8c14e63128d6a608eb2d160561aa1040de Mon Sep 17 00:00:00 2001
From: Thomas Lambert <t.lambert@uliege.be>
Date: Tue, 6 Sep 2022 10:15:46 +0200
Subject: [PATCH] doc(Airfoil): Improve class main documentation

- Use the proper syntax to take advantage of Matlab formatting and links
  in help.
- Add more details and reformulate some stuff.
---
 +af_tools/@Airfoil/Airfoil.m | 76 ++++++++++++++++++++----------------
 1 file changed, 42 insertions(+), 34 deletions(-)

diff --git a/+af_tools/@Airfoil/Airfoil.m b/+af_tools/@Airfoil/Airfoil.m
index 0a0a7ca..33cc5dc 100644
--- a/+af_tools/@Airfoil/Airfoil.m
+++ b/+af_tools/@Airfoil/Airfoil.m
@@ -1,37 +1,43 @@
 classdef Airfoil < handle
-    % AIRFOIL Class for airfoils with all their important data.
-    %   This AIRFOIL class is used to represent completely an airfoil and the important metrics
-    %   attached to it. These data include:
-    %       - the airofil name
-    %       - the airofil full coordinates (in Selig format)
-    %       - the airofil upper surface coordinates
-    %       - the airofil lower surface coordinates
-    %       - a structure containing the original airfoil polars (obtained using xf2mat)
-    %       - a structure containing the extended airfoil polars (obtained using extendpolar)
+    % AIRFOIL Airfoil coordinates and associated polars.
+    %   The Airfoil class is used to represent an airfoil and all important metrics attached to it
+    %   (i.e. its  Polars).
     % -----
     %
-    % Usage:
-    %   Af = AIRFOIL initiates an empty airfoil object.
+    % Airfoil properties:
+    %   name  - Airfoil name
+    %   coord - Airfoil coordinates (in Ledneicer format)
+    %   upper - Airfoil's upper surface coordinates
+    %   lower - Airfoil's lower surface coordinates
+    %   Polar - Handle of the Polar object used to store the airfoil aerodynamic coefficients
     %
-    %   Af = AIRFOIL(coordFile) initiates an airfoil object whose coordinates will be found in
-    %   coordFile. The airfoil name will be retreived automatically from the coordinates file.
+    % Airfoil methods:
+    %   Airfoil            - Constructor
+    %   loadpolar          - Load the airfoil polar (from xfoil or xflr5 data)
+    %   polypolar          - Create polynomial polars
+    %   extendpolar        - Extends the polars over the full range of AOA
+    %   analyze            - Extract all important metrics from the polars
+    %   addextremereynolds - Add virtual polars for Re=0 and Re=1e9 to simplify extrapolation
     %
-    %   Af = AIRFOIL(coordFile, name) initiates an airfoil object whose coordinates will be found in
-    %   coordFile, but using the name given as input.
+    % Airfoil constructor:
+    %   Airfoil() creates an empty object.
     %
-    % Inputs:
-    %   coordFile : Airfoil coordinates, in Selig or Lednicer format (dat-file)
-    %   name      : The name of the airfoil
+    %   Af = Airfoil(coordFile) instantiate an airfoil object whose coordinates will be found in
+    %   'coordFile' (a dat-file). The airfoil name will be retreived automatically from the
+    %   coordinates file.
     %
-    % Example:
-    %   Af = AIRFOIL
-    %   Af = AIRFOIL('data/naca0012.dat')
-    %   Af = AIRFOIL('data/naca0012.dat','NACA 0012')
+    %   Af = Airfoil(coordFile, name) instatiate an airfoil object based on the coordinates in
+    %   'coordFile' and sets the airfoil name to 'name' instead of retreiving it form the dat-file.
     %
-    % See also: XF2MAT, EXTENDPOLAR.
+    % Constructor inputs:
+    %   coordFile : File with the airfoil coordinates, in Selig or Lednicer format (dat-file)
+    %   name      : (optional) Airfoil name
+    %
+    % See also: af_tools.Polar, af_tools.xf2mat, af_tools.extendpolar.
     %
     % <a href="https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox">Documentation (online)</a>
 
+    % TODO, make polar a handle class, remove useless methods from here
     % -------------------------------------------
     % (c) Copyright 2022 University of Liege
     % Author: Thomas Lambert <t.lambert@uliege.be>
@@ -42,16 +48,16 @@ classdef Airfoil < handle
     % ----------------------------------------------------------------------------------------------
 
     properties
-        % Name
-        name
-        % Coordinates (full airfoil, upper and lower surfaces separately)
-        coord
-        upper
-        lower
+        name % Airfoil name
     end
 
-    properties (GetAccess = public, SetAccess = protected)
-        % Polar must be protected to ensure proprer behavior of the codes using Airfoil
+    % Private properties to prevent accidental re-assignment
+    properties (GetAccess = public, SetAccess = private)
+        coord % Airfoil coordinates (in Ledneicer format)
+        upper % Airfoil's upper surface coordinates
+        lower % Airfoil's lower surface coordinates
+
+        % Handle of the Polar object used to store the airfoil aerodynamic coefficients
         Polar (1, 1) af_tools.Polar
     end
 
@@ -59,11 +65,13 @@ classdef Airfoil < handle
 
         function self = Airfoil(coordFile, name)
             % AIRFOIL Constructor.
-            %   Initiates the Airfoil object based on its coordFile. If a name is explicitely
-            %   passed, this will be used for the airfoil name. If no name is given, it will be
-            %   retreived from the coordFile.
+            %   Instantiate the airfoil based on a dat-file with all its cordinates.
+            %   If a name is explicitely passed as input, this will be used for the airfoil name.
+            %   If no name is given, it will be retreived from the coordFile. See main class help
+            %   for details.
 
             self.Polar = af_tools.Polar;
+
             if nargin > 0 && ~isempty(coordFile)
                 import af_tools.*
 
-- 
GitLab