1 /****************************************************************************** 2 * 3 * Purpose: Declaration of access to a PCIDSK GCP2 Segment 4 * 5 ****************************************************************************** 6 * Copyright (c) 2009 7 * PCI Geomatics, 90 Allstate Parkway, Markham, Ontario, Canada. 8 * 9 * Permission is hereby granted, free of charge, to any person obtaining a 10 * copy of this software and associated documentation files (the "Software"), 11 * to deal in the Software without restriction, including without limitation 12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13 * and/or sell copies of the Software, and to permit persons to whom the 14 * Software is furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be included 17 * in all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 * DEALINGS IN THE SOFTWARE. 26 ****************************************************************************/ 27 #ifndef INCLUDE_SEGMENT_CPCIDSKGCP2SEGMENT_H 28 #define INCLUDE_SEGMENT_CPCIDSKGCP2SEGMENT_H 29 30 #include "pcidsk_gcp.h" 31 #include "pcidsk_gcpsegment.h" 32 #include "segment/cpcidsksegment.h" 33 34 namespace PCIDSK { 35 class CPCIDSKGCP2Segment : virtual public PCIDSKGCPSegment, 36 public CPCIDSKSegment 37 { 38 public: 39 CPCIDSKGCP2Segment(PCIDSKFile *file, int segment,const char *segment_pointer); 40 ~CPCIDSKGCP2Segment(); 41 42 // Return all GCPs in the segment 43 std::vector<PCIDSK::GCP> const& GetGCPs(void) const override; 44 45 // Write the given GCPs to the segment. If the segment already 46 // exists, it will be replaced with this one. 47 void SetGCPs(std::vector<PCIDSK::GCP> const& gcps) override; 48 49 // Return the count of GCPs in the segment 50 unsigned int GetGCPCount(void) const override; 51 52 // Clear a GCP Segment 53 void ClearGCPs(void) override; 54 55 void Synchronize() override; 56 private: 57 void Load(); 58 void RebuildSegmentData(void); 59 bool loaded_; 60 struct PCIDSKGCP2SegInfo; 61 PCIDSKGCP2SegInfo* pimpl_; 62 }; 63 } 64 65 #endif // INCLUDE_SEGMENT_CPCIDSKGCP2SEGMENT_H 66 67