Changeset 918

Show
Ignore:
Timestamp:
10/09/08 16:29:43 (3 months ago)
Author:
mloskot
Message:

csharp/dotnetLibLAS: reformatted source code in all *.cs files, fixed EOL to CRLF. This submission does not include any changes in algorithms or procedures.

Location:
trunk/csharp/dotnetLibLAS
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/csharp/dotnetLibLAS/LASException.cs

    r914 r918  
    4040 ****************************************************************************/ 
    4141 
    42  
    4342using System; 
    4443using System.Collections.Generic; 
     
    5453namespace LibLAS 
    5554{ 
    56  
    5755    enum LASError 
    5856    { 
     
    6967    public class LASException : 
    7068        System.ApplicationException 
    71  
    7269    { 
    7370        /// <summary> 
     
    7976            base(message) 
    8077        { 
     78        } 
    8179 
    82         } 
    8380        /// <summary> 
    8481        /// TODO 
     
    8784        /// <returns>the string </returns> 
    8885        public static string GetString(Int32 value) 
    89          
    9086        { 
    9187            //to do. Implementent enum errors 
    9288            return "LibLAS exception"; 
    93  
    9489        } 
    9590    } 
    96  
    97  
    9891} 
  • trunk/csharp/dotnetLibLAS/LASGuid.cs

    r914 r918  
    4040 ****************************************************************************/ 
    4141 
    42  
    4342using System; 
    4443using System.Collections.Generic; 
     
    5453namespace LibLAS 
    5554{ 
    56  
    5755    /// <summary> 
    5856    /// LASGuid class 
     
    6866        public void Dispose() 
    6967        { 
    70  
    7168            CAPI.LASGuid_Destroy(hguid); 
    7269            // Clean up unmanaged resources here. 
     
    108105        { 
    109106            return CAPI.LASGuid_AsString(hguid); 
    110  
    111107        } 
    112108 
     
    117113        public LASGuidH GetPointer() 
    118114        { 
    119  
    120115            return hguid; 
    121  
    122116        } 
    123  
    124117 
    125118        /// <summary> 
     
    151144                return false; 
    152145            } 
    153  
    154  
    155146        } 
    156147 
     
    171162        public bool Equals(LASGuid obj) 
    172163        { 
    173  
    174  
    175164            //if parameter cannot be cast to Guid return false 
    176165 
     
    179168                return false; 
    180169            } 
    181  
    182170 
    183171            if (CAPI.LASGuid_Equals(hguid, obj.GetPointer()) == 1) 
     
    190178            } 
    191179        } 
    192  
    193       
    194180    } 
    195181} 
  • trunk/csharp/dotnetLibLAS/LASHeader.cs

    r914 r918  
    6060 
    6161        /// <summary> 
    62         /// The object user should call this method when they finished with the object. In .NET is magaged by the GC. 
     62        /// The object user should call this method when they finished with the object. 
     63        /// In .NET is magaged by the GC. 
    6364        /// </summary> 
    6465        public void Dispose() 
     
    7071        } 
    7172 
    72  
    73  
    7473        enum FormatVersion 
    7574        { 
     
    7776            eVersionMajorMin = 1, 
    7877            ///Maximum of major component         
    79             eVersionMajorMax = 1,  
     78            eVersionMajorMax = 1, 
    8079            /// Minimum of minor component 
    81             eVersionMinorMin = 0,  
     80            eVersionMinorMin = 0, 
    8281            /// Maximum of minor component 
    83             eVersionMinorMax = 1  
     82            eVersionMinorMax = 1 
    8483        }; 
    8584 
     
    9089            ePointFormat0 = 0, 
    9190            /// Point Data Format \e 1 
    92             ePointFormat1 = 1   
     91            ePointFormat1 = 1 
    9392        }; 
    9493 
     
    9998            ePointSize0 = 20, 
    10099            /// Size of point record in data format \e 1 
    101             ePointSize1 = 28   
     100            ePointSize1 = 28 
    102101        }; 
    103  
    104102 
    105103        //// Official signature of ASPRS LAS file format, always \b "LASF". 
     
    112110        //public static readonly string SoftwareIdentifier; 
    113111 
    114  
    115112        private LASHeaderH hHeader; 
    116113 
     
    124121        } 
    125122 
    126  
    127123        /// <summary> 
    128124        /// LASHeader constructor using the LASHeaderH opaque pointer. 
     
    137133        /// Default constructor. 
    138134        /// </summary> 
    139         /// <remarks>The default constructed header is configured according to the ASPRS LAS 1.1 Specification, point data format set to 0. Other fields filled with 0.</remarks> 
     135        /// <remarks>The default constructed header is configured according 
     136        /// to the ASPRS LAS 1.1 Specification, point data format set to 0. 
     137        /// Other fields filled with 0.</remarks> 
    140138        public LASHeader() 
    141139        { 
    142140            hHeader = CAPI.LASHeader_Create(); 
    143141        } 
    144  
    145142 
    146143        /// <summary> 
     
    184181        } 
    185182 
    186  
    187183        /// <summary> 
    188184        /// Get ASPRS LAS file signature. 
     
    197193        } 
    198194 
    199  
    200195        /// <summary> 
    201196        /// file source identifier. 
     
    210205            set 
    211206            { 
    212  
    213207                LASError error = CAPI.LASHeader_SetFileSourceId(hHeader, value); 
    214208                if ((Int32)error != 0) 
     
    217211                    throw e; 
    218212                } 
    219  
    220             } 
    221  
     213            } 
    222214        } 
    223215 
     
    232224                return CAPI.LASHeader_GetReserved(hHeader); 
    233225            } 
    234  
    235         } 
    236  
     226        } 
    237227 
    238228        /// <summary> 
     
    248238        } 
    249239 
    250  
    251  
    252240        /// <summary> 
    253241        /// major component of version of LAS format. 
    254242        /// </summary> 
    255         /// <remarks>Always 1  as the only valid value. value between eVersionMajorMin and eVersionMajorMax (always 1).</remarks> 
     243        /// <remarks>Always 1 as the only valid value. value between 
     244        /// eVersionMajorMin and eVersionMajorMax (always 1).</remarks> 
    256245        public byte VersionMajor 
    257246        { 
     
    262251            set 
    263252            { 
    264  
    265253                LASError error = CAPI.LASHeader_SetVersionMajor(hHeader, value); 
    266254                if ((Int32)error != 0) 
     
    269257                    throw e; 
    270258                } 
    271  
    272             } 
    273         } 
    274  
     259            } 
     260        } 
    275261 
    276262        /// <summary> 
    277263        /// minor component of version of LAS format. 
    278264        /// </summary> 
    279         /// <remarks>Valid values are 1 or 0. value between eVersionMinorMin and eVersionMinorMax.</remarks> 
     265        /// <remarks>Valid values are 1 or 0. value between 
     266        /// eVersionMinorMin and eVersionMinorMax.</remarks> 
    280267        public byte VersionMinor 
    281268        { 
     
    287274            set 
    288275            { 
    289  
    290276                LASError error = CAPI.LASHeader_SetVersionMinor(hHeader, value); 
    291277                if ((Int32)error != 0) 
     
    300286        /// system identifier 
    301287        /// </summary> 
    302         /// <remarks>Default value is "libLAS" specified as the SystemIdentifier constant. string is padded right with spaces and its length is 32 bytes.</remarks> 
     288        /// <remarks>Default value is "libLAS" specified as the SystemIdentifier constant. 
     289        /// string is padded right with spaces and its length is 32 bytes.</remarks> 
    303290        public String SystemId 
    304291        { 
     
    315302                    throw e; 
    316303                } 
    317  
    318             } 
    319         } 
    320  
     304            } 
     305        } 
    321306 
    322307        /// <summary> 
    323308        /// software identifier 
    324309        /// </summary> 
    325         /// <remarks>Default value is "libLAS 1.0", specified as the SoftwareIdentifier constant. String is padded right with spaces and its length is 32 bytes.</remarks> 
     310        /// <remarks>Default value is "libLAS 1.0", specified as the SoftwareIdentifier constant. 
     311        /// String is padded right with spaces and its length is 32 bytes.</remarks> 
    326312        public String SoftwareId 
    327313        { 
     
    339325                    throw e; 
    340326                } 
    341  
    342             } 
    343         } 
    344  
    345  
    346  
    347  
     327            } 
     328        } 
    348329 
    349330        /// <summary> 
    350331        /// day of year of file creation date. 
    351332        /// </summary> 
    352         /// <remarks>Use full date structure instead of Julian date number. value is lower than number 366.</remarks> 
     333        /// <remarks>Use full date structure instead of Julian date number. 
     334        /// value is lower than number 366.</remarks> 
    353335        public UInt16 CreationDOY 
    354336        { 
     
    365347                    throw e; 
    366348                } 
    367  
    368             } 
    369         } 
    370  
    371  
    372  
     349            } 
     350        } 
    373351 
    374352        /// <summary> 
     
    384362            set 
    385363            { 
    386  
    387364                LASError error = CAPI.LASHeader_SetCreationYear(hHeader, value); 
    388365                if ((Int32)error != 0) 
     
    415392                return CAPI.LASHeader_GetDataOffset(hHeader); 
    416393            } 
    417  
    418         } 
    419  
     394        } 
    420395 
    421396        /// <summary> 
     
    433408        /// the data format id for the file.   
    434409        /// </summary> 
    435         /// <remarks>The value should be 1 or 0, with 1 being points that contain time values and 0 being points that do not.</remarks> 
     410        /// <remarks>The value should be 1 or 0, with 1 being points that contain 
     411        /// time values and 0 being points that do not.</remarks> 
    436412        public byte DataFormatId 
    437413        { 
    438414            get 
    439415            { 
    440  
    441416                return CAPI.LASHeader_GetDataFormatId(hHeader); 
    442417            } 
     
    452427        } 
    453428 
    454  
    455  
    456429        /// <summary> 
    457430        /// return the record length for the points based on their data format id in bytes. 
     
    461434            get 
    462435            { 
    463  
    464436                return CAPI.LASHeader_GetDataRecordLength(hHeader); 
    465437            } 
    466  
    467         } 
    468  
     438        } 
    469439 
    470440        /// <summary> 
    471441        /// number of point records in the file.   
    472442        /// </summary> 
    473         /// <remarks>This value may not reflect the actual number of point records in the file.</remarks> 
     443        /// <remarks>This value may not reflect the actual number of point 
     444        /// records in the file.</remarks> 
    474445        public UInt32 PointRecordsCount 
    475446        { 
     
    490461            } 
    491462        } 
    492  
    493463 
    494464        /// <summary> 
     
    531501        } 
    532502 
    533  
    534503        /// <summary> 
    535504        /// Get scale factor for Y coordinate. 
     
    539508        { 
    540509            return CAPI.LASHeader_GetScaleY(hHeader); 
    541  
    542510        } 
    543511 
     
    550518            return CAPI.LASHeader_GetScaleZ(hHeader); 
    551519        } 
    552  
    553520 
    554521        /// <summary> 
     
    568535        } 
    569536 
    570  
    571537        /// <summary> 
    572538        /// Get X coordinate offset. 
     
    576542        { 
    577543            return CAPI.LASHeader_GetOffsetX(hHeader); 
    578  
    579         } 
    580  
     544        } 
    581545 
    582546        /// <summary> 
     
    589553        } 
    590554 
    591  
    592555        /// <summary> 
    593556        /// Get Z coordinate offset. 
     
    598561            return CAPI.LASHeader_GetOffsetZ(hHeader); 
    599562        } 
    600  
    601563 
    602564        //Set values of X, Y and Z coordinates offset. 
     
    642604        { 
    643605            return CAPI.LASHeader_GetMaxZ(hHeader); 
    644  
    645606        } 
    646607 
     
    651612        public double GetMinX() 
    652613        { 
    653  
    654614            return CAPI.LASHeader_GetMinX(hHeader); 
    655  
    656  
    657         } 
    658  
     615        } 
    659616 
    660617        /// <summary> 
     
    664621        public double GetMinY() 
    665622        { 
    666  
    667623            return CAPI.LASHeader_GetMinY(hHeader); 
    668  
    669  
    670  
    671624        } 
    672625 
     
    677630        public double GetMinZ() 
    678631        { 
    679  
    680632            return CAPI.LASHeader_GetMinZ(hHeader); 
    681  
    682633        } 
    683634 
     
    696647                throw e; 
    697648            } 
    698  
    699649        } 
    700650 
     
    734684        /// <param name="i">the index starting from 0 of the variable length record to fetch</param> 
    735685        /// <returns>a new variable length record instance</returns> 
    736         /// <remarks>Use VariableLengthRecordsCount property to determine the number of variable length records available on the header.</remarks> 
     686        /// <remarks>Use VariableLengthRecordsCount property to determine the number of 
     687        /// variable length records available on the header.</remarks> 
    737688        public LASVariableLengthRecord GetVariableLengthRecord(UInt32 i) 
    738689        { 
     
    775726                    throw e; 
    776727                } 
    777  
    778728            } 
    779729        } 
     
    798748            } 
    799749        } 
    800  
    801750    } 
    802  
    803751} 
    804  
  • trunk/csharp/dotnetLibLAS/LASPoint.cs

    r914 r918  
    4040 ****************************************************************************/ 
    4141 
    42  
    4342using System; 
    4443using System.Collections.Generic; 
     
    5251using LASHeaderH = System.IntPtr; 
    5352 
    54  
    5553namespace LibLAS 
    5654{ 
    57  
    58    
    5955    /// <summary> 
    6056    /// LASPoint class 
     
    9793        }; 
    9894 
    99  
    10095        private LASPointH hPoint; 
    10196 
     
    106101        public LASPoint(LASPointH hLASPoint) 
    107102        { 
    108  
    109  
    110103            hPoint = hLASPoint; 
    111  
    112104        } 
    113105 
     
    118110        { 
    119111            hPoint = CAPI.LASPoint_Create(); 
    120  
    121  
    122  
    123         } 
    124  
     112        } 
    125113 
    126114        /// <summary> 
     
    162150        public void Dispose() 
    163151        { 
    164  
    165152            CAPI.LASPoint_Destroy(hPoint); 
    166153            // Clean up unmanaged resources here. 
    167154            // Dispose other contained disposable objects. 
    168155        } 
    169  
    170  
    171        
    172156 
    173157        enum ClassificationType 
     
    195179        }; 
    196180 
    197  
    198181        /// <summary> 
    199182        /// gets the opaque pointer to the LASPointH instance. 
     
    211194        public LASPoint Copy() 
    212195        { 
    213  
    214196            LASPointH laspointhTemp = CAPI.LASPoint_Copy(hPoint); 
    215197            return new LASPoint(laspointhTemp); 
     
    231213            } 
    232214 
    233  
    234  
    235215            return true; 
    236216        } 
    237  
    238217 
    239218        /// <summary> 
     
    246225            { 
    247226                return CAPI.LASPoint_GetX(hPoint); 
    248  
    249227            } 
    250228            set 
     
    254232                { 
    255233                    LASException e = new LASException("Exception in Set Point X."); 
    256  
    257                     throw e; 
    258                 } 
    259             } 
    260         } 
    261          
    262            
     234                    throw e; 
     235                } 
     236            } 
     237        } 
    263