OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ossimVpfAnnotationFeatureInfo Class Reference

#include <ossimVpfAnnotationFeatureInfo.h>

Inheritance diagram for ossimVpfAnnotationFeatureInfo:
ossimObject ossimReferenced

Public Types

enum  ossimVpfAnnotationFeatureType {
  ossimVpfAnnotationFeatureType_UNKNOWN = 0, ossimVpfAnnotationFeatureType_POINT = 1, ossimVpfAnnotationFeatureType_LINE = 2, ossimVpfAnnotationFeatureType_POLYGON = 3,
  ossimVpfAnnotationFeatureType_TEXT = 4
}
 

Public Member Functions

 ossimVpfAnnotationFeatureInfo (const ossimString &featureName="", const ossimRgbVector &penColor=ossimRgbVector(255, 255, 255), const ossimRgbVector &brushColor=ossimRgbVector(255, 255, 255), const ossimDpt &pointRadius=ossimDpt(1, 1), int thickness=0, bool enabledFlag=true)
 
 ~ossimVpfAnnotationFeatureInfo ()
 
void setCoverage (const ossimVpfCoverage &coverage)
 
const ossimVpfCoveragegetCoverage () const
 
ossimVpfCoveragegetCoverage ()
 
void setColor (const ossimRgbVector &color)
 
void setPenColor (const ossimRgbVector &penColor)
 
ossimRgbVector getPenColor () const
 
void setBrushColor (const ossimRgbVector &brushColor)
 
ossimRgbVector getBrushColor () const
 
void setFillEnabledFlag (bool flag)
 
bool getFillEnabledFlag () const
 
void setEnabledFlag (bool flag)
 
bool getEnabledFlag () const
 
void setThickness (int thickness)
 
int getThickness () const
 
void setName (const ossimString &name)
 
const ossimStringgetName () const
 
bool isPoint () const
 
bool isLine () const
 
bool isPolygon () const
 
bool isText () const
 
void getFontInformation (ossimFontInformation &fontInfo) const
 
void setFontInformation (const ossimFontInformation &fontInfo)
 
void setPointRadius (const ossimDpt &radius)
 
ossimDpt getPointRadius () const
 
void setDrawingFeaturesToAnnotation ()
 
ossimIrect getBoundingProjectedRect () const
 
void transform (ossimImageGeometry *proj)
 
void buildFeature ()
 
void deleteAllObjects ()
 
void drawAnnotations (ossimRgbImage *tile)
 
bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
ossimString getFeatureTypeAsString () const
 
ossimVpfAnnotationFeatureType getFeatureTypeFromString (const ossimString &featureType) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Protected Member Functions

void buildTxtFeature (const ossimFilename &table, const ossimString &tableKey, const ossimFilename &primitive, const ossimString &primitiveKey)
 
void buildEdgFeature (const ossimFilename &table, const ossimString &tableKey, const ossimFilename &primitive, const ossimString &primitiveKey)
 
void buildPointFeature (const ossimString &primitiveName, const ossimFilename &table, const ossimString &tableKey, const ossimFilename &primitive, const ossimString &primitiveKey)
 
void buildFaceFeature (const ossimFilename &table, const ossimString &tableKey, const ossimFilename &primitive, const ossimString &primitiveKey)
 
void readEdge (ossimPolyLine &polyLine, int rowNumber, int colPosition, ossimVpfTable &edgeTable)
 
int readTableCellAsInt (int rowNumber, int colNumber, ossimVpfTable &table)
 
int readRngId (int rowNumber, int colNumber, ossimVpfTable &faceTable)
 
int readStartEdgeId (int rowNumber, int colNumber, ossimVpfTable &rngTable)
 
void readGeoPolygon (ossimGeoPolygon &polygon, int faceId, int startEdgeId, ossimVpfTable &edgTable)
 
ossimDptgetXy (vpf_table_type table, row_type row, ossim_int32 pos, ossim_int32 *count)
 
int getEdgeKeyId (vpf_table_type &table, row_type &row, int col)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

ossimString theName
 
ossimString theDescription
 
ossimRgbVector thePenColor
 
ossimRgbVector theBrushColor
 
ossimVpfCoverage theCoverage
 
ossimDpt thePointRadius
 
int theThickness
 
bool theFillEnabledFlag
 
bool theEnabledFlag
 
ossimVpfAnnotationFeatureType theFeatureType
 
ossimFontInformation theFontInformation
 
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
 

Private Member Functions

void readAttributes (ossimPolyLine &polyLine, ossimVpfTable &table, int row)
 
void readAttributes (ossimGeoPolygon &polygon, ossimVpfTable &table, int row)
 

Detailed Description

Definition at line 26 of file ossimVpfAnnotationFeatureInfo.h.

Member Enumeration Documentation

◆ ossimVpfAnnotationFeatureType

Constructor & Destructor Documentation

◆ ossimVpfAnnotationFeatureInfo()

ossimVpfAnnotationFeatureInfo::ossimVpfAnnotationFeatureInfo ( const ossimString featureName = "",
const ossimRgbVector penColor = ossimRgbVector(255,255,255),
const ossimRgbVector brushColor = ossimRgbVector(255,255,255),
const ossimDpt pointRadius = ossimDpt(1,1),
int  thickness = 0,
bool  enabledFlag = true 
)

Definition at line 25 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimFontFactoryRegistry::getDefaultFont(), ossimFont::getFontInformation(), ossimFontFactoryRegistry::instance(), and theFontInformation.

31  :theName(featureName),
32  thePenColor(penColor),
33  theBrushColor(brushColor),
34  thePointRadius(pointRadius),
35  theThickness(thickness),
36  theFillEnabledFlag(false),
37  theEnabledFlag(enabledFlag),
41 {
43 
44  if(font)
45  {
46  std::vector<ossimFontInformation> fontInfoArray;
47 
48  font->getFontInformation(fontInfoArray);
49 
50  if(fontInfoArray.size())
51  {
52  theFontInformation = fontInfoArray[0];
53  }
54  }
55 }
virtual void getFontInformation(vector< ossimFontInformation > &fontInformationList) const
Definition: ossimFont.h:281
static ossimFontFactoryRegistry * instance()
ossimVpfAnnotationFeatureType theFeatureType
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray

◆ ~ossimVpfAnnotationFeatureInfo()

ossimVpfAnnotationFeatureInfo::~ossimVpfAnnotationFeatureInfo ( )

Member Function Documentation

◆ buildEdgFeature()

void ossimVpfAnnotationFeatureInfo::buildEdgFeature ( const ossimFilename table,
const ossimString tableKey,
const ossimFilename primitive,
const ossimString primitiveKey 
)
protected

Definition at line 609 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimFilename::dirCat(), ossimString::downcase(), ossimFilename::exists(), ossimRgbVector::getB(), ossimVpfTable::getColumnPosition(), ossimVpfTable::getColumnValues(), ossimRgbVector::getG(), ossimVpfCoverage::getLibrary(), ossimVpfCoverage::getPath(), ossimRgbVector::getR(), ossimVpfLibrary::getTileName(), ossimVpfTable::openTable(), readAttributes(), readEdge(), ossimGeoAnnotationMultiPolyLineObject::setColor(), ossimGeoAnnotationMultiPolyLineObject::setThickness(), theAnnotationArray, theCoverage, thePenColor, theThickness, and ossimString::trim().

Referenced by buildFeature().

