VR-Forces 4.0.4 Class Documentation
include/shape/shapeVectorInit.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2003 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: shapeVectorInit.h,v $ $Revision: 1.13 $ $State: Exp $
00007 *******************************************************************************/
00008 #ifndef shapeVectorInit_H_
00009 #define shapeVectorInit_H_
00010 
00011 #include "shape/shapeDefines.h"
00012 #include "gdb/vectorDataInitializer.h"
00013 #include "shape/shapeEntry.h"
00014 
00015 #include <vlutil/vlConfig.h>
00016 #include <vlutil/vlFilename.h>
00017 #include <list>
00018 
00019 // Entries which get stored in myAttributeMappingList
00020 struct DtShapeAttributeMapping
00021 {
00022    DtString attributeName;
00023    unsigned int attributeType;
00024    DtString fieldName;
00025 };
00026 
00027 
00028 // DtShapeVectorInitializer holds the settings specified in a 
00029 // ShapeVectorMetafileRecord
00030 class DT_DLL_shape DtShapeVectorInitializer : public DtVectorDataInitializer
00031 {
00032 
00033 public:
00034 
00035    typedef std::list<DtShapeEntry> DtShapeFileContainer;
00036    typedef DtShapeFileContainer::iterator DtShapeFileIter;
00037    typedef DtShapeFileContainer::const_iterator DtShapeFileConstIter;
00038 
00039    typedef std::list<DtShapeAttributeMapping> DtShapeAttributeMapContainer;
00040    typedef DtShapeAttributeMapContainer::iterator DtShapeAttributeMapIter;
00041    typedef DtShapeAttributeMapContainer::const_iterator DtShapeAttributeMapConstIter;
00042 
00043    // default constructor.
00044    DtShapeVectorInitializer();
00045 
00046    // destructor
00047    virtual ~DtShapeVectorInitializer();
00048 
00049    // copy constructor
00050    DtShapeVectorInitializer(const DtShapeVectorInitializer& orig);
00051 
00052    // assignment operator
00053    DtShapeVectorInitializer& operator=(const DtShapeVectorInitializer& orig);
00054 
00055    // \return "shape"
00056    virtual DtString type();
00057 
00058    // \return The container of shape entries in this initializer.
00059    virtual const DtShapeFileContainer& featureDataFileList() const;
00060    virtual DtShapeFileContainer& featureDataFileList();
00061 
00062    // Add a filename to the load list
00063    virtual void addFeatureDataFile(const DtFilename& filename, int fccCode, const DtFilename& path);
00064 
00065    // \return the origin latitude;
00066    virtual const double& originLatitude() const;
00067    virtual void setOriginLatitude(const double& d);
00068 
00069    // \return the origin longitude
00070    virtual const double& originLongitude() const;
00071    virtual void setOriginLongitude(const double& d);
00072 
00073    // \return the low-color height
00074    virtual bool isOriginSpecified() const;
00075    virtual void setIsOriginSpecified(bool b);
00076 
00077    // Called by DtShapeVectorMetafileRecord::processToken to import the
00078    // given fieldName from the dBASE file as an attribute with the given
00079    // attributeName and attributeType.
00080    virtual void addAttributeMapping(const DtString& attributeName, 
00081       unsigned int attributeType, const DtString& fieldName);
00082    
00083    // \return The container of attribute mappings
00084    // \see DtShapeAttributeMapping
00085    virtual const DtShapeAttributeMapContainer& attributeMap() const;
00086    virtual DtShapeAttributeMapContainer& attributeMap();
00087 
00088    virtual void clearList();
00089 
00090    // Mapping file (CSV formatted) which maps shape filename fragments
00091    // to entries in the DfadSedrisMap file to be used for all features in
00092    // that file.
00093    // Only used if #myClassifyFeaturesFromFilename is true.
00095    virtual void setShapeFilenameMapFile(const DtFilename& filename);
00096    virtual DtFilename shapeFilenameMapFile() const;
00098 
00099    // If true, will attempt to choose DfadSedisMap entries based on 
00100    // filename, using #myShameFilenameMapFile.
00102    virtual void setClassifyFeaturesFromFilename(bool v);
00103    virtual bool classifyFeaturesFromFilename() const;
00105 
00106    // Mapping file (CSV formatted) which lists attribute names to a set
00107    // of alternative names that may be found in the .dbf file along with
00108    // a shape file.  Any occurrences of any of the name aliases will be 
00109    // imported to the attribute named in this list.
00110    // Only used if #myUseAttributeAliasMapping is true.
00112    virtual void setShapeAttributeAliasFile(const DtFilename& filename);
00113    virtual DtFilename shapeAttributeAliasFile() const;
00115 
00116    // If true, will map attributes using #myShapeAttributeAliasFile.
00118    virtual void setUseAttributeAliasFile(bool v);
00119    virtual bool useAttributeAliasFile() const;
00121    
00122 protected:
00123 
00124    DtShapeFileContainer          myFeatureDataFileList;
00125    DtShapeAttributeMapContainer  myAttributeMappingList;
00126 
00127    DtFilename myShapeFilenameMapFile;
00128    DtFilename myShapeAttributeAliasFile;
00129 
00130    double                  myOriginLatitude;
00131    double                  myOriginLongitude;
00132    double                  myMinimumDistance;
00133    double                  myThresholdForSeaLevel;
00134 
00135    bool                    myIsOriginSpecified;
00136    bool                    myClassifyFeaturesFromFilename;
00137    bool                    myUseAttributeAliasMapping;
00138 
00139 };
00140 
00141 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)