[Liblas-commits] hg: HasTime and HasColor is not needed for schemas
anymore, and ...
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Oct 5 16:48:46 EDT 2010
changeset 6fcfd7074841 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=6fcfd7074841
summary: HasTime and HasColor is not needed for schemas anymore, and this is too specific anyway
diffstat:
include/liblas/capi/liblas.h | 19 ++-----------------
include/liblas/detail/writer/point.hpp | 3 ---
include/liblas/lasschema.hpp | 4 +---
python/liblas/core.py | 11 -----------
python/liblas/schema.py | 11 -----------
python/tests/Schema.txt | 15 +--------------
src/detail/writer/point.cpp | 2 --
src/las_c_api.cpp | 15 ---------------
src/lasschema.cpp | 31 -------------------------------
9 files changed, 4 insertions(+), 107 deletions(-)
diffs (220 lines):
diff -r ea9e540044c0 -r 6fcfd7074841 include/liblas/capi/liblas.h
--- a/include/liblas/capi/liblas.h Tue Oct 05 13:00:53 2010 -0500
+++ b/include/liblas/capi/liblas.h Tue Oct 05 15:48:37 2010 -0500
@@ -1154,24 +1154,9 @@
*/
LAS_DLL void LASString_Free(char* string);
-LAS_DLL LASSchemaH LASSchema_Create( unsigned char version_major,
- unsigned char version_minor,
- unsigned int size,
- unsigned char bHasColor,
- unsigned char bHasTime);
+LAS_DLL unsigned short LASSchema_GetByteSize( LASSchemaH hFormat);
+LAS_DLL unsigned short LASSchema_GetBaseByteSize( LASSchemaH hFormat);
-LAS_DLL unsigned char LASSchema_GetVersionMinor( LASSchemaH hFormat);
-LAS_DLL LASError LASSchema_SetVersionMinor( LASSchemaH hFormat, unsigned char nMinor);
-LAS_DLL unsigned char LASSchema_GetMajorVersion( LASSchemaH hFormat);
-LAS_DLL LASError LASSchema_SetVersionMinor( LASSchemaH hFormat, unsigned char nMajor);
-LAS_DLL unsigned char LASSchema_HasColor( LASSchemaH hFormat);
-LAS_DLL LASError LASSchema_SetColor( LASSchemaH hFormat, unsigned char bColor);
-LAS_DLL unsigned char LASSchema_HasTime( LASSchemaH hFormat);
-LAS_DLL LASError LASSchema_SetTime( LASSchemaH hFormat, unsigned char bTime);
-LAS_DLL unsigned short LASSchema_GetByteSize( LASSchemaH hFormat);
-LAS_DLL LASError LASSchema_SetByteSize( LASSchemaH hFormat, unsigned short size);
-LAS_DLL unsigned short LASSchema_GetBaseByteSize( LASSchemaH hFormat);
-LAS_DLL LASError LASSchema_SetBaseByteSize( LASSchemaH hFormat, unsigned short size);
LAS_DLL LASSchemaH LASHeader_GetSchema( LASHeaderH hHeader );
diff -r ea9e540044c0 -r 6fcfd7074841 include/liblas/detail/writer/point.hpp
--- a/include/liblas/detail/writer/point.hpp Tue Oct 05 13:00:53 2010 -0500
+++ b/include/liblas/detail/writer/point.hpp Tue Oct 05 15:48:37 2010 -0500
@@ -89,9 +89,6 @@
std::vector<boost::uint8_t> m_blanks;
- bool bTime;
- bool bColor;
-
void setup();
// void fill();
};
diff -r ea9e540044c0 -r 6fcfd7074841 include/liblas/lasschema.hpp
--- a/include/liblas/lasschema.hpp Tue Oct 05 13:00:53 2010 -0500
+++ b/include/liblas/lasschema.hpp Tue Oct 05 15:48:37 2010 -0500
@@ -64,6 +64,7 @@
namespace liblas {
class Dimension;
+
typedef boost::shared_ptr<Dimension> DimensionPtr;
typedef std::map<std::string, DimensionPtr> DimensionMap;
@@ -97,9 +98,6 @@
PointFormatName GetDataFormatId() const { return m_data_format_id; }
void SetDataFormatId(PointFormatName const& value);
- bool HasColor() const;
- bool HasTime() const;
-
void AddDimension(DimensionPtr dim);
DimensionPtr GetDimension(std::string const& name) const;
// DimensionPtr GetDimension(std::size_t index) const;
diff -r ea9e540044c0 -r 6fcfd7074841 python/liblas/core.py
--- a/python/liblas/core.py Tue Oct 05 13:00:53 2010 -0500
+++ b/python/liblas/core.py Tue Oct 05 15:48:37 2010 -0500
@@ -747,17 +747,6 @@
las.LASSchema_GetByteSize.errcheck = check_value
-
-las.LASSchema_HasColor.restype = ctypes.c_uint8
-las.LASSchema_HasColor.argtypes = [ctypes.c_void_p]
-las.LASSchema_HasColor.errcheck = check_value
-
-
-las.LASSchema_HasTime.restype = ctypes.c_uint8
-las.LASSchema_HasTime.argtypes = [ctypes.c_void_p]
-las.LASSchema_HasTime.errcheck = check_value
-
-
las.LASSchema_Destroy.argtypes = [ctypes.c_void_p]
las.LASSchema_Destroy.errcheck = check_void_done
las.LASSchema_Destroy.restype = None
diff -r ea9e540044c0 -r 6fcfd7074841 python/liblas/schema.py
--- a/python/liblas/schema.py Tue Oct 05 13:00:53 2010 -0500
+++ b/python/liblas/schema.py Tue Oct 05 15:48:37 2010 -0500
@@ -102,14 +102,3 @@
size = property(get_size, set_size, None, doc)
- def get_color(self):
- return bool(core.las.LASSchema_HasColor(self.handle))
-
- doc = """Does this format have color information"""
- color = property(get_color, None, None, doc)
-
- def get_time(self):
- return bool(core.las.LASSchema_HasTime(self.handle))
-
- doc = """Does this format have time information"""
- time = property(get_time, None, None, doc)
diff -r ea9e540044c0 -r 6fcfd7074841 python/tests/Schema.txt
--- a/python/tests/Schema.txt Tue Oct 05 13:00:53 2010 -0500
+++ b/python/tests/Schema.txt Tue Oct 05 15:48:37 2010 -0500
@@ -8,11 +8,6 @@
>>> f = schema.Schema()
>>> f.size
20
- >>> f.color
- False
- >>> f.time
- False
-
>>> h = f2.header
@@ -23,12 +18,7 @@
>>> f.size
28
-
- >>> f.color
- False
-
- >>> f.time
- True
+
>>> h = header.Header()
>>> f = h.schema
@@ -37,9 +27,6 @@
>>> f.size
34
- >>> f.time
- True
-
>>> h.schema = f
diff -r ea9e540044c0 -r 6fcfd7074841 src/detail/writer/point.cpp
--- a/src/detail/writer/point.cpp Tue Oct 05 13:00:53 2010 -0500
+++ b/src/detail/writer/point.cpp Tue Oct 05 15:48:37 2010 -0500
@@ -60,8 +60,6 @@
, m_ofs(ofs)
, m_header(header)
, m_format(header->GetSchema())
- , bTime(header->GetSchema().HasTime())
- , bColor(header->GetSchema().HasColor())
{
setup();
}
diff -r ea9e540044c0 -r 6fcfd7074841 src/las_c_api.cpp
--- a/src/las_c_api.cpp Tue Oct 05 13:00:53 2010 -0500
+++ b/src/las_c_api.cpp Tue Oct 05 15:48:37 2010 -0500
@@ -2010,21 +2010,6 @@
return (LASSchemaH) schema;
}
-LAS_DLL boost::uint8_t LASSchema_HasColor( LASSchemaH hFormat)
-{
- VALIDATE_LAS_POINTER1(hFormat, "LASSchema_HasColor", 0);
-
- return static_cast<int>(((liblas::Schema*) hFormat)->HasColor());
-}
-
-
-LAS_DLL boost::uint8_t LASSchema_HasTime( LASSchemaH hFormat)
-{
- VALIDATE_LAS_POINTER1(hFormat, "LASSchema_HasTime", 0);
-
- return static_cast<int>(((liblas::Schema*) hFormat)->HasTime());
-}
-
LAS_DLL boost::uint16_t LASSchema_GetByteSize( LASSchemaH hFormat)
{
diff -r ea9e540044c0 -r 6fcfd7074841 src/lasschema.cpp
--- a/src/lasschema.cpp Tue Oct 05 13:00:53 2010 -0500
+++ b/src/lasschema.cpp Tue Oct 05 15:48:37 2010 -0500
@@ -792,37 +792,6 @@
}
-bool Schema::HasColor() const
-{
- DimensionPtr c;
- try {
- c = GetDimension("Red");
- c = GetDimension("Green");
- c = GetDimension("Blue");
- } catch (std::runtime_error const& e) {
- boost::ignore_unused_variable_warning(e);
- return false;
- }
-
- return true;
-
-}
-
-bool Schema::HasTime() const
-{
- DimensionPtr c;
- try {
- c = GetDimension("Time");
- } catch (std::runtime_error const& e) {
- boost::ignore_unused_variable_warning(e);
- return false;
- }
-
- return true;
-
-}
-
-
VariableRecord Schema::GetVLR() const
{
More information about the Liblas-commits
mailing list