613 {
614  ossimFilename tableFileName = theCoverage.getPath().dirCat(tableName);
615  ossimFilename primitiveTableName;
616  ossimVpfTable table;
617  ossimVpfTable primitiveTable;
618 
619  std::vector<ossimPolyLine> polyLineArray;
620 
621  if(table.openTable(tableFileName))
622  {
623 
624  vector<ossimString> columnValues = table.getColumnValues(tableKey.trim());
625  vector<ossimString> tileIds;
626  bool isTiled = false;
627  if(table.getColumnPosition("tile_id") >= 0)
628  {
629  tileIds = table.getColumnValues("tile_id");
630  isTiled = true;
631  }
632  ossim_int32 coordinateValuePosition = 0;
633  if(!isTiled)
634  {
635  primitiveTableName = theCoverage.getPath().dirCat("edg");
636  if(!primitiveTable.openTable(primitiveTableName))
637  {
638  return;
639  }
640  coordinateValuePosition = primitiveTable.getColumnPosition("coordinates");
641  }
642  ossim_int32 tileId = -1;
643  for(ossim_uint32 idx = 0; idx < columnValues.size();++idx)
644  {
645  if(isTiled)
646  {
647  if(tileId != tileIds[idx].toInt())
648  {
649  tileId = tileIds[idx].toInt();
650  ossimFilename filename = theCoverage.getLibrary()->getTileName(tileIds[idx].toInt());
651  if(theCoverage.getPath().dirCat(filename).dirCat("edg").exists())
652  {
653  primitiveTableName = theCoverage.getPath().dirCat(filename).dirCat("edg");
654  }
655  else if(theCoverage.getPath().dirCat(filename.downcase()).dirCat("edg").exists())
656  {
657  primitiveTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("edg");
658  }
659  if(!primitiveTable.openTable(primitiveTableName))
660  {
661  return;
662  }
663  coordinateValuePosition = primitiveTable.getColumnPosition("coordinates");
664  }
665  }
666  ossimPolyLine polyLine;
667 
668  readEdge(polyLine,
669  columnValues[idx].toInt(),
670  coordinateValuePosition,
671  primitiveTable);
672 
673  readAttributes(polyLine, table, idx + 1); // third parm is one-based row
674 
675  polyLineArray.push_back(polyLine);
676  }
677  }
679  annotation->setColor(thePenColor.getR(),
680  thePenColor.getG(),
681  thePenColor.getB());
682  annotation->setThickness(theThickness);
683  theAnnotationArray.push_back(annotation);
684 }
unsigned char getR() const
virtual void setColor(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
ossimString getTileName(ossim_int32 id) const
std::vector< ossimString > getColumnValues(const ossimString &columnName) const
virtual bool openTable(const ossimFilename &tableName)
ossim_int32 getColumnPosition(const ossimString &columnName) const
const ossimFilename & getPath() const
bool exists() const
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
unsigned char getB() const
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
unsigned char getG() const
ossimFilename dirCat(const ossimFilename &file) const
void readEdge(ossimPolyLine &polyLine, int rowNumber, int colPosition, ossimVpfTable &edgeTable)
void readAttributes(ossimPolyLine &polyLine, ossimVpfTable &table, int row)
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
ossimVpfLibrary * getLibrary()
int ossim_int32

◆ buildFaceFeature()

void ossimVpfAnnotationFeatureInfo::buildFaceFeature ( const ossimFilename table,
const ossimString tableKey,
const ossimFilename primitive,
const ossimString primitiveKey 
)
protected

Definition at line 791 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimFilename::dirCat(), ossimString::downcase(), ossimFilename::exists(), ossimVpfTable::getColumnPosition(), ossimVpfTable::getColumnValues(), ossimVpfCoverage::getLibrary(), ossimVpfTable::getNumberOfRows(), ossimVpfCoverage::getPath(), ossimVpfLibrary::getTileName(), ossimVpfTable::openTable(), readRngId(), theCoverage, and ossimString::trim().

Referenced by buildFeature().

795 {
796  ossimFilename tableFileName = theCoverage.getPath().dirCat(tableName);
797  ossimFilename primitiveTableName;
798  ossimFilename rngTableName;
799  ossimFilename edgTableName;
800  ossimVpfTable table;
801  ossimVpfTable primitiveTable;
802  ossimVpfTable rngTable;
803  ossimVpfTable edgTable;
804  vector<ossimGeoPolygon> thePolyList;
805 
806  if(table.openTable(tableFileName))
807  {
808  vector<ossimString> columnValues = table.getColumnValues(tableKey.trim()); // fac_id
809  vector<ossimString> tileIds;
810  bool isTiled = false;
811  if(table.getColumnPosition("tile_id") >= 0)
812  {
813  tileIds = table.getColumnValues("tile_id");
814  isTiled = true;
815  }
816  // ossim_int32 coordinateValuePosition = 0;
817  ossim_int32 startEdgePosition = 0;
818  ossim_int32 rngPtrPosition = 0;
819  if(!isTiled)
820  {
821  primitiveTableName = theCoverage.getPath().dirCat("fac");
822  rngTableName = theCoverage.getPath().dirCat("rng");
823  edgTableName = theCoverage.getPath().dirCat("edg");
824  if(!primitiveTable.openTable(primitiveTableName)||
825  !rngTable.openTable(rngTableName)||
826  !edgTable.openTable(edgTableName))
827  {
828  return;
829  }
830  // coordinateValuePosition = edgTable.getColumnPosition("coordinates");
831  startEdgePosition = rngTable.getColumnPosition("start_edge");
832  rngPtrPosition = primitiveTable.getColumnPosition("ring_ptr");
833  } // else will get for each face in loop below
834 
835  ossim_int32 tileId = -1;
836 
837  for(ossim_uint32 idx = 0; idx < columnValues.size();++idx) // for each face feature
838  {
839  if(isTiled) // then get table names because we didn't get them above
840  {
841  if((tileId != tileIds[idx].toInt())||
842  (tileId < 0))
843  {
844  tileId = tileIds[idx].toInt();
845  ossimFilename filename = theCoverage.getLibrary()->getTileName(tileIds[idx].toInt());
846  if(theCoverage.getPath().dirCat(filename).dirCat("fac").exists())
847  {
848  primitiveTableName = theCoverage.getPath().dirCat(filename).dirCat("fac");
849  rngTableName = theCoverage.getPath().dirCat(filename).dirCat("rng");
850  edgTableName = theCoverage.getPath().dirCat(filename).dirCat("edg");
851  }
852  else if(theCoverage.getPath().dirCat(filename.downcase()).dirCat("fac").exists())
853  {
854  primitiveTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("fac");
855  rngTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("rng");
856  edgTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("edg");
857  }
858  if(!primitiveTable.openTable(primitiveTableName)||
859  !rngTable.openTable(rngTableName)||
860  !edgTable.openTable(edgTableName))
861  {
862  return;
863  }
864  // coordinateValuePosition = edgTable.getColumnPosition("coordinates");
865  startEdgePosition = rngTable.getColumnPosition("start_edge");
866  rngPtrPosition = primitiveTable.getColumnPosition("ring_ptr");
867  }
868  } // if(isTiled)
869 
870  // get the outer ring id for this face
871  int thisFaceId = columnValues[idx].toInt();
872  int rngId = -1;
873 
874  if (thisFaceId <= primitiveTable.getNumberOfRows())
875  rngId = readRngId(thisFaceId,
876  rngPtrPosition,
877  primitiveTable); // face table
878  else
879  if(traceDebug())
880  {
881  ossimNotify(ossimNotifyLevel_DEBUG) << "not getting face " << thisFaceId << " from tile " << tileId << " " << primitiveTableName <<
882  " bacause it has only " << primitiveTable.getNumberOfRows() << " rows" << endl;
883  }
884 
885  if(rngId > 0)
886  {
887  int startEdge = readStartEdgeId(rngId,
888  startEdgePosition,
889  rngTable);
890  int outerStartEdge = startEdge;
891  if(startEdge > 0 )
892  {
893  ossimGeoPolygon polygon;
894 
895  myFaceCount ++;
896 
897  int ringTableFaceIdColumn = rngTable.getColumnPosition("face_id");
898  int ringFaceId = readTableCellAsInt(rngId, ringTableFaceIdColumn, rngTable);
899 
900  if (thisFaceId != ringFaceId) {
901  // as of Mon Dec 20 2004, this has not been observed in vmap0 or vmap1
902  if(traceDebug())
903  {
904  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << thisFaceId << " from " << tableFileName <<
905  " because it's ring (" << rngId << ") has face " << ringFaceId << " and startEdgeId " << startEdge << endl;
906  }
907  } else {
908  readGeoPolygon( polygon,
909  thisFaceId,
910  startEdge,
911  edgTable );
912 
913  // get the inner rings (holes)
914  int faceIdPosition = rngTable.getColumnPosition("face_id");
915  int innerRingOffset = 1;
916  int rowFaceId = -1;
917  if (rngId + innerRingOffset <= rngTable.getNumberOfRows())
918  rowFaceId = rngTable.getColumnValueAsString( rngId + innerRingOffset, faceIdPosition ).toInt();
919  while (rowFaceId == thisFaceId && rngId + innerRingOffset <= rngTable.getNumberOfRows()) { // while there are more inner rings
920  startEdge = readStartEdgeId(rngId + innerRingOffset, startEdgePosition, rngTable);
921 
922  if (startEdge == outerStartEdge) {
923  // as of Mon Dec 20 2004, this has not been observed in vmap0 or vmap1
924  if(traceDebug())
925  {
926  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting hole in face "
927  << thisFaceId << " because inner ring "
928  << rngId + innerRingOffset
929  << " touches outer ring " << rngId << endl;
930  }
931 
932  innerRingOffset ++;
933  rowFaceId = rngTable.getColumnValueAsString( rngId + innerRingOffset, faceIdPosition ).toInt();
934  continue;
935  }
936 
937  if(startEdge > 0 )
938  {
939  ossimGeoPolygon holePolygon;
940 
941  readGeoPolygon( holePolygon,
942  thisFaceId,
943  startEdge,
944  edgTable );
945  if(holePolygon.size())
946  polygon.addHole( holePolygon );
947  }
948 
949  innerRingOffset ++;
950  if (rngId + innerRingOffset <= rngTable.getNumberOfRows())
951  rowFaceId = rngTable.getColumnValueAsString( rngId + innerRingOffset, faceIdPosition ).toInt();
952  }
953 
954  readAttributes(polygon, table, idx + 1); // third parm is one-based row
955 
956  thePolyList.push_back(polygon);
957  }
958  }
959  }
960  } // each fac_id
961  }
963  annotation->setColor(thePenColor.getR(),
964  thePenColor.getG(),
965  thePenColor.getB());
966  annotation->setThickness(theThickness);
967  annotation->setFillFlag(theFillEnabledFlag);
968 
969  theAnnotationArray.push_back(annotation);
970 }
unsigned char getR() const
int getNumberOfRows() const
ossimString getTileName(ossim_int32 id) const
void readGeoPolygon(ossimGeoPolygon &polygon, int faceId, int startEdgeId, ossimVpfTable &edgTable)
int readStartEdgeId(int rowNumber, int colNumber, ossimVpfTable &rngTable)
std::vector< ossimString > getColumnValues(const ossimString &columnName) const
virtual void setThickness(ossim_uint8 thickness)
virtual bool openTable(const ossimFilename &tableName)
ossim_int32 getColumnPosition(const ossimString &columnName) const
const ossimFilename & getPath() const
bool exists() const
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
void addHole(const ossimGeoPolygon &polygon)
unsigned char getB() const
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossim_uint32 size() const
ossimString getColumnValueAsString(row_type &row, long columnNumber) const
unsigned char getG() const
ossimFilename dirCat(const ossimFilename &file) const
void readAttributes(ossimPolyLine &polyLine, ossimVpfTable &table, int row)
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
int readTableCellAsInt(int rowNumber, int colNumber, ossimVpfTable &table)
virtual void setColor(unsigned char r, unsigned char g, unsigned char b)
int readRngId(int rowNumber, int colNumber, ossimVpfTable &faceTable)
int toInt() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimVpfLibrary * getLibrary()
int ossim_int32

◆ buildFeature()

void ossimVpfAnnotationFeatureInfo::buildFeature ( )

Definition at line 121 of file ossimVpfAnnotationFeatureInfo.cpp.

References buildEdgFeature(), buildFaceFeature(), buildPointFeature(), buildTxtFeature(), ossimString::contains(), deleteAllObjects(), ossimVpfFeatureClassSchema::getFeatureClassNode(), ossimVpfCoverage::openFeatureClassSchema(), ossimVpfAnnotationFeatureType_LINE, ossimVpfAnnotationFeatureType_POINT, ossimVpfAnnotationFeatureType_POLYGON, ossimVpfAnnotationFeatureType_TEXT, theCoverage, theEnabledFlag, theFeatureType, theName, ossimVpfFeatureClassSchemaNode::thePrimitiveTable, ossimVpfFeatureClassSchemaNode::thePrimitiveTableKey, ossimVpfFeatureClassSchemaNode::theTable, ossimVpfFeatureClassSchemaNode::theTableKey, and ossimString::trim().

Referenced by ossimVpfAnnotationCoverageInfo::buildCoverage(), loadState(), and setEnabledFlag().

122 {
124 
126 
129  if(schema.getFeatureClassNode(theName,
130  node))
131  {
132  if(node.thePrimitiveTable.contains("edg"))
133  {
135  if(theEnabledFlag)
136  {
138  node.theTableKey.trim(),
139  node.thePrimitiveTable.trim(),
140  node.thePrimitiveTableKey.trim());
141  }
142  }
143  else if(node.thePrimitiveTable.contains("txt"))
144  {
146  if(theEnabledFlag)
147  {
149  node.theTableKey.trim(),
150  node.thePrimitiveTable.trim(),
151  node.thePrimitiveTableKey.trim());
152  }
153  }
154  else if(node.thePrimitiveTable.contains("fac"))
155  {
157  if(theEnabledFlag)
158  {
160  node.theTableKey.trim(),
161  node.thePrimitiveTable.trim(),
162  node.thePrimitiveTableKey.trim());
163  }
164  }
165  else if(node.thePrimitiveTable.contains("cnd"))
166  {
168  if(theEnabledFlag)
169  {
170  buildPointFeature("cnd",
171  node.theTable.trim(),
172  node.theTableKey.trim(),
173  node.thePrimitiveTable.trim(),
174  node.thePrimitiveTableKey.trim());
175  }
176  }
177  else if(node.thePrimitiveTable.contains("end"))
178  {
180  if(theEnabledFlag)
181  {
182  buildPointFeature("end",
183  node.theTable.trim(),
184  node.theTableKey.trim(),
185  node.thePrimitiveTable.trim(),
186  node.thePrimitiveTableKey.trim());
187  }
188  }
189  else
190  {
191  if(traceDebug())
192  {
193  ossimNotify(ossimNotifyLevel_DEBUG) << "Primitive \""<<node.thePrimitiveTable<<"\" not handled yet" << endl;
194  }
195  }
196  }
197 }
void buildPointFeature(const ossimString &primitiveName, const ossimFilename &table, const ossimString &tableKey, const ossimFilename &primitive, const ossimString &primitiveKey)
bool contains(char aChar) const
Definition: ossimString.h:58
bool openFeatureClassSchema(ossimVpfFeatureClassSchema &schema)
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
ossimVpfAnnotationFeatureType theFeatureType
void buildEdgFeature(const ossimFilename &table, const ossimString &tableKey, const ossimFilename &primitive, const ossimString &primitiveKey)
void buildFaceFeature(const ossimFilename &table, const ossimString &tableKey, const ossimFilename &primitive, const ossimString &primitiveKey)
void buildTxtFeature(const ossimFilename &table, const ossimString &tableKey, const ossimFilename &primitive, const ossimString &primitiveKey)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
bool getFeatureClassNode(const ossimString &featureClass, ossimVpfFeatureClassSchemaNode &featureClassNode) const

