Changeset 918
- Timestamp:
- 10/09/08 16:29:43 (3 months ago)
- Location:
- trunk/csharp/dotnetLibLAS
- Files:
-
- 8 modified
-
LASException.cs (modified) (5 diffs)
-
LASGuid.cs (modified) (9 diffs)
-
LASHeader.cs (modified) (42 diffs)
-
LASPoint.cs (modified) (23 diffs)
-
LASReader.cs (modified) (7 diffs)
-
LASVariableLengthRecord.cs (modified) (14 diffs)
-
LASWriter.cs (modified) (4 diffs)
-
dotnetLibLas.xml (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/csharp/dotnetLibLAS/LASException.cs
r914 r918 40 40 ****************************************************************************/ 41 41 42 43 42 using System; 44 43 using System.Collections.Generic; … … 54 53 namespace LibLAS 55 54 { 56 57 55 enum LASError 58 56 { … … 69 67 public class LASException : 70 68 System.ApplicationException 71 72 69 { 73 70 /// <summary> … … 79 76 base(message) 80 77 { 78 } 81 79 82 }83 80 /// <summary> 84 81 /// TODO … … 87 84 /// <returns>the string </returns> 88 85 public static string GetString(Int32 value) 89 90 86 { 91 87 //to do. Implementent enum errors 92 88 return "LibLAS exception"; 93 94 89 } 95 90 } 96 97 98 91 } -
trunk/csharp/dotnetLibLAS/LASGuid.cs
r914 r918 40 40 ****************************************************************************/ 41 41 42 43 42 using System; 44 43 using System.Collections.Generic; … … 54 53 namespace LibLAS 55 54 { 56 57 55 /// <summary> 58 56 /// LASGuid class … … 68 66 public void Dispose() 69 67 { 70 71 68 CAPI.LASGuid_Destroy(hguid); 72 69 // Clean up unmanaged resources here. … … 108 105 { 109 106 return CAPI.LASGuid_AsString(hguid); 110 111 107 } 112 108 … … 117 113 public LASGuidH GetPointer() 118 114 { 119 120 115 return hguid; 121 122 116 } 123 124 117 125 118 /// <summary> … … 151 144 return false; 152 145 } 153 154 155 146 } 156 147 … … 171 162 public bool Equals(LASGuid obj) 172 163 { 173 174 175 164 //if parameter cannot be cast to Guid return false 176 165 … … 179 168 return false; 180 169 } 181 182 170 183 171 if (CAPI.LASGuid_Equals(hguid, obj.GetPointer()) == 1) … … 190 178 } 191 179 } 192 193 194 180 } 195 181 } -
trunk/csharp/dotnetLibLAS/LASHeader.cs
r914 r918 60 60 61 61 /// <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. 63 64 /// </summary> 64 65 public void Dispose() … … 70 71 } 71 72 72 73 74 73 enum FormatVersion 75 74 { … … 77 76 eVersionMajorMin = 1, 78 77 ///Maximum of major component 79 eVersionMajorMax = 1, 78 eVersionMajorMax = 1, 80 79 /// Minimum of minor component 81 eVersionMinorMin = 0, 80 eVersionMinorMin = 0, 82 81 /// Maximum of minor component 83 eVersionMinorMax = 1 82 eVersionMinorMax = 1 84 83 }; 85 84 … … 90 89 ePointFormat0 = 0, 91 90 /// Point Data Format \e 1 92 ePointFormat1 = 1 91 ePointFormat1 = 1 93 92 }; 94 93 … … 99 98 ePointSize0 = 20, 100 99 /// Size of point record in data format \e 1 101 ePointSize1 = 28 100 ePointSize1 = 28 102 101 }; 103 104 102 105 103 //// Official signature of ASPRS LAS file format, always \b "LASF". … … 112 110 //public static readonly string SoftwareIdentifier; 113 111 114 115 112 private LASHeaderH hHeader; 116 113 … … 124 121 } 125 122 126 127 123 /// <summary> 128 124 /// LASHeader constructor using the LASHeaderH opaque pointer. … … 137 133 /// Default constructor. 138 134 /// </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> 140 138 public LASHeader() 141 139 { 142 140 hHeader = CAPI.LASHeader_Create(); 143 141 } 144 145 142 146 143 /// <summary> … … 184 181 } 185 182 186 187 183 /// <summary> 188 184 /// Get ASPRS LAS file signature. … … 197 193 } 198 194 199 200 195 /// <summary> 201 196 /// file source identifier. … … 210 205 set 211 206 { 212 213 207 LASError error = CAPI.LASHeader_SetFileSourceId(hHeader, value); 214 208 if ((Int32)error != 0) … … 217 211 throw e; 218 212 } 219 220 } 221 213 } 222 214 } 223 215 … … 232 224 return CAPI.LASHeader_GetReserved(hHeader); 233 225 } 234 235 } 236 226 } 237 227 238 228 /// <summary> … … 248 238 } 249 239 250 251 252 240 /// <summary> 253 241 /// major component of version of LAS format. 254 242 /// </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> 256 245 public byte VersionMajor 257 246 { … … 262 251 set 263 252 { 264 265 253 LASError error = CAPI.LASHeader_SetVersionMajor(hHeader, value); 266 254 if ((Int32)error != 0) … … 269 257 throw e; 270 258 } 271 272 } 273 } 274 259 } 260 } 275 261 276 262 /// <summary> 277 263 /// minor component of version of LAS format. 278 264 /// </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> 280 267 public byte VersionMinor 281 268 { … … 287 274 set 288 275 { 289 290 276 LASError error = CAPI.LASHeader_SetVersionMinor(hHeader, value); 291 277 if ((Int32)error != 0) … … 300 286 /// system identifier 301 287 /// </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> 303 290 public String SystemId 304 291 { … … 315 302 throw e; 316 303 } 317 318 } 319 } 320 304 } 305 } 321 306 322 307 /// <summary> 323 308 /// software identifier 324 309 /// </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> 326 312 public String SoftwareId 327 313 { … … 339 325 throw e; 340 326 } 341 342 } 343 } 344 345 346 347 327 } 328 } 348 329 349 330 /// <summary> 350 331 /// day of year of file creation date. 351 332 /// </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> 353 335 public UInt16 CreationDOY 354 336 { … … 365 347 throw e; 366 348 } 367 368 } 369 } 370 371 372 349 } 350 } 373 351 374 352 /// <summary> … … 384 362 set 385 363 { 386 387 364 LASError error = CAPI.LASHeader_SetCreationYear(hHeader, value); 388 365 if ((Int32)error != 0) … … 415 392 return CAPI.LASHeader_GetDataOffset(hHeader); 416 393 } 417 418 } 419 394 } 420 395 421 396 /// <summary> … … 433 408 /// the data format id for the file. 434 409 /// </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> 436 412 public byte DataFormatId 437 413 { 438 414 get 439 415 { 440 441 416 return CAPI.LASHeader_GetDataFormatId(hHeader); 442 417 } … … 452 427 } 453 428 454 455 456 429 /// <summary> 457 430 /// return the record length for the points based on their data format id in bytes. … … 461 434 get 462 435 { 463 464 436 return CAPI.LASHeader_GetDataRecordLength(hHeader); 465 437 } 466 467 } 468 438 } 469 439 470 440 /// <summary> 471 441 /// number of point records in the file. 472 442 /// </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> 474 445 public UInt32 PointRecordsCount 475 446 { … … 490 461 } 491 462 } 492 493 463 494 464 /// <summary> … … 531 501 } 532 502 533 534 503 /// <summary> 535 504 /// Get scale factor for Y coordinate. … … 539 508 { 540 509 return CAPI.LASHeader_GetScaleY(hHeader); 541 542 510 } 543 511 … … 550 518 return CAPI.LASHeader_GetScaleZ(hHeader); 551 519 } 552 553 520 554 521 /// <summary> … … 568 535 } 569 536 570 571 537 /// <summary> 572 538 /// Get X coordinate offset. … … 576 542 { 577 543 return CAPI.LASHeader_GetOffsetX(hHeader); 578 579 } 580 544 } 581 545 582 546 /// <summary> … … 589 553 } 590 554 591 592 555 /// <summary> 593 556 /// Get Z coordinate offset. … … 598 561 return CAPI.LASHeader_GetOffsetZ(hHeader); 599 562 } 600 601 563 602 564 //Set values of X, Y and Z coordinates offset. … … 642 604 { 643 605 return CAPI.LASHeader_GetMaxZ(hHeader); 644 645 606 } 646 607 … … 651 612 public double GetMinX() 652 613 { 653 654 614 return CAPI.LASHeader_GetMinX(hHeader); 655 656 657 } 658 615 } 659 616 660 617 /// <summary> … … 664 621 public double GetMinY() 665 622 { 666 667 623 return CAPI.LASHeader_GetMinY(hHeader); 668 669 670 671 624 } 672 625 … … 677 630 public double GetMinZ() 678 631 { 679 680 632 return CAPI.LASHeader_GetMinZ(hHeader); 681 682 633 } 683 634 … … 696 647 throw e; 697 648 } 698 699 649 } 700 650 … … 734 684 /// <param name="i">the index starting from 0 of the variable length record to fetch</param> 735 685 /// <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> 737 688 public LASVariableLengthRecord GetVariableLengthRecord(UInt32 i) 738 689 { … … 775 726 throw e; 776 727 } 777 778 728 } 779 729 } … … 798 748 } 799 749 } 800 801 750 } 802 803 751 } 804 -
trunk/csharp/dotnetLibLAS/LASPoint.cs
r914 r918 40 40 ****************************************************************************/ 41 41 42 43 42 using System; 44 43 using System.Collections.Generic; … … 52 51 using LASHeaderH = System.IntPtr; 53 52 54 55 53 namespace LibLAS 56 54 { 57 58 59 55 /// <summary> 60 56 /// LASPoint class … … 97 93 }; 98 94 99 100 95 private LASPointH hPoint; 101 96 … … 106 101 public LASPoint(LASPointH hLASPoint) 107 102 { 108 109 110 103 hPoint = hLASPoint; 111 112 104 } 113 105 … … 118 110 { 119 111 hPoint = CAPI.LASPoint_Create(); 120 121 122 123 } 124 112 } 125 113 126 114 /// <summary> … … 162 150 public void Dispose() 163 151 { 164 165 152 CAPI.LASPoint_Destroy(hPoint); 166 153 // Clean up unmanaged resources here. 167 154 // Dispose other contained disposable objects. 168 155 } 169 170 171 172 156 173 157 enum ClassificationType … … 195 179 }; 196 180 197 198 181 /// <summary> 199 182 /// gets the opaque pointer to the LASPointH instance. … … 211 194 public LASPoint Copy() 212 195 { 213 214 196 LASPointH laspointhTemp = CAPI.LASPoint_Copy(hPoint); 215 197 return new LASPoint(laspointhTemp); … … 231 213 } 232 214 233 234 235 215 return true; 236 216 } 237 238 217 239 218 /// <summary> … … 246 225 { 247 226 return CAPI.LASPoint_GetX(hPoint); 248 249 227 } 250 228 set … … 254 232 { 255 233 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
