[Liblas-commits] r1135 - in trunk: include/liblas/capi src
liblas-commits at liblas.org
liblas-commits at liblas.org
Sun Mar 22 16:12:08 EDT 2009
Author: hobu
Date: Sun Mar 22 16:12:07 2009
New Revision: 1135
URL: http://liblas.org/changeset/1135
Log:
Fix #115, add Get/SetPointSourceId to C API
Modified:
trunk/include/liblas/capi/liblas.h
trunk/src/las_c_api.cpp
Modified: trunk/include/liblas/capi/liblas.h
==============================================================================
--- trunk/include/liblas/capi/liblas.h (original)
+++ trunk/include/liblas/capi/liblas.h Sun Mar 22 16:12:07 2009
@@ -404,6 +404,19 @@
*/
LAS_DLL LASError LASPoint_SetScanAngleRank(LASPointH hPoint, int8_t value);
+/** Sets the point source id for the point. No validation is done.
+ * @param hPoint LASPointH instance
+ * @param value the value to set for the point source id
+ * @return LASError value determine success or failure.
+*/
+LAS_DLL LASError LASPoint_SetPointSourceId(LASPointH hPoint, uint16_t value);
+
+/** Returns the point source id for the point
+ * @param hPoint LASPointH instance
+ * @return the scan angle for the point
+*/
+LAS_DLL uint16_t LASPoint_GetPointSourceId(LASPointH hPoint);
+
/** Returns the arbitrary user data for the point
* @param hPoint LASPointH instance
* @return the arbitrary user data for the point
Modified: trunk/src/las_c_api.cpp
==============================================================================
--- trunk/src/las_c_api.cpp (original)
+++ trunk/src/las_c_api.cpp Sun Mar 22 16:12:07 2009
@@ -615,6 +615,31 @@
}
+LAS_DLL liblas::uint16_t LASPoint_GetPointSourceId(const LASPointH hPoint) {
+
+ VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetPointSourceId", 0);
+
+ liblas::uint16_t value = ((LASPoint*) hPoint)->GetPointSourceID();
+ return value;
+}
+
+LAS_DLL LASErrorEnum LASPoint_SetPointSourceId(LASPointH hPoint, liblas::uint16_t value) {
+
+ VALIDATE_LAS_POINTER1(hPoint, "LASPoint_SetPointSourceId", LE_Failure);
+
+ try {
+ ((LASPoint*) hPoint)->SetPointSourceID(value);
+ } catch (std::exception const& e)
+ {
+ LASError_PushError(LE_Failure, e.what(), "LASPoint_SetPointSourceId");
+ return LE_Failure;
+ }
+
+ return LE_None;
+
+}
+
+
LAS_DLL liblas::uint8_t LASPoint_GetUserData(const LASPointH hPoint) {
VALIDATE_LAS_POINTER1(hPoint, "LASPoint_GetUserData", 0);
More information about the Liblas-commits
mailing list