◆ buildPointFeature()

void ossimVpfAnnotationFeatureInfo::buildPointFeature ( const ossimString primitiveName,
const ossimFilename table,
const ossimString tableKey,
const ossimFilename primitive,
const ossimString primitiveKey 
)
protected

Definition at line 694 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimFilename::dirCat(), ossimString::downcase(), ossimFilename::exists(), free_row(), ossimRgbVector::getB(), ossimVpfTable::getColumnPosition(), ossimVpfTable::getColumnValues(), ossimRgbVector::getG(), ossimVpfCoverage::getLibrary(), ossimVpfCoverage::getPath(), ossimRgbVector::getR(), ossimVpfLibrary::getTileName(), ossimVpfTable::getVpfTableData(), getXy(), ossim::nan(), ossimVpfTable::openTable(), read_row(), ossimGeoAnnotationMultiEllipseObject::setColor(), ossimGeoAnnotationMultiEllipseObject::setFillFlag(), ossimGeoAnnotationMultiEllipseObject::setThickness(), ossimGeoAnnotationMultiEllipseObject::setWidthHeight(), theAnnotationArray, theCoverage, theFillEnabledFlag, thePenColor, thePointRadius, theThickness, ossimString::trim(), x, and y.

Referenced by buildFeature().

699 {
700  ossimFilename tableFileName = theCoverage.getPath().dirCat(tableName);
701  ossimFilename primitiveTableName;
702  ossimVpfTable table;
703  ossimVpfTable primitiveTable;
704 
705  std::vector<ossimGpt> centerPointArray;
706 
707  if(table.openTable(tableFileName))
708  {
709 
710  vector<ossimString> columnValues = table.getColumnValues(tableKey.trim());
711  vector<ossimString> tileIds;
712  bool isTiled = false;
713  if(table.getColumnPosition("tile_id") >= 0)
714  {
715  tileIds = table.getColumnValues("tile_id");
716  isTiled = true;
717  }
718  ossim_int32 coordinateValuePosition = 0;
719  if(!isTiled)
720  {
721  primitiveTableName = theCoverage.getPath().dirCat(primitiveName);
722  if(!primitiveTable.openTable(primitiveTableName))
723  {
724  return;
725  }
726  coordinateValuePosition = primitiveTable.getColumnPosition("coordinate");
727  }
728  ossim_int32 tileId = -1;
729  for(ossim_uint32 idx = 0; idx < columnValues.size();++idx)
730  {
731  if(isTiled)
732  {
733  if(tileId != tileIds[idx].toInt())
734  {
735  tileId = tileIds[idx].toInt();
736  ossimFilename filename = theCoverage.getLibrary()->getTileName(tileIds[idx].toInt());
737  if(theCoverage.getPath().dirCat(filename).dirCat(primitiveName).exists())
738  {
739  primitiveTableName = theCoverage.getPath().dirCat(filename).dirCat(primitiveName);
740  }
741  else if(theCoverage.getPath().dirCat(filename.downcase()).dirCat(primitiveName).exists())
742  {
743  primitiveTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat(primitiveName);
744  }
745  if(!primitiveTable.openTable(primitiveTableName))
746  {
747  return;
748  }
749  coordinateValuePosition = primitiveTable.getColumnPosition("coordinate");
750  }
751  }
752  row_type row = read_row( columnValues[idx].toInt(),
753  *primitiveTable.getVpfTableData());
754 
755  ossim_int32 count = 0;
756  ossimDpt* ptArray = getXy(*primitiveTable.getVpfTableData(),
757  row,
758  coordinateValuePosition,
759  &count);
760 
761  if(ptArray)
762  {
763  for(int i = 0; i < count; ++i)
764  {
765  if((fabs(ptArray[i].x) <= 180.0)&&
766  (fabs(ptArray[i].y) <= 90.0))
767  {
768  centerPointArray.push_back(ossimGpt(ptArray[i].lat,
769  ptArray[i].lon,
770  ossim::nan()));
771  }
772  }
773  delete [] ptArray;
774  }
775  free_row(row, *primitiveTable.getVpfTableData());
776  }
777  }
779  ossimDpt(2,2));
780  annotation->setColor(thePenColor.getR(),
781  thePenColor.getG(),
782  thePenColor.getB());
783  annotation->setThickness(theThickness);
784  annotation->setFillFlag(theFillEnabledFlag);
785  annotation->setWidthHeight(thePointRadius);
786  theAnnotationArray.push_back(annotation);
787 }
ossim_uint32 x
void free_row(row_type row, vpf_table_type table)
unsigned char getR() const
ossim_uint32 y
ossimString getTileName(ossim_int32 id) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
row_type read_row(ossim_int32 row_number, vpf_table_type table)
std::vector< ossimString > getColumnValues(const ossimString &columnName) const
virtual bool openTable(const ossimFilename &tableName)
ossim_int32 getColumnPosition(const ossimString &columnName) const
ossimDpt * getXy(vpf_table_type table, row_type row, ossim_int32 pos, ossim_int32 *count)
const ossimFilename & getPath() const
bool exists() const
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
unsigned char getB() const
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual void setColor(unsigned char r, unsigned char g, unsigned char b)
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61
unsigned char getG() const
virtual void setWidthHeight(const ossimDpt &widthHeight)
ossimFilename dirCat(const ossimFilename &file) const
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
ossimVpfLibrary * getLibrary()
int ossim_int32

◆ buildTxtFeature()

void ossimVpfAnnotationFeatureInfo::buildTxtFeature ( const ossimFilename table,
const ossimString tableKey,
const ossimFilename primitive,
const ossimString primitiveKey 
)
protected

Definition at line 506 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimFontFactoryRegistry::createFont(), ossimFilename::dirCat(), ossimString::downcase(), ossimFilename::exists(), free_row(), ossimRgbVector::getB(), ossimVpfTable::getColumnPosition(), ossimVpfTable::getColumnValueAsString(), ossimVpfTable::getColumnValues(), ossimRgbVector::getG(), ossimVpfCoverage::getLibrary(), ossimVpfCoverage::getPath(), ossimRgbVector::getR(), ossimVpfLibrary::getTileName(), ossimVpfTable::getVpfTableData(), getXy(), ossimFontFactoryRegistry::instance(), ossim::nan(), ossimVpfTable::openTable(), read_row(), ossimVpfTable::reset(), ossimGeoAnnotationFontObject::setColor(), ossimGeoAnnotationFontObject::setFont(), ossimGeoAnnotationFontObject::setPointSize(), ossimGeoAnnotationFontObject::setRotation(), ossimGeoAnnotationFontObject::setScale(), ossimGeoAnnotationFontObject::setShear(), ossimAnnotationObject::setThickness(), theAnnotationArray, theCoverage, theFontInformation, thePenColor, ossimFontInformation::thePointSize, ossimFontInformation::theRotation, ossimFontInformation::theScale, ossimFontInformation::theShear, theThickness, and ossimString::trim().

Referenced by buildFeature().

510 {
511  ossimFilename tableFileName = theCoverage.getPath().dirCat(tableName);
512  ossimFilename primitiveTableName;
513  ossimVpfTable table;
514  ossimVpfTable primitiveTable;
515 
516  if(table.openTable(tableFileName))
517  {
518  table.reset();
519  vector<ossimString> columnValues = table.getColumnValues(tableKey.trim());
520 
521  primitiveTableName = theCoverage.getPath().dirCat("txt");
522 
523  vector<ossimString> tileIds;
524  ossim_int32 stringValuePosition = 0;
525  ossim_int32 shapeLinePosition = 0;
526  bool isTiled = false;
527  if(table.getColumnPosition("tile_id") >= 0)
528  {
529  tileIds = table.getColumnValues("tile_id");
530  isTiled = true;
531  }
532  if(!isTiled)
533  {
534  primitiveTableName = theCoverage.getPath().dirCat("txt");
535  if(!primitiveTable.openTable(primitiveTableName))
536  {
537  return;
538  }
539  stringValuePosition = primitiveTable.getColumnPosition("string");
540  shapeLinePosition = primitiveTable.getColumnPosition("shape_line");
541  }
542  ossim_int32 tileId = -1;
543  for(ossim_uint32 idx = 0; idx < columnValues.size();++idx)
544  {
545  if(isTiled)
546  {
547  if(tileId != tileIds[idx].toInt())
548  {
549  tileId = tileIds[idx].toInt();
550  ossimFilename filename = theCoverage.getLibrary()->getTileName(tileIds[idx].toInt());
551  if(theCoverage.getPath().dirCat(filename).dirCat("txt").exists())
552  {
553  primitiveTableName = theCoverage.getPath().dirCat(filename).dirCat("txt");
554  }
555  else if(theCoverage.getPath().dirCat(filename.downcase()).dirCat("txt").exists())
556  {
557  primitiveTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("txt");
558  }
559  if(!primitiveTable.openTable(primitiveTableName))
560  {
561  return;
562  }
563  stringValuePosition = primitiveTable.getColumnPosition("string");
564  shapeLinePosition = primitiveTable.getColumnPosition("shape_line");
565  }
566  }
567  row_type row = read_row( columnValues[idx].toInt(),
568  *primitiveTable.getVpfTableData());
569  ossim_int32 count = 0;
570  ossimDpt* ptArray = getXy(*primitiveTable.getVpfTableData(),
571  row,
572  shapeLinePosition,
573  &count);
574  ossimDpt midPoint;
575  if(ptArray)
576  {
577  midPoint = *ptArray;
578 
579  delete [] ptArray;
580  }
581  ossimString stringValue = primitiveTable.getColumnValueAsString(row,
582  stringValuePosition);
583  free_row(row, *primitiveTable.getVpfTableData());
584 
585  if(!midPoint.hasNans())
586  {
587  ossimGpt centerPoint(midPoint.lat,
588  midPoint.lon,
589  ossim::nan());
591  ossimGeoAnnotationFontObject* annotation = new ossimGeoAnnotationFontObject(centerPoint,
592  stringValue);
593  annotation->setColor(thePenColor.getR(),
594  thePenColor.getG(),
595  thePenColor.getB());
596  annotation->setThickness(theThickness);
597 
598  annotation->setFont(font);
600  annotation->setScale(theFontInformation.theScale);
601  annotation->setShear(theFontInformation.theShear);
603  theAnnotationArray.push_back(annotation);
604  }
605  }
606  }
607 }
void free_row(row_type row, vpf_table_type table)
virtual void setShear(const ossimDpt &shear)
unsigned char getR() const
virtual void setThickness(ossim_uint8 thickness)
ossimString getTileName(ossim_int32 id) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
virtual void setColor(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
row_type read_row(ossim_int32 row_number, vpf_table_type table)
virtual void setRotation(double rotation)
std::vector< ossimString > getColumnValues(const ossimString &columnName) const
virtual bool openTable(const ossimFilename &tableName)
ossim_int32 getColumnPosition(const ossimString &columnName) const
ossimDpt * getXy(vpf_table_type table, row_type row, ossim_int32 pos, ossim_int32 *count)
const ossimFilename & getPath() const
bool exists() const
virtual void setPointSize(const ossimIpt &size)
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
unsigned char getB() const
ossimFont * createFont(const ossimFontInformation &information) const
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual void reset() const
ossimString getColumnValueAsString(row_type &row, long columnNumber) const
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61
unsigned char getG() const
static ossimFontFactoryRegistry * instance()
ossimFilename dirCat(const ossimFilename &file) const
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
virtual void setScale(const ossimDpt &scale)
ossimVpfLibrary * getLibrary()
int ossim_int32

◆ deleteAllObjects()

void ossimVpfAnnotationFeatureInfo::deleteAllObjects ( )

Definition at line 420 of file ossimVpfAnnotationFeatureInfo.cpp.

References theAnnotationArray.

Referenced by buildFeature(), loadState(), setEnabledFlag(), and ~ossimVpfAnnotationFeatureInfo().

421 {
422  theAnnotationArray.clear();
423 }
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray

◆ drawAnnotations()

void ossimVpfAnnotationFeatureInfo::drawAnnotations ( ossimRgbImage tile)

Definition at line 199 of file ossimVpfAnnotationFeatureInfo.cpp.

References theAnnotationArray, and theEnabledFlag.

200 {
201  if(theEnabledFlag)
202  {
203  int idx = 0;
204  for(idx = 0; idx < (int)theAnnotationArray.size(); ++idx)
205  {
206  theAnnotationArray[idx]->draw(*tile);
207  }
208  }
209 }
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray

◆ getBoundingProjectedRect()

ossimIrect ossimVpfAnnotationFeatureInfo::getBoundingProjectedRect ( ) const

Definition at line 77 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimIrect::combine(), ossimIrect::hasNans(), ossimIrect::makeNan(), theAnnotationArray, and theEnabledFlag.

78 {
79  ossimIrect result;
80  result.makeNan();
81 
82  if(theEnabledFlag)
83  {
84  for(int idx = 0; idx < (int)theAnnotationArray.size();++idx)
85  {
86  if(theAnnotationArray[idx].valid())
87  {
88  ossimIrect tempRect = theAnnotationArray[idx]->getBoundingRect();
89  if(!tempRect.hasNans())
90  {
91  if(result.hasNans())
92  {
93  result = tempRect;
94  }
95  else
96  {
97  result = result.combine(tempRect);
98  }
99  }
100  }
101  }
102  }
103 
104  return result;
105 }
void makeNan()
Definition: ossimIrect.h:329
bool hasNans() const
Definition: ossimIrect.h:337
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
ossimIrect combine(const ossimIrect &rect) const
Definition: ossimIrect.cpp:543

◆ getBrushColor()

ossimRgbVector ossimVpfAnnotationFeatureInfo::getBrushColor ( ) const
inline

Definition at line 80 of file ossimVpfAnnotationFeatureInfo.h.

81  {
82  return theBrushColor;
83  }

◆ getCoverage() [1/2]

const ossimVpfCoverage& ossimVpfAnnotationFeatureInfo::getCoverage ( ) const
inline

Definition at line 51 of file ossimVpfAnnotationFeatureInfo.h.

52  {
53  return theCoverage;
54  }

◆ getCoverage() [2/2]

ossimVpfCoverage& ossimVpfAnnotationFeatureInfo::getCoverage ( )
inline

Definition at line 55 of file ossimVpfAnnotationFeatureInfo.h.

56  {
57  return theCoverage;
58  }

◆ getEdgeKeyId()

int ossimVpfAnnotationFeatureInfo::getEdgeKeyId ( vpf_table_type table,
row_type row,
int  col 
)
protected

Definition at line 1144 of file ossimVpfAnnotationFeatureInfo.cpp.

References get_table_element(), and id_triplet_type::id.

Referenced by readGeoPolygon().

1144  {
1145  id_triplet_type key;
1146  ossim_int32 keyCount;
1147  get_table_element( col,
1148  row,
1149  table,
1150  & key,
1151  & keyCount );
1152  return key.id;
1153 }
ossim_int32 id
Definition: vpftable.h:216
void * get_table_element(ossim_int32 field_number, row_type row, vpf_table_type table, void *value, ossim_int32 *count)
int ossim_int32

◆ getEnabledFlag()

bool ossimVpfAnnotationFeatureInfo::getEnabledFlag ( ) const
inline

Definition at line 94 of file ossimVpfAnnotationFeatureInfo.h.

◆ getFeatureTypeAsString()

ossimString ossimVpfAnnotationFeatureInfo::getFeatureTypeAsString ( ) const

◆ getFeatureTypeFromString()

ossimVpfAnnotationFeatureInfo::ossimVpfAnnotationFeatureType ossimVpfAnnotationFeatureInfo::getFeatureTypeFromString ( const ossimString featureType) const

Definition at line 394 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimString::contains(), ossimString::downcase(), ossimVpfAnnotationFeatureType_LINE, ossimVpfAnnotationFeatureType_POINT, ossimVpfAnnotationFeatureType_POLYGON, ossimVpfAnnotationFeatureType_TEXT, and ossimVpfAnnotationFeatureType_UNKNOWN.

395 {
396  ossimString downCased = featureType;
397  downCased = downCased.downcase();
398 
399  if(downCased.contains("point"))
400  {
402  }
403  else if(downCased.contains("line"))
404  {
406  }
407  else if(downCased.contains("polygon"))
408  {
410  }
411  else if(downCased.contains("text"))
412  {
414  }
415 
417 
418 }
bool contains(char aChar) const
Definition: ossimString.h:58
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48

◆ getFillEnabledFlag()

bool ossimVpfAnnotationFeatureInfo::getFillEnabledFlag ( ) const
inline

Definition at line 89 of file ossimVpfAnnotationFeatureInfo.h.

◆ getFontInformation()

void ossimVpfAnnotationFeatureInfo::getFontInformation ( ossimFontInformation fontInfo) const
inline

Definition at line 134 of file ossimVpfAnnotationFeatureInfo.h.

135  {
136  fontInfo = theFontInformation;
137  }

◆ getName()

const ossimString& ossimVpfAnnotationFeatureInfo::getName ( ) const
inline

Definition at line 113 of file ossimVpfAnnotationFeatureInfo.h.

114  {
115  return theName;
116  }

◆ getPenColor()

ossimRgbVector ossimVpfAnnotationFeatureInfo::getPenColor ( ) const
inline

Definition at line 70 of file ossimVpfAnnotationFeatureInfo.h.

71  {
72  return thePenColor;
73  }

◆ getPointRadius()

ossimDpt ossimVpfAnnotationFeatureInfo::getPointRadius ( ) const
inline

Definition at line 147 of file ossimVpfAnnotationFeatureInfo.h.

148  {
149  return thePointRadius;
150  }

◆ getThickness()

int ossimVpfAnnotationFeatureInfo::getThickness ( ) const
inline

Definition at line 104 of file ossimVpfAnnotationFeatureInfo.h.

105  {
106  return theThickness;
107  }

◆ getXy()

ossimDpt * ossimVpfAnnotationFeatureInfo::getXy ( vpf_table_type  table,
row_type  row,
ossim_int32  pos,
ossim_int32 count 
)
protected

Definition at line 983 of file ossimVpfAnnotationFeatureInfo.cpp.

References get_table_element(), vpf_table_type::header, header_cell::type, coordinate_type::x, double_coordinate_type::x, tri_coordinate_type::x, double_tri_coordinate_type::x, ossimDpt::x, x, coordinate_type::y, double_coordinate_type::y, tri_coordinate_type::y, double_tri_coordinate_type::y, ossimDpt::y, and y.

Referenced by buildPointFeature(), buildTxtFeature(), and readEdge().

987 {
988  ossim_int32 i;
989  ossimDpt *coord = 0;
990 
991  switch (table.header[pos].type)
992  {
993  case 'C':
994  {
995  coordinate_type temp, *ptr;
996  ptr = (coordinate_type*)get_table_element(pos, row, table, &temp, count);
997  coord = new ossimDpt[*count];
998  if ((*count == 1) && (ptr == (coordinate_type*)0))
999  {
1000  coord->x = (double)temp.x;
1001  coord->y = (double)temp.y;
1002  }
1003  else
1004  {
1005  for (i=0; i<*count; i++)
1006  {
1007  coord[i].x = (double)ptr[i].x;
1008  coord[i].y = (double)ptr[i].y;
1009  }
1010  }
1011  if (ptr)
1012  {
1013  free((char *)ptr);
1014  }
1015  break;
1016  }
1017  case 'Z':
1018  {
1019  tri_coordinate_type temp, *ptr;
1020  ptr = (tri_coordinate_type*)get_table_element (pos, row, table, &temp, count);
1021  coord = new ossimDpt[*count];
1022  if ((*count == 1) && (ptr == (tri_coordinate_type*)0))
1023  {
1024  coord->x = (double)temp.x;
1025  coord->y = (double)temp.y;
1026  }
1027  else
1028  {
1029  for (i=0; i<*count; i++)
1030  {
1031  coord[i].x = (double)ptr[i].x;
1032  coord[i].y = (double)ptr[i].y;
1033  }
1034  }
1035  if (ptr)
1036  {
1037  free ((char*)ptr);
1038  }
1039  break;
1040  }
1041  case 'B':
1042  {
1043  double_coordinate_type temp, *ptr;
1044  ptr = (double_coordinate_type*)get_table_element (pos, row, table, &temp, count);
1045  coord = new ossimDpt[*count];
1046  if ((*count == 1) && (ptr == (double_coordinate_type*)0))
1047  {
1048  coord->x = temp.x;
1049  coord->y = temp.y;
1050  }
1051  else
1052  {
1053  for (i=0; i<*count; i++)
1054  {
1055  coord[i].x = ptr[i].x;
1056  coord[i].y = ptr[i].y;
1057  }
1058  }
1059  if (ptr)
1060  {
1061  free ((char*)ptr);
1062  }
1063  break;
1064  }
1065  case 'Y':
1066  {
1067  double_tri_coordinate_type temp, *ptr;
1068  ptr = (double_tri_coordinate_type*)get_table_element (pos, row, table, &temp, count);
1069  coord = new ossimDpt[*count];
1070  if ((*count == 1) && (ptr == (double_tri_coordinate_type*)0))
1071  {
1072  coord->x = temp.x;
1073  coord->y = temp.y;
1074  }
1075  else
1076  {
1077  for (i=0; i<*count; i++)
1078  {
1079  coord[i].x = ptr[i].x;
1080  coord[i].y = ptr[i].y;
1081  }
1082  }
1083  if (ptr)
1084  {
1085  free((char*)ptr);
1086  }
1087  break;
1088  }
1089 
1090  default:
1091  break;
1092  } /* switch type */
1093  return (coord);
1094 }
ossim_uint32 x
ossim_uint32 y
double y
Definition: ossimDpt.h:165
header_type header
Definition: vpftable.h:109
void * get_table_element(ossim_int32 field_number, row_type row, vpf_table_type table, void *value, ossim_int32 *count)
double x
Definition: ossimDpt.h:164
char type
Definition: vpftable.h:68
int ossim_int32

◆ isLine()

bool ossimVpfAnnotationFeatureInfo::isLine ( ) const
inline

◆ isPoint()

bool ossimVpfAnnotationFeatureInfo::isPoint ( ) const
inline

◆ isPolygon()

bool ossimVpfAnnotationFeatureInfo::isPolygon ( ) const
inline

◆ isText()

bool ossimVpfAnnotationFeatureInfo::isText ( ) const
inline

◆ loadState()

bool ossimVpfAnnotationFeatureInfo::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of the object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 284 of file ossimVpfAnnotationFeatureInfo.cpp.

References buildFeature(), deleteAllObjects(), ossimKeywordlist::find(), ossimFontInformation::loadState(), ossimRgbVector::setB(), setDrawingFeaturesToAnnotation(), ossimRgbVector::setG(), ossimRgbVector::setR(), theAnnotationArray, theBrushColor, theDescription, theEnabledFlag, theFillEnabledFlag, theFontInformation, theName, thePenColor, thePointRadius, theThickness, ossimString::toBool(), ossimString::toInt(), ossimDpt::x, and ossimDpt::y.

Referenced by ossimVpfAnnotationCoverageInfo::loadState().

286 {
287  const char* name = kwl.find(prefix, "name");
288  const char* description = kwl.find(prefix, "description");
289  const char* enabled = kwl.find(prefix, "enabled");
290  const char* fillEnabled = kwl.find(prefix, "fill_enabled");
291  const char* thickness = kwl.find(prefix, "thickness");
292  const char* pointRadius = kwl.find(prefix, "point_radius");
293  const char* brushColor = kwl.find(prefix, "brush_color");
294  const char* penColor = kwl.find(prefix, "pen_color");
295 
297  (ossimString(prefix)+"font.").c_str());
298 
299  if(name)
300  {
301  if(theName != name)
302  {
304  }
305  theName = name;
306  }
307  if(description)
308  {
309  theDescription = description;
310  }
311  if(enabled)
312  {
313  theEnabledFlag = ossimString(enabled).toBool();
314 
315  if(!theEnabledFlag)
316  {
318  }
319  }
320 
321  if(fillEnabled)
322  {
323  theFillEnabledFlag = ossimString(fillEnabled).toBool();
324  }
325  if(thickness)
326  {
327  theThickness = ossimString(thickness).toInt();
328  }
329  if(pointRadius)
330  {
331  stringstream ptRadiusStream(pointRadius);
332  ptRadiusStream >> thePointRadius.x >> thePointRadius.y;
333  }
334  if(brushColor)
335  {
336  int r, g, b;
337  stringstream colorStream(brushColor);
338  colorStream >> r >> g >> b;
339 
343  }
344  if(penColor)
345  {
346  int r, g, b;
347  stringstream colorStream(penColor);
348  colorStream >> r >> g >> b;
349 
353  }
354 
355  if(theEnabledFlag&&(theAnnotationArray.size() < 1))
356  {
357  buildFeature();
358  }
359  else
360  {
362  }
363 
364  return true;
365 }
std::basic_stringstream< char > stringstream
Class for char mixed input and output memory streams.
Definition: ossimIosFwd.h:38
const char * find(const char *key) const
void setR(unsigned char R)
double y
Definition: ossimDpt.h:165
void setB(unsigned char B)
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
bool toBool() const
String to numeric methods.
void setG(unsigned char G)
double x
Definition: ossimDpt.h:164
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
unsigned char ossim_uint8
int toInt() const

◆ readAttributes() [1/2]

void ossimVpfAnnotationFeatureInfo::readAttributes ( ossimPolyLine polyLine,
ossimVpfTable table,
int  row 
)
private

Definition at line 686 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimPolyLine::addAttribute(), ossimVpfTable::getColumnValueAsString(), and ossimVpfTable::getNumberOfColumns().

Referenced by buildEdgFeature().

686  {
687  int numCols = table.getNumberOfColumns();
688 
689  for (int col = 0; col < numCols; col ++) {
690  polyLine.addAttribute( table.getColumnValueAsString( row, col ));
691  }
692 }
int getNumberOfColumns() const
ossimString getColumnValueAsString(row_type &row, long columnNumber) const
void addAttribute(const ossimString &attribute)

◆ readAttributes() [2/2]

void ossimVpfAnnotationFeatureInfo::readAttributes ( ossimGeoPolygon polygon,
ossimVpfTable table,
int  row 
)
private

Definition at line 972 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimGeoPolygon::addAttribute(), ossimVpfTable::getColumnValueAsString(), and ossimVpfTable::getNumberOfColumns().

972  {
973  int numCols = table.getNumberOfColumns();
974 
975  for (int col = 0; col < numCols; col ++) {
976  ossimString s = table.getColumnValueAsString( row, col );
977  polygon.addAttribute( s );
978  }
979 }
int getNumberOfColumns() const
ossimString getColumnValueAsString(row_type &row, long columnNumber) const
void addAttribute(const ossimString &attribute)

◆ readEdge()

void ossimVpfAnnotationFeatureInfo::readEdge ( ossimPolyLine polyLine,
int  rowNumber,
int  colPosition,
ossimVpfTable edgeTable 
)
protected

Definition at line 1415 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimPolyLine::addPoint(), ossimPolyLine::clear(), free_row(), ossimVpfTable::getVpfTableData(), getXy(), read_row(), x, and y.

Referenced by buildEdgFeature().

1419 {
1420  polyLine.clear();
1421  row_type row = read_row( rowNumber,
1422  *edgeTable.getVpfTableData());
1423 
1424  ossim_int32 count = 0;
1425  ossimDpt* ptArray = getXy(*edgeTable.getVpfTableData(),
1426  row,
1427  colPosition,
1428  &count);
1429 
1430  if(ptArray)
1431  {
1432  for(int i = 0; i < count; ++i)
1433  {
1434  if((fabs(ptArray[i].x) <= 180.0)&&
1435  (fabs(ptArray[i].y) <= 90.0))
1436  {
1437  polyLine.addPoint(ossimDpt(ptArray[i].x,
1438  ptArray[i].y));
1439  }
1440  }
1441  delete [] ptArray;
1442  }
1443  free_row(row, *edgeTable.getVpfTableData());
1444 }
ossim_uint32 x
void free_row(row_type row, vpf_table_type table)
ossim_uint32 y
row_type read_row(ossim_int32 row_number, vpf_table_type table)
ossimDpt * getXy(vpf_table_type table, row_type row, ossim_int32 pos, ossim_int32 *count)
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61
void addPoint(const ossimDpt &pt)
int ossim_int32

◆ readGeoPolygon()

void ossimVpfAnnotationFeatureInfo::readGeoPolygon ( ossimGeoPolygon polygon,
int  faceId,
int  startEdgeId,
ossimVpfTable edgTable 
)
protected

Definition at line 1155 of file ossimVpfAnnotationFeatureInfo.cpp.

References free_row(), ossimVpfTable::getColumnPosition(), ossimVpfTable::getColumnValueAsString(), getEdgeKeyId(), ossimVpfTable::getVpfTableData(), read_row(), and ossimString::toInt().

1158  {
1159 
1160  ossim_int32 coordinatesCol = edgTable.getColumnPosition( "coordinates" );
1161  ossim_int32 startNodeCol = edgTable.getColumnPosition( "start_node" );
1162  ossim_int32 endNodeCol = edgTable.getColumnPosition( "end_node" );
1163  ossim_int32 rightEdgeCol = edgTable.getColumnPosition( "right_edge" );
1164  ossim_int32 leftEdgeCol = edgTable.getColumnPosition( "left_edge" );
1165  ossim_int32 rightFaceCol = edgTable.getColumnPosition( "right_face" );
1166  ossim_int32 leftFaceCol = edgTable.getColumnPosition( "left_face" );
1167 
1168  // collect edges
1169  vector < int > edges;
1170  int lastEdge = startEdgeId;
1171  edges.push_back( lastEdge );
1172 
1173  row_type row = read_row( startEdgeId, *edgTable.getVpfTableData() );
1174  int startNode = edgTable.getColumnValueAsString( row, startNodeCol ).toInt();
1175  int endNode = edgTable.getColumnValueAsString( row, endNodeCol ).toInt();
1176 
1177  if (startNode != endNode) { // there's more than one edge to this ring
1178  int rightFace = getEdgeKeyId( *edgTable.getVpfTableData(), row, rightFaceCol );
1179  int leftFace = getEdgeKeyId( *edgTable.getVpfTableData(), row, leftFaceCol );
1180  int rightEdge = getEdgeKeyId( *edgTable.getVpfTableData(), row, rightEdgeCol );
1181  int leftEdge = getEdgeKeyId( *edgTable.getVpfTableData(), row, leftEdgeCol );
1182  int nextEdge;
1183  int firstNode, lastNode;
1184 
1185  if (rightFace == leftFace) {
1186  if (rightEdge == leftEdge) {
1187  free_row(row, *edgTable.getVpfTableData());
1188  // as of Mon Dec 20 2004, this has not been observed in vmap0 or vmap1
1189  // cout << "rejecting floating line face " << faceId << " line " << __LINE__ << endl;
1190  return;
1191  }
1192 
1193  // this is a dangling start edge; find a non dangling edge to use as the start edge
1194  int dirRight = 1;
1195  int nextEdge = startEdgeId;
1196  int nextLeftFace = leftFace;
1197  int nextRightFace = rightFace;
1198  int mobiusLimit = 1000;
1199 
1200  while (nextLeftFace == nextRightFace) {
1201  if (-- mobiusLimit < 0) {
1202  free_row(row, *edgTable.getVpfTableData());
1203  if(traceDebug())
1204  {
1205  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting mobius face " << faceId << " line " << __LINE__ << endl;
1206  }
1207  return;
1208  }
1209 
1210  int thisEdge = nextEdge;
1211  if (dirRight) {
1212  nextEdge = getEdgeKeyId( *edgTable.getVpfTableData(), row, rightEdgeCol );
1213  if (nextEdge == thisEdge)
1214  dirRight = 0;
1215  else if (nextEdge == startEdgeId) {
1216  free_row(row, *edgTable.getVpfTableData());
1217  if(traceDebug())
1218  {
1219  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting mobius face " << faceId << " line " << __LINE__ << endl;
1220  }
1221  return;
1222  }
1223  } else {
1224  nextEdge = getEdgeKeyId( *edgTable.getVpfTableData(), row, leftEdgeCol );
1225  if (nextEdge == thisEdge) {
1226  free_row(row, *edgTable.getVpfTableData());
1227  // as of Mon Dec 20 2004, this has not been observed in vmap0 or vmap1
1228  // cout << "rejecting multi floating line face " << faceId << " line " << __LINE__ << endl;
1229  return;
1230  } else if (nextEdge == startEdgeId) {
1231  free_row(row, *edgTable.getVpfTableData());
1232  if(traceDebug())
1233  {
1234  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting mobius face " << faceId << " line " << __LINE__ << endl;
1235  }
1236  return;
1237  }
1238  }
1239  free_row(row, *edgTable.getVpfTableData());
1240  row = read_row( nextEdge, *edgTable.getVpfTableData() );
1241  nextRightFace = getEdgeKeyId( *edgTable.getVpfTableData(), row, rightFaceCol );
1242  nextLeftFace = getEdgeKeyId( *edgTable.getVpfTableData(), row, leftFaceCol );
1243  }
1244 
1245  startEdgeId = nextEdge;
1246  rightFace = nextRightFace;
1247  leftFace = nextLeftFace;
1248  free_row(row, *edgTable.getVpfTableData());
1249  row = read_row( startEdgeId, *edgTable.getVpfTableData() );
1250  startNode = edgTable.getColumnValueAsString( row, startNodeCol ).toInt();
1251  endNode = edgTable.getColumnValueAsString( row, endNodeCol ).toInt();
1252  }
1253 
1254  if (rightFace == faceId) {
1255  nextEdge = getEdgeKeyId( *edgTable.getVpfTableData(), row, rightEdgeCol );
1256  firstNode = startNode;
1257  lastNode = endNode;
1258  } else if (leftFace == faceId) {
1259  nextEdge = getEdgeKeyId( *edgTable.getVpfTableData(), row, leftEdgeCol );
1260  firstNode = endNode;
1261  lastNode = startNode;
1262  }
1263  else
1264  {
1265  if(traceDebug())
1266  {
1267  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << faceId << " line " << __LINE__ << endl;
1268  }
1269  return;
1270  }
1271 
1272  row_type nextRow;
1273  while (true) {
1274  nextRow = read_row( nextEdge, *edgTable.getVpfTableData() );
1275  int nextLeftEdge = getEdgeKeyId( *edgTable.getVpfTableData(), nextRow, leftEdgeCol );
1276  int nextRightEdge = getEdgeKeyId( *edgTable.getVpfTableData(), nextRow, rightEdgeCol );
1277  int nextLeftFace = getEdgeKeyId( *edgTable.getVpfTableData(), nextRow, leftFaceCol );
1278  int nextRightFace = getEdgeKeyId( *edgTable.getVpfTableData(), nextRow, rightFaceCol );
1279  int nextStartNode = edgTable.getColumnValueAsString( nextRow, startNodeCol ).toInt();
1280  int nextEndNode = edgTable.getColumnValueAsString( nextRow, endNodeCol ).toInt();
1281 
1282  while (nextLeftFace == nextRightFace) {
1283  int lastEnd;
1284  if (rightFace == faceId)
1285  lastEnd = edgTable.getColumnValueAsString( row, endNodeCol ).toInt();
1286  else
1287  lastEnd = edgTable.getColumnValueAsString( row, startNodeCol ).toInt();
1288 
1289  if (lastEnd == nextStartNode)
1290  nextEdge = nextLeftEdge;
1291  else if (lastEnd == nextEndNode)
1292  nextEdge = nextRightEdge;
1293  else { // bad face
1294  if(traceDebug())
1295  {
1296  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << faceId << " line " << __LINE__ << endl;
1297  }
1298  return;
1299  }
1300  if (lastEdge == nextEdge)
1301  { // bad face
1302  if(traceDebug())
1303  {
1304  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << faceId << " line " << __LINE__ << endl;
1305  }
1306  return;
1307  }
1308 
1309  free_row(nextRow, *edgTable.getVpfTableData());
1310  nextRow = read_row( nextEdge, *edgTable.getVpfTableData() );
1311  nextLeftEdge = getEdgeKeyId( *edgTable.getVpfTableData(), nextRow, leftEdgeCol );
1312  nextRightEdge = getEdgeKeyId( *edgTable.getVpfTableData(), nextRow, rightEdgeCol );
1313  nextLeftFace = getEdgeKeyId( *edgTable.getVpfTableData(), nextRow, leftFaceCol );
1314  nextRightFace = getEdgeKeyId( *edgTable.getVpfTableData(), nextRow, rightFaceCol );
1315  nextStartNode = edgTable.getColumnValueAsString( nextRow, startNodeCol ).toInt();
1316  nextEndNode = edgTable.getColumnValueAsString( nextRow, endNodeCol ).toInt();
1317  }
1318 
1319  lastEdge = nextEdge;
1320  edges.push_back( lastEdge );
1321 
1322  {
1323  int lastEnd;
1324  if (nextRightFace == faceId) {
1325  if (lastNode != nextStartNode) {
1326  if(traceDebug())
1327  {
1328  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << faceId << " line " << __LINE__ << endl;
1329  }
1330  return;
1331  }
1332  lastEnd = nextEndNode;
1333  } else if (nextLeftFace == faceId) {
1334  if (lastNode != nextEndNode) {
1335  if(traceDebug())
1336  {
1337  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << faceId << " line " << __LINE__ << endl;
1338  }
1339  return;
1340  }
1341  lastEnd = nextStartNode;
1342  } else {
1343  if(traceDebug())
1344  {
1345  ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << faceId << " line " << __LINE__ << endl;
1346  }
1347  return;
1348  }
1349 
1350  if (lastEnd == firstNode)
1351  break;
1352  }
1353 
1354  free_row(row, *edgTable.getVpfTableData());
1355  row = nextRow;
1356  startNode = nextStartNode;
1357  endNode = nextEndNode;
1358  rightFace = nextRightFace;
1359  leftFace = nextLeftFace;
1360 
1361  if (rightFace == faceId) {
1362  nextEdge = nextRightEdge;
1363  lastNode = endNode;
1364  } else {
1365  nextEdge = nextLeftEdge;
1366  lastNode = startNode;
1367  }
1368  }
1369 
1370  free_row(nextRow, *edgTable.getVpfTableData());
1371  nextRow = 0;
1372  }
1373 
1374  for (vector< int >::iterator i = edges.begin(); i != edges.end(); i++) {
1375  ossim_int32 count = 0;
1376  free_row(row, *edgTable.getVpfTableData());
1377  row = read_row( *i, *edgTable.getVpfTableData() );
1378  ossimDpt* ptArray = getXy(*edgTable.getVpfTableData(),
1379  row,
1380  coordinatesCol,
1381  &count);
1382 
1383  if(ptArray)
1384  {
1385  int rightFace = getEdgeKeyId( *edgTable.getVpfTableData(), row, rightFaceCol );
1386 
1387  if (rightFace == faceId)
1388  {
1389  for(int p = 0; p < count; ++p)
1390  {
1391  if((fabs(ptArray[p].x) <= 180.0)&&
1392  (fabs(ptArray[p].y) <= 90.0))
1393  {
1394  polygon.addPoint(ptArray[p].y, ptArray[p].x);
1395  }
1396  }
1397  }
1398  else
1399  {
1400  for(int p = count - 1; p >= 0; --p)
1401  {
1402  if((fabs(ptArray[p].x) <= 180.0)&&
1403  (fabs(ptArray[p].y) <= 90.0))
1404  {
1405  polygon.addPoint(ptArray[p].y, ptArray[p].x);
1406  }
1407  }
1408  }
1409  delete [] ptArray;
1410  }
1411  }
1412  free_row(row, *edgTable.getVpfTableData());
1413 }
ossim_uint32 x
void free_row(row_type row, vpf_table_type table)
ossim_uint32 y
int getEdgeKeyId(vpf_table_type &table, row_type &row, int col)
row_type read_row(ossim_int32 row_number, vpf_table_type table)
ossim_int32 getColumnPosition(const ossimString &columnName) const
ossimDpt * getXy(vpf_table_type table, row_type row, ossim_int32 pos, ossim_int32 *count)
void addPoint(const ossimGpt &pt)
ossimString getColumnValueAsString(row_type &row, long columnNumber) const
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61
int toInt() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ readRngId()

int ossimVpfAnnotationFeatureInfo::readRngId ( int  rowNumber,
int  colNumber,
ossimVpfTable faceTable 
)
protected

Definition at line 1110 of file ossimVpfAnnotationFeatureInfo.cpp.

References free_row(), ossimVpfTable::getColumnValueAsString(), ossimVpfTable::getVpfTableData(), read_row(), and ossimString::toInt().

Referenced by buildFaceFeature().

1113 {
1114  int idResult = -1;
1115  row_type row = read_row( rowNumber,
1116  *faceTable.getVpfTableData());
1117 
1118  idResult = faceTable.getColumnValueAsString(row,
1119  colNumber).toInt();
1120 
1121  free_row(row, *faceTable.getVpfTableData());
1122 
1123  return idResult;
1124 }
void free_row(row_type row, vpf_table_type table)
row_type read_row(ossim_int32 row_number, vpf_table_type table)
ossimString getColumnValueAsString(row_type &row, long columnNumber) const
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61
int toInt() const

◆ readStartEdgeId()

int ossimVpfAnnotationFeatureInfo::readStartEdgeId ( int  rowNumber,
int  colNumber,
ossimVpfTable rngTable 
)
protected

Definition at line 1126 of file ossimVpfAnnotationFeatureInfo.cpp.

References free_row(), ossimVpfTable::getColumnValueAsString(), ossimVpfTable::getVpfTableData(), read_row(), and ossimString::toInt().

1129 {
1130  int idResult = -1;
1131 
1132  row_type row = read_row( rowNumber,
1133  *rngTable.getVpfTableData());
1134 
1135  idResult = rngTable.getColumnValueAsString(row,
1136  colNumber).toInt();
1137 
1138  free_row(row, *rngTable.getVpfTableData());
1139 
1140  return idResult;
1141 
1142 }
void free_row(row_type row, vpf_table_type table)
row_type read_row(ossim_int32 row_number, vpf_table_type table)
ossimString getColumnValueAsString(row_type &row, long columnNumber) const
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61
int toInt() const

◆ readTableCellAsInt()

int ossimVpfAnnotationFeatureInfo::readTableCellAsInt ( int  rowNumber,
int  colNumber,
ossimVpfTable table 
)
protected

Definition at line 1096 of file ossimVpfAnnotationFeatureInfo.cpp.

References free_row(), ossimVpfTable::getColumnValueAsString(), ossimVpfTable::getVpfTableData(), read_row(), and ossimString::toInt().

1099 {
1100  int result = -1;
1101  row_type row = read_row( rowNumber, *table.getVpfTableData());
1102 
1103  result = table.getColumnValueAsString(row, colNumber).toInt();
1104 
1105  free_row(row, *table.getVpfTableData());
1106 
1107  return result;
1108 }
void free_row(row_type row, vpf_table_type table)
row_type read_row(ossim_int32 row_number, vpf_table_type table)
ossimString getColumnValueAsString(row_type &row, long columnNumber) const
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61
int toInt() const

◆ saveState()

bool ossimVpfAnnotationFeatureInfo::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of the object to a keyword list. Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 211 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimRgbVector::getB(), getFeatureTypeAsString(), ossimRgbVector::getG(), ossimRgbVector::getR(), ossimVpfAnnotationFeatureType_LINE, ossimVpfAnnotationFeatureType_POINT, ossimVpfAnnotationFeatureType_POLYGON, ossimVpfAnnotationFeatureType_TEXT, ossimFontInformation::saveState(), theBrushColor, theDescription, theEnabledFlag, theFeatureType, theFillEnabledFlag, theFontInformation, theName, thePenColor, thePointRadius, theThickness, ossimString::toString(), ossimDpt::x, and ossimDpt::y.

213 {
214  kwl.add(prefix,
215  "name",
216  theName.c_str(),
217  true);
218  kwl.add(prefix,
219  "description",
221  true);
222  ossimString penColor = (ossimString::toString((int)thePenColor.getR())+ " " +
223  ossimString::toString((int)thePenColor.getG())+ " " +
225  ossimString brushColor = (ossimString::toString((int)theBrushColor.getR())+ " " +
228  kwl.add(prefix,
229  "pen_color",
230  penColor,
231  true);
232  kwl.add(prefix,
233  "brush_color",
234  brushColor,
235  true);
236 
238  {
239  kwl.add(prefix,
240  "point_radius",
243  true);
244  kwl.add(prefix,
245  "fill_enabled",
247  true);
248  }
250  {
251  kwl.add(prefix,
252  "thickness",
253  theThickness,
254  true);
255  }
257  {
258  kwl.add(prefix,
259  "fill_enabled",
261  true);
262  kwl.add(prefix,
263  "thickness",
264  theThickness,
265  true);
266  }
268  {
270  (ossimString(prefix)+"font.").c_str());
271  }
272  kwl.add(prefix,
273  "enabled",
275  true);
276  kwl.add(prefix,
277  "feature_type",
279  true);
280 
281  return true;
282 }
unsigned char getR() const
double y
Definition: ossimDpt.h:165
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned char getB() const
unsigned char getG() const
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the current state of this object.
ossimVpfAnnotationFeatureType theFeatureType
double x
Definition: ossimDpt.h:164
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ setBrushColor()

void ossimVpfAnnotationFeatureInfo::setBrushColor ( const ossimRgbVector brushColor)
inline

Definition at line 75 of file ossimVpfAnnotationFeatureInfo.h.

76  {
77  theBrushColor = brushColor;
78  }

◆ setColor()

void ossimVpfAnnotationFeatureInfo::setColor ( const ossimRgbVector color)
inline

Definition at line 60 of file ossimVpfAnnotationFeatureInfo.h.

61  {
62  setPenColor(color);
63  setBrushColor(color);
64  }
void setBrushColor(const ossimRgbVector &brushColor)
void setPenColor(const ossimRgbVector &penColor)

◆ setCoverage()

void ossimVpfAnnotationFeatureInfo::setCoverage ( const ossimVpfCoverage coverage)
inline

◆ setDrawingFeaturesToAnnotation()

void ossimVpfAnnotationFeatureInfo::setDrawingFeaturesToAnnotation ( )

Definition at line 425 of file ossimVpfAnnotationFeatureInfo.cpp.

References ossimFontFactoryRegistry::createFont(), ossimFont::dup(), ossimRgbVector::getB(), ossimRgbVector::getG(), ossimRgbVector::getR(), ossimFontFactoryRegistry::instance(), ossimVpfAnnotationFeatureType_LINE, ossimVpfAnnotationFeatureType_POINT, ossimVpfAnnotationFeatureType_POLYGON, ossimVpfAnnotationFeatureType_TEXT, ossimGeoAnnotationMultiPolyObject::setColor(), ossimGeoAnnotationMultiEllipseObject::setColor(), ossimGeoAnnotationFontObject::setColor(), ossimGeoAnnotationMultiPolyLineObject::setColor(), ossimGeoAnnotationMultiPolyObject::setFillFlag(), ossimGeoAnnotationMultiEllipseObject::setFillFlag(), ossimGeoAnnotationFontObject::setFont(), ossimGeoAnnotationFontObject::setPointSize(), ossimGeoAnnotationFontObject::setRotation(), ossimGeoAnnotationFontObject::setScale(), ossimGeoAnnotationFontObject::setShear(), ossimGeoAnnotationMultiPolyObject::setThickness(), ossimGeoAnnotationMultiEllipseObject::setThickness(), ossimGeoAnnotationMultiPolyLineObject::setThickness(), ossimAnnotationObject::setThickness(), ossimGeoAnnotationMultiEllipseObject::setWidthHeight(), theAnnotationArray, theFeatureType, theFillEnabledFlag, theFontInformation, thePenColor, thePointRadius, ossimFontInformation::thePointSize, ossimFontInformation::theRotation, ossimFontInformation::theScale, ossimFontInformation::theShear, theThickness, and ossimRefPtr< T >::valid().

Referenced by loadState().

426 {
427  switch(theFeatureType)
428  {
430  {
431  ossimGeoAnnotationMultiEllipseObject* annotation = 0;
432  for(int idx = 0; idx < (int)theAnnotationArray.size();++idx)
433  {
435 
436  annotation->setColor(thePenColor.getR(),
437  thePenColor.getG(),
438  thePenColor.getB());
439  annotation->setThickness(theThickness);
440  annotation->setFillFlag(theFillEnabledFlag);
441  annotation->setWidthHeight(thePointRadius);
442  }
443 
444  break;
445  }
447  {
448  ossimGeoAnnotationFontObject* annotation = 0;
450 
451  for(int idx = 0; idx < (int)theAnnotationArray.size();++idx)
452  {
453  annotation = (ossimGeoAnnotationFontObject*)theAnnotationArray[idx].get();
454  annotation->setColor(thePenColor.getR(),
455  thePenColor.getG(),
456  thePenColor.getB());
457  annotation->setThickness(theThickness);
458 
459  if(font.valid())
460  {
461  annotation->setFont((ossimFont*)font->dup());
462  }
464  annotation->setScale(theFontInformation.theScale);
465  annotation->setShear(theFontInformation.theShear);
467  }
468  break;
469  }
471  {
473  for(int idx = 0; idx < (int)theAnnotationArray.size();++idx)
474  {
476  annotation->setColor(thePenColor.getR(),
477  thePenColor.getG(),
478  thePenColor.getB());
479  annotation->setThickness(theThickness);
480  }
481 
482  break;
483  }
485  {
486  ossimGeoAnnotationMultiPolyObject* annotation = 0;
487  for(int idx = 0; idx < (int)theAnnotationArray.size();++idx)
488  {
489  annotation = (ossimGeoAnnotationMultiPolyObject*)theAnnotationArray[idx].get();
490  annotation->setColor(thePenColor.getR(),
491  thePenColor.getG(),
492  thePenColor.getB());
493  annotation->setThickness(theThickness);
494  annotation->setFillFlag(theFillEnabledFlag);
495  }
496  break;
497  }
498  default:
499  {
500  break;
501  }
502  }
503 }
virtual void setShear(const ossimDpt &shear)
unsigned char getR() const
virtual void setThickness(ossim_uint8 thickness)
virtual void setColor(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
bool valid() const
Definition: ossimRefPtr.h:75
virtual void setColor(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
virtual void setRotation(double rotation)
virtual void setThickness(ossim_uint8 thickness)
virtual void setPointSize(const ossimIpt &size)
unsigned char getB() const
ossimFont * createFont(const ossimFontInformation &information) const
virtual void setColor(unsigned char r, unsigned char g, unsigned char b)
virtual ossimObject * dup() const =0
unsigned char getG() const
virtual void setWidthHeight(const ossimDpt &widthHeight)
static ossimFontFactoryRegistry * instance()
ossimVpfAnnotationFeatureType theFeatureType
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
virtual void setColor(unsigned char r, unsigned char g, unsigned char b)
virtual void setScale(const ossimDpt &scale)

◆ setEnabledFlag()

void ossimVpfAnnotationFeatureInfo::setEnabledFlag ( bool  flag)

Definition at line 107 of file ossimVpfAnnotationFeatureInfo.cpp.

References buildFeature(), deleteAllObjects(), and theEnabledFlag.

108 {
109  if(!flag && theEnabledFlag)
110  {
112  }
113  else if(flag&&(!theEnabledFlag))
114  {
115  theEnabledFlag = flag;
116  buildFeature();
117  }
118  theEnabledFlag = flag;
119 }

◆ setFillEnabledFlag()

void ossimVpfAnnotationFeatureInfo::setFillEnabledFlag ( bool  flag)
inline

Definition at line 85 of file ossimVpfAnnotationFeatureInfo.h.

◆ setFontInformation()

void ossimVpfAnnotationFeatureInfo::setFontInformation ( const ossimFontInformation fontInfo)
inline

Definition at line 138 of file ossimVpfAnnotationFeatureInfo.h.

139  {
140  theFontInformation = fontInfo;
141  }

◆ setName()

void ossimVpfAnnotationFeatureInfo::setName ( const ossimString name)
inline

Definition at line 109 of file ossimVpfAnnotationFeatureInfo.h.

Referenced by ossimVpfAnnotationCoverageInfo::buildCoverage().

110  {
111  theName = name;
112  }

◆ setPenColor()

void ossimVpfAnnotationFeatureInfo::setPenColor ( const ossimRgbVector penColor)
inline

Definition at line 65 of file ossimVpfAnnotationFeatureInfo.h.

66  {
67  thePenColor = penColor;
68  }

◆ setPointRadius()

void ossimVpfAnnotationFeatureInfo::setPointRadius ( const ossimDpt radius)
inline

Definition at line 143 of file ossimVpfAnnotationFeatureInfo.h.

144  {
145  thePointRadius = radius;
146  }

◆ setThickness()

void ossimVpfAnnotationFeatureInfo::setThickness ( int  thickness)
inline

Definition at line 99 of file ossimVpfAnnotationFeatureInfo.h.

100  {
101  theThickness = thickness;
102  }

◆ transform()

void ossimVpfAnnotationFeatureInfo::transform ( ossimImageGeometry proj)

Definition at line 63 of file ossimVpfAnnotationFeatureInfo.cpp.

References theAnnotationArray, and theEnabledFlag.

64 {
65  if(theEnabledFlag)
66  {
67  for(int idx = 0; idx < (int)theAnnotationArray.size();++idx)
68  {
69  if(theAnnotationArray[idx].valid())
70  {
71  theAnnotationArray[idx]->transform(proj);
72  theAnnotationArray[idx]->computeBoundingRect();
73  }
74  }
75  }
76 }
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray

Member Data Documentation

◆ theAnnotationArray

std::vector<ossimRefPtr<ossimGeoAnnotationObject> > ossimVpfAnnotationFeatureInfo::theAnnotationArray
protected

◆ theBrushColor

ossimRgbVector ossimVpfAnnotationFeatureInfo::theBrushColor
protected

Definition at line 173 of file ossimVpfAnnotationFeatureInfo.h.

Referenced by loadState(), and saveState().

◆ theCoverage

ossimVpfCoverage ossimVpfAnnotationFeatureInfo::theCoverage
protected

◆ theDescription

ossimString ossimVpfAnnotationFeatureInfo::theDescription
protected

Definition at line 171 of file ossimVpfAnnotationFeatureInfo.h.

Referenced by loadState(), and saveState().

◆ theEnabledFlag

bool ossimVpfAnnotationFeatureInfo::theEnabledFlag
protected

◆ theFeatureType

ossimVpfAnnotationFeatureType ossimVpfAnnotationFeatureInfo::theFeatureType
protected

◆ theFillEnabledFlag

bool ossimVpfAnnotationFeatureInfo::theFillEnabledFlag
protected

◆ theFontInformation

ossimFontInformation ossimVpfAnnotationFeatureInfo::theFontInformation
protected

◆ theName

ossimString ossimVpfAnnotationFeatureInfo::theName
protected

Definition at line 170 of file ossimVpfAnnotationFeatureInfo.h.

Referenced by buildFeature(), loadState(), and saveState().

◆ thePenColor

ossimRgbVector ossimVpfAnnotationFeatureInfo::thePenColor
protected

◆ thePointRadius

ossimDpt ossimVpfAnnotationFeatureInfo::thePointRadius
protected

◆ theThickness

int ossimVpfAnnotationFeatureInfo::theThickness
protected

The documentation for this class was generated from the following files: