Commits

Anonymous committed 216e36e

add Qt4 GUI

  • Participants
  • Parent commits 94c5fa7

Comments (0)

Files changed (22)

File CMakeLists.txt

 
 
 
-ADD_EXECUTABLE (ossimVector main.cpp
+ADD_LIBRARY (ossimVector SHARED
+load.cpp
 ossimGdVectorSource.cpp
 ossimOgrVectorHandler.cpp
 ossimVectorFeature.cpp

File Makefile

- 
-GD_LIB=  -lgd -L/usr/lib -lgd -lproj -L/usr/local/lib -lgdal1.8.0 -lossim -L. -lossimVector 
-GD=       -I/usr/include/gdal -DUSE_OGR -DUSE_PROJ
-  
-
-CXX=	g++
-AR= ar rc
-RANLIB= ranlib
-
-
-CFLAGS= -O2 -g $(GD) 
-
-
-LDFLAGS=  $(GD_LIB)
-
-
-
-RM= /bin/rm -f
-
-OBJS= ossimVectorLabel.o ossimVectorHandler.o ossimOgrVectorHandler.o ossimVectorSource.o ossimGdVectorSource.o ossimVectorStyle.o ossimVectorFeature.o
-
-
-.cpp.o:
-	$(CXX) -c $(CFLAGS) $< -o $@
-
-all: libossimVector.a ossimVector 
-
-
-lib: libossimVector.a
-libossimVector: libossimVector.a
-libossimVector.a: $(OBJS)
-	$(AR) libossimVector.a $(OBJS)
-	$(RANLIB) libossimVector.a
-
-ossimVector: libossimVector.a  main.o
-	$(CXX) $(CFLAGS) main.o $(LDFLAGS) $(STATIC_LIBS) -o ossimVector
-
-clean:	$(MAKE_CLEAN) 
-	rm -f libossimVector.a *.o ossimVector shp
-
+#############################################################################
+# Makefile for building: ossimVectorQt
+# Generated by qmake (2.01a) (Qt 4.7.4) on: Wed Mar 7 22:55:02 2012
+# Project:  ossimVect.pro
+# Template: app
+# Command: /usr/bin/qmake -o Makefile ossimVect.pro
+#############################################################################
+
+####### Compiler, tools and options
+
+CC            = gcc
+CXX           = g++
+DEFINES       = -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
+CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
+CXXFLAGS      = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
+INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I.
+LINK          = g++
+LFLAGS        = -Wl,-O1
+LIBS          = $(SUBLIBS)  -L/usr/lib/i386-linux-gnu -lgd -L.. -l ossimVector -lQtGui -lQtCore -lpthread 
+AR            = ar cqs
+RANLIB        = 
+QMAKE         = /usr/bin/qmake
+TAR           = tar -cf
+COMPRESS      = gzip -9f
+COPY          = cp -f
+SED           = sed
+COPY_FILE     = $(COPY)
+COPY_DIR      = $(COPY) -r
+STRIP         = strip
+INSTALL_FILE  = install -m 644 -p
+INSTALL_DIR   = $(COPY_DIR)
+INSTALL_PROGRAM = install -m 755 -p
+DEL_FILE      = rm -f
+SYMLINK       = ln -f -s
+DEL_DIR       = rmdir
+MOVE          = mv -f
+CHK_DIR_EXISTS= test -d
+MKDIR         = mkdir -p
+
+####### Output directory
+
+OBJECTS_DIR   = ./
+
+####### Files
+
+SOURCES       = main.cpp \
+		mainwindow.cpp \
+		widget.cpp moc_mainwindow.cpp \
+		moc_widget.cpp
+OBJECTS       = main.o \
+		mainwindow.o \
+		widget.o \
+		moc_mainwindow.o \
+		moc_widget.o
+DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
+		/usr/share/qt4/mkspecs/common/unix.conf \
+		/usr/share/qt4/mkspecs/common/linux.conf \
+		/usr/share/qt4/mkspecs/qconfig.pri \
+		/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
+		/usr/share/qt4/mkspecs/features/qt_functions.prf \
+		/usr/share/qt4/mkspecs/features/qt_config.prf \
+		/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
+		/usr/share/qt4/mkspecs/features/default_pre.prf \
+		/usr/share/qt4/mkspecs/features/release.prf \
+		/usr/share/qt4/mkspecs/features/default_post.prf \
+		/usr/share/qt4/mkspecs/features/warn_on.prf \
+		/usr/share/qt4/mkspecs/features/qt.prf \
+		/usr/share/qt4/mkspecs/features/unix/thread.prf \
+		/usr/share/qt4/mkspecs/features/moc.prf \
+		/usr/share/qt4/mkspecs/features/resources.prf \
+		/usr/share/qt4/mkspecs/features/uic.prf \
+		/usr/share/qt4/mkspecs/features/yacc.prf \
+		/usr/share/qt4/mkspecs/features/lex.prf \
+		/usr/share/qt4/mkspecs/features/include_source_dir.prf \
+		ossimVect.pro
+QMAKE_TARGET  = ossimVectorQt
+DESTDIR       = 
+TARGET        = ossimVectorQt
+
+first: all
+####### Implicit rules
+
+.SUFFIXES: .o .c .cpp .cc .cxx .C
+
+.cpp.o:
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cc.o:
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cxx.o:
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.C.o:
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.c.o:
+	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
+
+####### Build rules
+
+all: Makefile $(TARGET)
+
+$(TARGET):  $(OBJECTS)  
+	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
+
+Makefile: ossimVect.pro  /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \
+		/usr/share/qt4/mkspecs/common/unix.conf \
+		/usr/share/qt4/mkspecs/common/linux.conf \
+		/usr/share/qt4/mkspecs/qconfig.pri \
+		/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
+		/usr/share/qt4/mkspecs/features/qt_functions.prf \
+		/usr/share/qt4/mkspecs/features/qt_config.prf \
+		/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
+		/usr/share/qt4/mkspecs/features/default_pre.prf \
+		/usr/share/qt4/mkspecs/features/release.prf \
+		/usr/share/qt4/mkspecs/features/default_post.prf \
+		/usr/share/qt4/mkspecs/features/warn_on.prf \
+		/usr/share/qt4/mkspecs/features/qt.prf \
+		/usr/share/qt4/mkspecs/features/unix/thread.prf \
+		/usr/share/qt4/mkspecs/features/moc.prf \
+		/usr/share/qt4/mkspecs/features/resources.prf \
+		/usr/share/qt4/mkspecs/features/uic.prf \
+		/usr/share/qt4/mkspecs/features/yacc.prf \
+		/usr/share/qt4/mkspecs/features/lex.prf \
+		/usr/share/qt4/mkspecs/features/include_source_dir.prf \
+		/usr/lib/i386-linux-gnu/libQtGui.prl \
+		/usr/lib/i386-linux-gnu/libQtCore.prl
+	$(QMAKE) -o Makefile ossimVect.pro
+/usr/share/qt4/mkspecs/common/g++.conf:
+/usr/share/qt4/mkspecs/common/unix.conf:
+/usr/share/qt4/mkspecs/common/linux.conf:
+/usr/share/qt4/mkspecs/qconfig.pri:
+/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
+/usr/share/qt4/mkspecs/features/qt_functions.prf:
+/usr/share/qt4/mkspecs/features/qt_config.prf:
+/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
+/usr/share/qt4/mkspecs/features/default_pre.prf:
+/usr/share/qt4/mkspecs/features/release.prf:
+/usr/share/qt4/mkspecs/features/default_post.prf:
+/usr/share/qt4/mkspecs/features/warn_on.prf:
+/usr/share/qt4/mkspecs/features/qt.prf:
+/usr/share/qt4/mkspecs/features/unix/thread.prf:
+/usr/share/qt4/mkspecs/features/moc.prf:
+/usr/share/qt4/mkspecs/features/resources.prf:
+/usr/share/qt4/mkspecs/features/uic.prf:
+/usr/share/qt4/mkspecs/features/yacc.prf:
+/usr/share/qt4/mkspecs/features/lex.prf:
+/usr/share/qt4/mkspecs/features/include_source_dir.prf:
+/usr/lib/i386-linux-gnu/libQtGui.prl:
+/usr/lib/i386-linux-gnu/libQtCore.prl:
+qmake:  FORCE
+	@$(QMAKE) -o Makefile ossimVect.pro
+
+dist: 
+	@$(CHK_DIR_EXISTS) .tmp/ossimVectorQt1.0.0 || $(MKDIR) .tmp/ossimVectorQt1.0.0 
+	$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/ossimVectorQt1.0.0/ && $(COPY_FILE) --parents mainwindow.h widget.h ../load.h .tmp/ossimVectorQt1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp widget.cpp .tmp/ossimVectorQt1.0.0/ && (cd `dirname .tmp/ossimVectorQt1.0.0` && $(TAR) ossimVectorQt1.0.0.tar ossimVectorQt1.0.0 && $(COMPRESS) ossimVectorQt1.0.0.tar) && $(MOVE) `dirname .tmp/ossimVectorQt1.0.0`/ossimVectorQt1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/ossimVectorQt1.0.0
+
+
+clean:compiler_clean 
+	-$(DEL_FILE) $(OBJECTS)
+	-$(DEL_FILE) *~ core *.core
+
+
+####### Sub-libraries
+
+distclean: clean
+	-$(DEL_FILE) $(TARGET) 
+	-$(DEL_FILE) Makefile
+
+
+check: first
+
+mocclean: compiler_moc_header_clean compiler_moc_source_clean
+
+mocables: compiler_moc_header_make_all compiler_moc_source_make_all
+
+compiler_moc_header_make_all: moc_mainwindow.cpp moc_widget.cpp
+compiler_moc_header_clean:
+	-$(DEL_FILE) moc_mainwindow.cpp moc_widget.cpp
+moc_mainwindow.cpp: widget.h \
+		mainwindow.h
+	/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
+
+moc_widget.cpp: widget.h
+	/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) widget.h -o moc_widget.cpp
+
+compiler_rcc_make_all:
+compiler_rcc_clean:
+compiler_image_collection_make_all: qmake_image_collection.cpp
+compiler_image_collection_clean:
+	-$(DEL_FILE) qmake_image_collection.cpp
+compiler_moc_source_make_all:
+compiler_moc_source_clean:
+compiler_uic_make_all:
+compiler_uic_clean:
+compiler_yacc_decl_make_all:
+compiler_yacc_decl_clean:
+compiler_yacc_impl_make_all:
+compiler_yacc_impl_clean:
+compiler_lex_make_all:
+compiler_lex_clean:
+compiler_clean: compiler_moc_header_clean 
+
+####### Compile
+
+main.o: main.cpp mainwindow.h \
+		widget.h
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
+
+mainwindow.o: mainwindow.cpp mainwindow.h \
+		widget.h \
+		ui_mainwindow.h
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
+
+widget.o: widget.cpp widget.h \
+		../load.h \
+		../ossimVectorPrimitive.h
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o widget.o widget.cpp
+
+moc_mainwindow.o: moc_mainwindow.cpp 
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
+
+moc_widget.o: moc_widget.cpp 
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_widget.o moc_widget.cpp
+
+####### Install
+
+install:   FORCE
+
+uninstall:   FORCE
+
+FORCE:
+
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+
+    return a.exec();
+}

File UI/mainwindow.cpp

+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include "widget.h"
+
+
+
+#include <QPushButton>
+#include <QMouseEvent>
+#include <QVBoxLayout>
+
+
+#include <sstream>
+#include <iostream>
+
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+   setWindowTitle("ossimVectorGui");
+
+    ui->setupUi(this);
+    qApp->installEventFilter(this);
+
+    w = new Widget();
+
+
+
+    QWidget *centralWidget = new QWidget(parent);
+          QGridLayout *layout = new QGridLayout(centralWidget);
+
+          layout->addWidget(w,0,0);
+
+
+
+
+          setCentralWidget(centralWidget);
+
+          createActions();
+          createMenus();
+          statusBar()->showMessage( tr("Done") );
+
+
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+
+
+
+void MainWindow::createActions()
+{
+
+
+  openAction = new QAction( tr("&Open"), this );
+  openAction->setShortcut( tr("Ctrl+O") );
+  openAction->setStatusTip( tr("Open a Vector") );
+  connect( openAction, SIGNAL(triggered()), this, SLOT(openVector()) );
+
+
+
+
+}
+
+void MainWindow::createMenus()
+{
+  QMenu *menu;
+
+  menu = menuBar()->addMenu( tr("&File") );
+  menu->addAction( openAction );
+  //menu->addAction( closeAction );
+ // menu->addSeparator();
+  //menu->addAction( exitAction );
+
+}
+
+
+void MainWindow::openVector()
+{
+  QString filename = QFileDialog::getOpenFileName( this,"","/home/rashad/maps/" );
+  if( filename.isEmpty() )
+    return;
+    loadVector( filename );
+}
+
+void MainWindow::loadVector(QString fname)
+{
+w->loadVector(fname);
+}

File UI/mainwindow.h

+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include "widget.h"
+#include <QFileDialog>
+
+namespace Ui {
+    class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+    void loadVector(QString);
+
+
+private:
+    Ui::MainWindow *ui;
+       Widget *w;
+
+
+
+
+
+private slots:
+
+
+  void openVector();
+
+
+private:
+  void createActions();
+  void createMenus();
+
+  QString currentFilename;
+
+
+
+
+  QAction *openAction;
+  QAction *exitAction;
+
+
+
+
+//protected:
+    //   bool eventFilter(QObject *obj, QEvent *event);
+    //   void resizeEvent(QResizeEvent *revent);
+};
+
+#endif // MAINWINDOW_H

File UI/ossimVect.pro

+QT += core  gui
+CONFIG +=Release
+TARGET = ossimVectorQt
+TEMPLATE = app
+SOURCES += main.cpp  mainwindow.cpp  widget.cpp
+HEADERS += mainwindow.h  widget.h ../load.h
+LIBS += -lgd -L.. -l ossimVector

File UI/ui_mainwindow.h

+/********************************************************************************
+** Form generated from reading UI file 'mainwindow.ui'
+**
+** Created: Sun Dec 11 00:00:44 2011
+**      by: Qt User Interface Compiler version 4.6.2
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_MAINWINDOW_H
+#define UI_MAINWINDOW_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QHeaderView>
+#include <QtGui/QMainWindow>
+#include <QtGui/QMenuBar>
+#include <QtGui/QStatusBar>
+#include <QtGui/QToolBar>
+#include <QtGui/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_MainWindow
+{
+public:
+    QWidget *centralWidget;
+    QMenuBar *menuBar;
+    QStatusBar *statusBar;
+    QToolBar *mainToolBar;
+
+    void setupUi(QMainWindow *MainWindow)
+    {
+        if (MainWindow->objectName().isEmpty())
+            MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
+        MainWindow->resize(640, 550);
+        QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+        sizePolicy.setHorizontalStretch(0);
+        sizePolicy.setVerticalStretch(0);
+        sizePolicy.setHeightForWidth(MainWindow->sizePolicy().hasHeightForWidth());
+        MainWindow->setSizePolicy(sizePolicy);
+        centralWidget = new QWidget(MainWindow);
+        centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
+        MainWindow->setCentralWidget(centralWidget);
+        menuBar = new QMenuBar(MainWindow);
+        menuBar->setObjectName(QString::fromUtf8("menuBar"));
+        menuBar->setGeometry(QRect(0, 0, 640, 25));
+        MainWindow->setMenuBar(menuBar);
+        statusBar = new QStatusBar(MainWindow);
+        statusBar->setObjectName(QString::fromUtf8("statusBar"));
+        MainWindow->setStatusBar(statusBar);
+        mainToolBar = new QToolBar(MainWindow);
+        mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
+        MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);
+
+        retranslateUi(MainWindow);
+
+        QMetaObject::connectSlotsByName(MainWindow);
+    } // setupUi
+
+    void retranslateUi(QMainWindow *MainWindow)
+    {
+        MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
+    } // retranslateUi
+
+};
+
+namespace Ui {
+    class MainWindow: public Ui_MainWindow {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_MAINWINDOW_H

File UI/widget.cpp

+#include "widget.h"
+#include <QPainter>
+#include <sstream>
+#include <QMouseEvent>
+#include <iostream>
+#include <QPoint>
+#include <QDebug>
+#include <gd.h>
+
+#include <QPushButton>
+#include "../load.h"
+Widget::Widget(QWidget *parent) :
+    QWidget(parent)
+{
+loaded = false;
+
+     img = QImage(640,480,QImage::Format_RGB32);
+
+
+}
+void Widget::paintEvent(QPaintEvent *event) {
+
+    QPainter painter(this);
+
+    //QImage image(3, 3, QImage::Format_RGB32);
+    QRgb value;
+
+    //value = qRgb(189, 149, 39); // 0xffbd9527
+   // image.setPixel(1, 1, value);
+
+    //value = qRgb(122, 163, 39); // 0xff7aa327
+    //image.setPixel(0, 1, value);
+    //image.setPixel(1, 0, value);
+if(!loaded)
+return;
+
+
+   for(int i=0;i<gdImageSX(im);i++)
+    {
+       for(int j=0;j<gdImageSY(im);j++)
+       {
+
+           int index  = gdImageGetPixel(im,i,j);
+         int r = gdImageRed(im,index);
+         int g = gdImageGreen(im,index);
+         int b = gdImageBlue(im,index);
+         value = qRgb(r,g,b);
+        img.setPixel(i,j,value);
+
+
+       }
+   }
+
+
+painter.drawImage(0,0,img);
+
+}
+
+void Widget::loadVector(QString fname)
+{
+
+im = load(fname.toStdString().c_str(),1);
+loaded = true;
+update();
+
+}
+
+#ifndef WIDGET_H
+#define WIDGET_H
+
+#include <QWidget>
+#include <QPoint>
+#include <gd.h>
+
+class Widget : public QWidget
+{
+
+    Q_OBJECT
+public:
+    explicit Widget(QWidget *parent = 0);
+  gdImagePtr im;
+  int w,h;
+  QPixmap p;
+  QImage img;
+bool loaded;
+
+void loadVector(QString fname);
+
+protected:
+virtual void paintEvent(QPaintEvent *event);
+
+
+};
+
+#endif // WIDGET_H

File cmake/FindGDAL.cmake

File contents unchanged.
+
+#include <stdlib.h>
+#include <gd.h>
+
+#include "ossimVectorPrimitive.h"
+#include "ossimVector.h"
+#include "ossimVectorDef.h"
+#include "ossimVectorEnum.h"
+
+#include "ossimOgrVectorHandler.h"
+#include "ossimGdVectorSource.h"
+
+#include "load.h"
+double msAdjustExtent(ossimVectorRect *rect, int width, int height)
+{
+  double cellsize, ox, oy;
+
+  cellsize = OV_MAX(OV_CELLSIZE(rect->minx, rect->maxx, width), OV_CELLSIZE(rect->miny, rect->maxy, height));
+
+  if(cellsize <= 0) /* avoid division by zero errors */
+    return(0);
+
+  ox = OV_NINT(OV_MAX((width - (rect->maxx - rect->minx)/cellsize)/2,0)); // these were width-1 and height-1
+  oy = OV_NINT(OV_MAX((height - (rect->maxy - rect->miny)/cellsize)/2,0));
+
+  rect->minx = rect->minx - ox*cellsize;
+  rect->miny = rect->miny - oy*cellsize;
+  rect->maxx = rect->maxx + ox*cellsize;
+  rect->maxy = rect->maxy + oy*cellsize;
+
+  return(cellsize);
+}
+
+
+gdImagePtr load(const char *shpname, int label_index)
+{
+   gdImagePtr img=NULL;
+   ossimVectorRect    rect;
+
+
+int status;
+
+enum OV_LAYER_TYPE ltype;
+enum OV_SHAPE_TYPE stype;
+ossimVectorRect extent;
+
+    OGRRegisterAll();
+
+    OGRDataSource       *poDS;
+
+    poDS = OGRSFDriverRegistrar::Open( shpname, FALSE );
+    if( poDS == NULL )
+    {
+        printf( "Open failed.\n" );
+        exit( 1 );
+    }
+
+    OGRLayer  *poLayer;
+
+    poLayer = poDS->GetLayer(0);
+
+
+
+OGREnvelope *envelope = new OGREnvelope();
+poLayer->GetExtent(envelope,true);
+
+    poLayer->ResetReading();
+OGRFeature *poFeature = poLayer->GetNextFeature();
+        OGRGeometry *poGeometry;
+
+        poGeometry = poFeature->GetGeometryRef();
+        if( poGeometry != NULL && wkbFlatten(poGeometry->getGeometryType()) == wkbPoint )
+			{ltype = OV_LAYER_POINT;
+stype = OV_SHAPE_POINT;
+
+
+		}
+       else if( poGeometry != NULL && wkbFlatten(poGeometry->getGeometryType()) == wkbLineString )
+	{		ltype = OV_LAYER_LINE;
+stype = OV_SHAPE_LINE;
+}       else if( poGeometry != NULL && wkbFlatten(poGeometry->getGeometryType()) == wkbPolygon )
+{			ltype = OV_LAYER_POLYGON;
+stype = OV_SHAPE_POLYGON;
+}
+       OGRFeature::DestroyFeature( poFeature );
+
+    OGRDataSource::DestroyDataSource( poDS );
+
+
+extent.minx = envelope->MinX;
+extent.miny = envelope->MinY;
+extent.maxx = envelope->MaxX;
+extent.maxy = envelope->MaxY;
+
+/********************************************************
+      ______  _______________  ___    ____  
+     / __   /  ____/ _____/  /    \  /    \
+    / /  / /\  \   \  \  /  /  /\  \/  /\  \ 
+   / /  / /  \  \   \  \/  /  /  \___ /  \  \
+  / /__/ /___/  /___/  /  /  /            \  \
+ /_____ /_____ /_____ /__/__/              \__\
+
+*********************************************************/
+
+
+double cellsize = msAdjustExtent(&(extent), 640, 480);
+
+
+
+ossimOgrVectorHandler *handler = new ossimOgrVectorHandler();
+
+ossimVectorFeature shape;
+ossimVectorRect searchrect;
+char annotate=1, cache=0;
+//featureListNodeObjPtr shpcache=NULL, current=NULL;
+
+
+status = handler->open(shpname);
+handler->setLayerType(ltype);
+
+status = handler->getLayerSchema();
+
+
+
+
+searchrect.minx = extent.minx;
+searchrect.miny = extent.miny;
+searchrect.maxx = extent.maxx;
+searchrect.maxy = extent.maxy;
+
+/*
+searchrect.minx = envelope->MinX;
+searchrect.miny = envelope->MinY;
+searchrect.maxx = envelope->MaxX;
+searchrect.maxy = envelope->MaxY;
+*/
+
+//cout << searchrect.miny << std::endl;
+handler->setFilter(searchrect);
+
+
+shape.init();
+
+
+ossimGdVectorSource *gdVectorSource = new ossimGdVectorSource();
+gdVectorSource->setLayerType(ltype);
+
+while((status = handler->getNextFeature(&shape)) == 0) 
+{
+    cache = 1;
+
+   shape.text = handler->getLabelText(&shape,1);
+   shape.type = stype;
+
+    status = gdVectorSource->drawFeature(&shape, !cache,searchrect,cellsize); // if caching we DON'T want to do overlays at this time
+    if(status != 0) 
+	 {
+      handler->close();
+      return NULL;
+    }
+
+    if(shape.numlines == 0) 
+	 {
+      shape.destroy();
+      continue;
+    }
+
+    shape.destroy();
+}
+
+
+
+
+
+
+
+  handler->close();
+
+
+ // if(gdVectorSource->drawLabelCache() == -1)
+   // return NULL;
+
+  return gdVectorSource->getPointer();
+}
+
+#include <gd.h>
+#include "ossimVectorPrimitive.h"
+gdImagePtr load(const char *shpname,int label_index);
+double msAdjustExtent(ossimVectorRect *rect, int width, int height);
 //featureListNodeObjPtr shpcache=NULL, current=NULL;
 
 
-status = handler->msOGRLayerOpen(shpname);
+status = handler->open(shpname);
 handler->setLayerType(ltype);
 if(status != 0) return -1;
-status = handler->msOGRLayerGetItems();
+status = handler->getLayerSchema();
 
 if(status != 0) return -1;
 
-searchrect = extent;
+
 searchrect.minx = extent.minx;
 searchrect.miny = extent.miny;
 searchrect.maxx = extent.maxx;
 searchrect.maxy = extent.maxy;
 
+/*
+searchrect.minx = envelope->MinX;
+searchrect.miny = envelope->MinY;
+searchrect.maxx = envelope->MaxX;
+searchrect.maxy = envelope->MaxY;
+*/
 
-status = handler->msOGRLayerWhichShapes(searchrect);
+//cout << searchrect.miny << std::endl;
+status = handler->setFilter(searchrect);
 
 
 
 if(status == 2)
-	handler->msOGRLayerClose();
+	handler->close();
 else if(status != 0)
 	return -1;
 
 
-shape.msInitShape();
+shape.init();
 
 
 ossimGdVectorSource *gdVectorSource = new ossimGdVectorSource();
 gdVectorSource->setLayerType(ltype);
 
-while((status = handler->msOGRLayerNextShape(&shape)) == 0) {
+while((status = handler->getNextFeature(&shape)) == 0) {
     cache = 1;
 
-    shape.text = handler->msShapeGetAnnotation(&shape,label_index);
-shape.type = stype;
+   shape.text = handler->getLabelText(&shape,label_index);
+   shape.type = stype;
 
-    status = gdVectorSource->msDrawShape(&shape, !cache,searchrect,cellsize); // if caching we DON'T want to do overlays at this time
+    status = gdVectorSource->drawFeature(&shape, !cache,searchrect,cellsize); // if caching we DON'T want to do overlays at this time
     if(status != 0) 
 	{
-      handler->msOGRLayerClose();
+      handler->close();
       return -1;
     }
 
     if(shape.numlines == 0) 
 	{
-      shape.msFreeShape();
+      shape.destroy();
       continue;
     }
 
-    shape.msFreeShape();
+    shape.destroy();
 }
 
 
 
 
 
-  handler->msOGRLayerClose();
+  handler->close();
 
 
-  if(gdVectorSource->msDrawLabelCache() == -1)
+  if(gdVectorSource->drawLabelCache() == -1)
     return -1;
 
-gdVectorSource->msSaveImage(outfile);
+gdVectorSource->saveImage(outfile);
 
 
 display = display + outfile;
 
-int d =  system(display.c_str());
+//int d =  system(display.c_str());
 
    }
   return 0L;

File ossimGdVectorSource.cpp

 ossimGdVectorSource::~ossimGdVectorSource(){}
 
 
-void ossimGdVectorSource::msClipPolygonRect(ossimVectorFeature *shape, ossimVectorRect rect)
+void ossimGdVectorSource::clipPolygonRect(ossimVectorFeature *shape, ossimVectorRect rect)
 {
   int i, j;
   double deltax, deltay, xin,xout,  yin,yout;
   ossimVectorFeature tmp;
   ossimVectorLine line={0,NULL};
 
-  tmp.msInitShape();
+  tmp.init();
   
   if(shape->numlines == 0) /* nothing to clip */
     return;
 }
 
 
-/* ------------------------------------------------------------------------------- */
-/*       Fill a circle with a shade symbol of the specified size and color       */
-/* ------------------------------------------------------------------------------- */
-void ossimGdVectorSource::msCircleDrawShadeSymbol(ossimVectorPoint *p, double r, int sy, int fc, int bc, int oc, double sz)
-{
-  //symbolObj *symbol;
-  int i;
-  gdPoint oldpnt,newpnt;
-  gdPoint sPoints[OV_MAXVECTORPOINTS];
-  gdImagePtr tile=NULL;
-  int x,y;
-  int tile_bg=-1, tile_fg=-1; /* colors (background and foreground) */
-  
-  double scale=1.0;
-  
-  int bbox[8];
-  ossimVectorRect rect;
-  char *font=NULL;
-
-  if(!p) return;
- // if(sy > symbolset->numsymbols || sy < 0) return; // no such symbol, 0 is OK
-  if(fc >= gdImageColorsTotal(img)) return; // invalid color, -1 is valid
-  if(sz < 1) return; // size too small
-      
-  if(sy == 0) { // simply draw a single pixel of the specified color
-    if(fc>-1)
-      msImageFilledCircle(p, r, fc);
-    if(oc>-1)
-      gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, oc);
-    return;
-  }
-
-  if(fc<0) {
-    if(oc>-1)
-      gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, oc);
-    return;
-  }
-/*
-  symbol = &(symbolset->symbol[sy]);
-
-  switch(symbol->type) {
-  case(OV_SYMBOL_TRUETYPE):    
-    
-#if defined (USE_GD_FT) || defined (USE_GD_TTF)
-    font = msLookupHashTable(symbolset->fontset->fonts, symbolset->symbol[sy].font);
-    if(!font) return;
-
-    if(getCharacterSize(symbol->character, sz, font, &rect) == -1) return;
-    x = rect.maxx - rect.minx;
-    y = rect.maxy - rect.miny;
-
-    tile = gdImageCreate(x, y);
-    if(bc >= 0)
-      tile_bg = gdImageColorAllocate(tile, gdImageRed(img, bc), gdImageGreen(img, bc), gdImageBlue(img, bc));
-    else {
-      tile_bg = gdImageColorAllocate(tile, gdImageRed(img, 0), gdImageGreen(img, 0), gdImageBlue(img, 0));
-      gdImageColorTransparent(tile,0);
-    }    
-    tile_fg = gdImageColorAllocate(tile, gdImageRed(img, fc), gdImageGreen(img, fc), gdImageBlue(img, fc));
-    
-    x = -rect.minx;
-    y = -rect.miny;
-
-#ifdef USE_GD_TTF
-    gdImageStringTTF(tile, bbox, ((symbol->antialias)?(tile_fg):-(tile_fg)), font, sz, 0, x, y, symbol->character);
-#else
-    gdImageStringFT(tile, bbox, ((symbol->antialias)?(tile_fg):-(tile_fg)), font, sz, 0, x, y, symbol->character);
-#endif    
-
-    gdImageSetTile(img, tile);
-#endif
-
-    break;
-  case(OV_SYMBOL_PIXMAP):
-    
-    gdImageSetTile(img, symbol->img);
-
-    break;
-  case(OV_SYMBOL_ELLIPSE):    
-   
-    scale = sz/symbol->sizey; // sz ~ height in pixels
-    x = OV_NINT(symbol->sizex*scale)+1;
-    y = OV_NINT(symbol->sizey*scale)+1;
-
-    if((x <= 1) && (y <= 1)) { // No sense using a tile, just fill solid
-      msImageFilledCircle(img, p, r, fc);
-      if(oc>-1)
-        gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, oc);
-      return;
-    }
-
-    tile = gdImageCreate(x, y);
-    if(bc >= 0)
-      tile_bg = gdImageColorAllocate(tile, gdImageRed(img, bc), gdImageGreen(img, bc), gdImageBlue(img, bc));
-    else {
-      tile_bg = gdImageColorAllocate(tile, gdImageRed(img, 0), gdImageGreen(img, 0), gdImageBlue(img, 0));
-      gdImageColorTransparent(tile,0);
-    }    
-    tile_fg = gdImageColorAllocate(tile, gdImageRed(img, fc), gdImageGreen(img, fc), gdImageBlue(img, fc));
-    
-    x = OV_NINT(tile->sx/2);
-    y = OV_NINT(tile->sy/2);
-
-
-    gdImageArc(tile, x, y, OV_NINT(scale*symbol->points[0].x), OV_NINT(scale*symbol->points[0].y), 0, 360, tile_fg);
-    if(symbol->filled)
-      gdImageFillToBorder(tile, x, y, tile_fg, tile_fg);
-
-
-    gdImageSetTile(img, tile);
- 
-    break;
-  case(OV_SYMBOL_VECTOR):
-
-    if(fc < 0)
-      return;
-
-    scale = sz/symbol->sizey; // sz ~ height in pixels
-    x = OV_NINT(symbol->sizex*scale)+1;    
-    y = OV_NINT(symbol->sizey*scale)+1;
-
-    if((x <= 1) && (y <= 1)) { // No sense using a tile, just fill solid
-      msImageFilledCircle(img, p, r, fc);
-      if(oc>-1)
-        gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, oc);
-      return;
-    }
-
-
-    tile = gdImageCreate(x, y);
-    if(bc >= 0)
-      tile_bg = gdImageColorAllocate(tile, gdImageRed(img, bc), gdImageGreen(img, bc), gdImageBlue(img, bc));
-    else {
-      tile_bg = gdImageColorAllocate(tile, gdImageRed(img, 0), gdImageGreen(img, 0), gdImageBlue(img, 0));
-      gdImageColorTransparent(tile,0);
-    }
-    tile_fg = gdImageColorAllocate(tile, gdImageRed(img, fc), gdImageGreen(img, fc), gdImageBlue(img, fc));
-   
-
-    if(symbol->filled) {
-
-      for(i=0;i < symbol->numpoints;i++) {
-	sPoints[i].x = OV_NINT(scale*symbol->points[i].x);
-	sPoints[i].y = OV_NINT(scale*symbol->points[i].y);
-      }
-      gdImageFilledPolygon(tile, sPoints, symbol->numpoints, tile_fg);      
-
-    } else  {
-      
-      oldpnt.x = OV_NINT(scale*symbol->points[0].x); 
-      oldpnt.y = OV_NINT(scale*symbol->points[0].y);
-
-
-      for(i=1;i < symbol->numpoints;i++) {
-	if((symbol->points[i].x < 0) && (symbol->points[i].y < 0)) {
-	  oldpnt.x = OV_NINT(scale*symbol->points[i].x);
-	  oldpnt.y = OV_NINT(scale*symbol->points[i].y);
-	} else {
-	  if((symbol->points[i-1].x < 0) && (symbol->points[i-1].y < 0)) { 
-	    oldpnt.x = OV_NINT(scale*symbol->points[i].x);
-	    oldpnt.y = OV_NINT(scale*symbol->points[i].y);
-	  } else {
-	    newpnt.x = OV_NINT(scale*symbol->points[i].x);
-	    newpnt.y = OV_NINT(scale*symbol->points[i].y);
-	    gdImageLine(tile, oldpnt.x, oldpnt.y, newpnt.x, newpnt.y, tile_fg);
-	    oldpnt = newpnt;
-	  }
-	}
-      } // end for loop 
-    }
-
-
-    gdImageSetTile(img, tile);
- 
-    break;
-  default:
-    break;
-  }
-*/
-  /*
-
-  msImageFilledCircle(img, p, r, gdTiled);
-  if(oc>-1)
-    gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, oc);
-
-  if(tile) gdImageDestroy(tile);
-*/
-  return;
-}
-
-
-/* ------------------------------------------------------------------------------- */
-/*       Stroke an ellipse with a line symbol of the specified size and color      */
-/* ------------------------------------------------------------------------------- */
-void ossimGdVectorSource::msCircleDrawLineSymbol( ossimVectorPoint *p, double r, int sy, int fc, int bc, double sz)
-{
-  int i, j;
-  //symbolObj *symbol;
-  int styleDashed[100];
-  int x, y;
-  int brush_bc, brush_fc;
-  gdImagePtr brush=NULL;
-  gdPoint points[OV_MAXVECTORPOINTS];
-
-  double scale=1.0;
-  
-  if(!p) return;
-/*FIXME*/
- // if(sy > symbolset->numsymbols || sy < 0) // no such symbol, 0 is OK
-  //  return;
-
-  if((fc < 0) || (fc >= gdImageColorsTotal(img))) // invalid color
-    return;
-
-  if(sz < 1) // size too small
-    return;
-
-  if(sy == 0) { // just draw a single width line
-    gdImageArc(img, (int)p->x, (int)p->y, (int)r, (int)r, 0, 360, fc);
-    return;
-  }
-/*
-  symbol = &(symbolset->symbol[sy]);
-
-  switch(symbol->type) {
-  case(OV_SYMBOL_SIMPLE):
-    if(bc == -1) bc = gdTransparent;
-    break;
-  case(OV_SYMBOL_TRUETYPE):
-    // msImageTruetypePolyline(img, p, symbol, fc, sz, symbolset->fontset);
-    return;
-    break;
-  case(OV_SYMBOL_ELLIPSE):
-    bc = gdTransparent;
-
-    scale = (sz)/symbol->sizey;
-    x = OV_NINT(symbol->sizex*scale);    
-    y = OV_NINT(symbol->sizey*scale);
-    
-    if((x < 2) && (y < 2)) break;
-    
-    // create the brush image
-    if((brush = searchImageCache(symbolset->imagecache, sy, fc, sz)) == NULL) { // not in cache, create
-      brush = gdImageCreate(x, y);
-      brush_bc = gdImageColorAllocate(brush,gdImageRed(img,0), gdImageGreen(img, 0), gdImageBlue(img, 0));    
-      gdImageColorTransparent(brush,0);
-      brush_fc = gdImageColorAllocate(brush, gdImageRed(img,fc), gdImageGreen(img,fc), gdImageBlue(img,fc));
-      
-      x = OV_NINT(brush->sx/2); // center the ellipse
-      y = OV_NINT(brush->sy/2);
-      
-      // draw in the brush image
-      gdImageArc(brush, x, y, OV_NINT(scale*symbol->points[0].x), OV_NINT(scale*symbol->points[0].y), 0, 360, brush_fc);
-      if(symbol->filled)
-	gdImageFillToBorder(brush, x, y, brush_fc, brush_fc);
-      
-      symbolset->imagecache = addImageCache(symbolset->imagecache, &symbolset->imagecachesize, sy, fc, sz, brush);
-    }
-
-    gdImageSetBrush(img, brush);
-    fc = 1; bc = 0;
-    break;
-  case(OV_SYMBOL_PIXMAP):
-    gdImageSetBrush(img, symbol->img);
-    fc = 1; bc = 0;
-    break;
-  case(OV_SYMBOL_VECTOR):
-    if(bc == -1) bc = gdTransparent;
-
-    scale = sz/symbol->sizey;
-    x = OV_NINT(symbol->sizex*scale);    
-    y = OV_NINT(symbol->sizey*scale);
-
-    if((x < 2) && (y < 2)) break;
-
-    // create the brush image
-    if((brush = searchImageCache(symbolset->imagecache, sy, fc, sz)) == NULL) { // not in cache, create
-      brush = gdImageCreate(x, y);
-      if(bc >= 0)
-	brush_bc = gdImageColorAllocate(brush, gdImageRed(img,bc), gdImageGreen(img,bc), gdImageBlue(img,bc));
-      else {
-	brush_bc = gdImageColorAllocate(brush, gdImageRed(img,0), gdImageGreen(img, 0), gdImageBlue(img, 0));
-	gdImageColorTransparent(brush,0);
-      }
-      brush_fc = gdImageColorAllocate(brush,gdImageRed(img,fc), gdImageGreen(img,fc), gdImageBlue(img,fc));
-      
-      // draw in the brush image 
-      for(i=0;i < symbol->numpoints;i++) {
-	points[i].x = OV_NINT(scale*symbol->points[i].x);
-	points[i].y = OV_NINT(scale*symbol->points[i].y);
-      }
-      gdImageFilledPolygon(brush, points, symbol->numpoints, brush_fc);
-
-      symbolset->imagecache = addImageCache(symbolset->imagecache, &symbolset->imagecachesize, sy, fc, sz, brush);
-    }
-
-    gdImageSetBrush(img, brush);
-    fc = 1; bc = 0;
-    break;
-  }  
-*/
-
-/*
-  if(symbol->stylelength > 0) {
-    int k=0, sc;
-   
-    sc = fc; // start with foreground color
-    for(i=0; i<symbol->stylelength; i++) {      
-      for(j=0; j<symbol->style[i]; j++) {
-	styleDashed[k] = sc;
-	k++;
-      } 
-      if(sc==fc) sc = bc; else sc = fc;
-    }
-    gdImageSetStyle(img, styleDashed, k);
-
-    // gdImageArc(brush, x, y, OV_NINT(scale*symbol->points[0].x), OV_NINT(scale*symbol->points[0].y), 0, 360, brush_fc);
-
-    if(!brush && !symbol->img)
-      gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, gdStyled);      
-    else 
-      gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, gdStyledBrushed);
-  } else {
-    if(!brush && !symbol->img)
-      gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, fc);
-    else
-      gdImageArc(img, (int)p->x, (int)p->y, (int)(2*r), (int)(2*r), 0, 360, gdBrushed);
-  }
-*/
-  return;
-}
-
-
-
 
 int ossimGdVectorSource::clipLine(double *x1, double *y1, double *x2, double *y2, ossimVectorRect rect)
 {
   return 1;
 }
 
-void ossimGdVectorSource::msClipPolylineRect(ossimVectorFeature *shape, ossimVectorRect rect)
+void ossimGdVectorSource::clipPolylineRect(ossimVectorFeature *shape, ossimVectorRect rect)
 {
   int i,j;
   ossimVectorLine line={0,NULL};
 
 
 
-int ossimGdVectorSource::msDrawLabel(ossimVectorPoint labelPnt, char *str, ossimVectorLabel *label)
+int ossimGdVectorSource::drawLabel(ossimVectorPoint labelPnt, char *str, ossimVectorLabel *label)
 {
   if(!str)
     return(0); /* not an error, just don't want to do anything */
     ossimVectorPoint p;
     ossimVectorRect r;
 
-    if(msGetLabelSize(str, label, &r) == -1) return(-1);
+    if(getLabelSize(str, label, &r) == -1) return(-1);
     p = get_metrics(&labelPnt, label->position, r, label->offsetx, label->offsety, label->angle, 0, NULL);
     this->draw_text(p, str, label); /* actually draw the label */
   } else {
 }
 
 
-int ossimGdVectorSource::msDrawShape(ossimVectorFeature *shape, int overlay,ossimVectorRect extent,double cellsize)
+int ossimGdVectorSource::drawFeature(ossimVectorFeature *shape, int overlay,ossimVectorRect extent,double cellsize)
 {
   enum OV_UNITS units;
 units = OV_METERS;
 
   switch(type) {
 
-  case OV_LAYER_CIRCLE:
-    if(shape->numlines != 1) {return 0;} // invalid shape
-    if(shape->line[0].numpoints != 2){return 0;} // invalid shape
-
-    center.x = (shape->line[0].point[0].x + shape->line[0].point[1].x)/2.0;
-    center.y = (shape->line[0].point[0].y + shape->line[0].point[1].y)/2.0;
-    r = OV_ABS(center.x - shape->line[0].point[0].x);
-/*FIXME
-#ifdef USE_PROJ
-    if(msProjectionsDiffer(&(projection), &(projection)))
-        msProjectPoint(&projection, &projection, &center);
-#endif
-*/
-
-    if(transform) {
-      center.x = OV_MAP2IMAGE_X(center.x, extent.minx, cellsize);
-      center.y = OV_MAP2IMAGE_Y(center.y, extent.maxy, cellsize);
-      r *= (inchesPerUnit[units]/inchesPerUnit[units])/cellsize;      
-    }
-
-    if(theStyle->color < 0)
-      msCircleDrawLineSymbol(&center, r, theStyle->symbol, theStyle->outlinecolor, theStyle->backgroundcolor, theStyle->sizescaled);
-    else
-      msCircleDrawShadeSymbol(&center, r, theStyle->symbol, theStyle->color, theStyle->backgroundcolor, theStyle->outlinecolor, theStyle->sizescaled);
-
-    if(overlay && theStyle->overlaysymbol >= 0) {
-      if(theStyle->overlaycolor < 0)
-	msCircleDrawLineSymbol(&center, r, theStyle->overlaysymbol, theStyle->overlayoutlinecolor, theStyle->overlaybackgroundcolor, theStyle->overlaysizescaled);
-      else
-        msCircleDrawShadeSymbol( &center, r, theStyle->overlaysymbol, theStyle->overlaycolor, theStyle->overlaybackgroundcolor, theStyle->overlayoutlinecolor, theStyle->overlaysizescaled);
-    }
-
-    break;
-
-
-  case OV_LAYER_ANNOTATION:
-    if(!shape->text) {return 0;} // nothing to draw
-/*FIXME
-#ifdef USE_PROJ
-    if(msProjectionsDiffer(&(projection), &(projection)))
-       msProjectShape(&projection, &projection, shape);
-#endif
-*/
-    switch(shape->type) {
-    case(OV_SHAPE_LINE):
-      if(transform) {
-	msClipPolylineRect(shape, cliprect);
-	if(shape->numlines == 0) {return 0;}
-	msTransformShape(shape, extent, cellsize);
-      }
-
-      if(shape->msPolylineLabelPoint(&annopnt, theStyle->label.minfeaturesize, &angle, &length) ==  0) {
-
-	if(labelangleitemindex != -1)
-	  theStyle->label.angle = atof(shape->values[labelangleitemindex]);
-
-	if((labelsizeitemindex != -1) && (theStyle->label.type == OV_TRUETYPE)) {
-	  /*FIXME*///theStyle->label.sizescaled = atoi(shape->values[labelsizeitemindex])*((symbolscale > 0) ? (symbolscale/map->scale):1);
-	  theStyle->label.sizescaled = OV_MAX(theStyle->label.sizescaled, theStyle->label.minsize);
-	  theStyle->label.sizescaled = OV_MIN(theStyle->label.sizescaled, theStyle->label.maxsize);
-	}
-
-	if(theStyle->label.autoangle)
-	  theStyle->label.angle = angle;
-
-	if(labelcache)
-	  msAddLabel(index, c, shape->tileindex, shape->index, annopnt, shape->text, length);
-	else {
-	  if(theStyle->color != -1) {
-	    msDrawMarkerSymbol(&annopnt, theStyle->symbol, theStyle->color, theStyle->backgroundcolor, theStyle->outlinecolor, theStyle->sizescaled);
-	    if(theStyle->overlaysymbol >= 0) msDrawMarkerSymbol(&annopnt, theStyle->overlaysymbol, theStyle->overlaycolor, theStyle->overlaybackgroundcolor, theStyle->overlayoutlinecolor, theStyle->overlaysizescaled);
-	  }
-	  msDrawLabel(annopnt, shape->text, &(theStyle->label));
-	}
-      }
-
-      break;
-    case(OV_SHAPE_POLYGON):
-
-      if(transform) {
-	msClipPolygonRect(shape, cliprect);
-	if(shape->numlines == 0) { return 0;}
-	msTransformShape(shape, extent, cellsize);
-      }
-
-      if(shape->msPolygonLabelPoint(&annopnt, theStyle->label.minfeaturesize) == 0) {
-
-	if(labelangleitemindex != -1)
-	  theStyle->label.angle = atof(shape->values[labelangleitemindex]);
-
-	if((labelsizeitemindex != -1) && (theStyle->label.type == OV_TRUETYPE)) {
-	  theStyle->label.sizescaled = atoi(shape->values[labelsizeitemindex])*((symbolscale > 0) ? scalefactor:1);
-	  theStyle->label.sizescaled = OV_MAX(theStyle->label.sizescaled, theStyle->label.minsize);
-	  theStyle->label.sizescaled = OV_MIN(theStyle->label.sizescaled, theStyle->label.maxsize);
-	}
-
-	if(labelcache)
-	  msAddLabel(index, c, shape->tileindex, shape->index, annopnt, shape->text, length);
-	else {
-	  if(theStyle->color != -1) {
-	    msDrawMarkerSymbol( &annopnt, theStyle->symbol, theStyle->color, theStyle->backgroundcolor, theStyle->outlinecolor, theStyle->sizescaled);
-	    if(theStyle->overlaysymbol >= 0) msDrawMarkerSymbol( &annopnt, theStyle->overlaysymbol, theStyle->overlaycolor, theStyle->overlaybackgroundcolor, theStyle->overlayoutlinecolor, theStyle->overlaysizescaled);
-	  }
-	  msDrawLabel(annopnt, shape->text, &(theStyle->label));
-	}
-      }
-      break;
-    default: // points and anything with out a proper type
-      for(j=0; j<shape->numlines;j++) {
-	for(i=0; i<shape->line[j].numpoints;i++) {
-
-	  point = &(shape->line[j].point[i]);
-
-	  if(transform) {
-	    if(!shape->msPointInRect(point, &extent)){ return 0;}
-	    point->x = OV_MAP2IMAGE_X(point->x, extent.minx, cellsize);
-	    point->y = OV_MAP2IMAGE_Y(point->y, extent.maxy, cellsize);
-	  }
-
-	  if(labelangleitemindex != -1)
-	    theStyle->label.angle = atof(shape->values[labelangleitemindex]);
-
-	  if((labelsizeitemindex != -1) && (theStyle->label.type == OV_TRUETYPE)) {
-	    theStyle->label.sizescaled = atoi(shape->values[labelsizeitemindex])*((symbolscale > 0) ? scalefactor:1);
-	    theStyle->label.sizescaled = OV_MAX(theStyle->label.sizescaled, theStyle->label.minsize);
-	    theStyle->label.sizescaled = OV_MIN(theStyle->label.sizescaled, theStyle->label.maxsize);
-	  }
-
-	  if(shape->text) {
-	    if(labelcache)
-	      msAddLabel(index, c, shape->tileindex, shape->index, *point, shape->text, -1);
-	    else {
-	      if(theStyle->color == -1) {
-		msDrawMarkerSymbol(point, theStyle->symbol, theStyle->color, theStyle->backgroundcolor, theStyle->outlinecolor, theStyle->sizescaled);
-		if(theStyle->overlaysymbol >= 0) msDrawMarkerSymbol(point, theStyle->overlaysymbol, theStyle->overlaycolor, theStyle->overlaybackgroundcolor, theStyle->overlayoutlinecolor, theStyle->overlaysizescaled);
-	      }
-	      msDrawLabel(*point, shape->text, &theStyle->label);
-	    }
-	  }
-	}
-      }
-    }
-    break;
-
   case OV_LAYER_POINT:
 /*FIXME
 #ifdef USE_PROJ
 	  point->y = OV_MAP2IMAGE_Y(point->y, extent.maxy, cellsize);
 	}
 
-	msDrawMarkerSymbol(point, theStyle->symbol, theStyle->color, theStyle->backgroundcolor, theStyle->outlinecolor, theStyle->sizescaled);
-	if(overlay && theStyle->overlaysymbol >= 0) msDrawMarkerSymbol(point, theStyle->overlaysymbol, theStyle->overlaycolor, theStyle->overlaybackgroundcolor, theStyle->overlayoutlinecolor, theStyle->overlaysizescaled);
+	drawMarker(point, theStyle->symbol, theStyle->color, theStyle->backgroundcolor, theStyle->outlinecolor, theStyle->sizescaled);
+	if(overlay && theStyle->overlaysymbol >= 0) drawMarker(point, theStyle->overlaysymbol, theStyle->overlaycolor, theStyle->overlaybackgroundcolor, theStyle->overlayoutlinecolor, theStyle->overlaysizescaled);
 
 	if(shape->text) {
 	  if(labelangleitemindex != -1)
 	  }
 
 	  if(labelcache)
-	    msAddLabel(index, c, shape->tileindex, shape->index, *point, shape->text, -1);
+	    addLabel(index, c, shape->tileindex, shape->index, *point, shape->text, -1);
 	  else
-	    msDrawLabel(*point, shape->text, &theStyle->label);
+	    drawLabel(*point, shape->text, &theStyle->label);
 	}
       }
     }
 #endif
 */
     if(transform) {
-      msClipPolylineRect(shape, cliprect);
+      clipPolylineRect(shape, cliprect);
       if(shape->numlines == 0) {return 0;}
-      msTransformShape(shape, extent, cellsize);
+      transformFeature(shape, extent, cellsize);
     }
 
-    msDrawLineSymbol(shape, theStyle->symbol, theStyle->color, theStyle->backgroundcolor, theStyle->sizescaled);
-    if(overlay && theStyle->overlaysymbol >= 0) msDrawLineSymbol( shape, theStyle->overlaysymbol, theStyle->overlaycolor, theStyle->overlaybackgroundcolor, theStyle->overlaysizescaled);
+    drawLine(shape, theStyle->symbol, theStyle->color, theStyle->backgroundcolor, theStyle->sizescaled);
+    if(overlay && theStyle->overlaysymbol >= 0) drawLine( shape, theStyle->overlaysymbol, theStyle->overlaycolor, theStyle->overlaybackgroundcolor, theStyle->overlaysizescaled);
 
     if(shape->text) {
       if(shape->msPolylineLabelPoint(&annopnt, theStyle->label.minfeaturesize, &angle, &length) == 0) {
 	  theStyle->label.angle = angle;
 
 	if(labelcache)
-	  msAddLabel(index, c, shape->tileindex, shape->index, annopnt, shape->text, length);
+	  addLabel(index, c, shape->tileindex, shape->index, annopnt, shape->text, length);
 	else
-	  msDrawLabel(annopnt, shape->text, &theStyle->label);
+	  drawLabel(annopnt, shape->text, &theStyle->label);
       }
     }
     break;
 
   case OV_LAYER_POLYGON:
 
-      this->msClipPolygonRect(shape, cliprect);
+      this->clipPolygonRect(shape, cliprect);
       if(shape->numlines == 0) {return(0);}
-      this->msTransformShape(shape, extent, cellsize);
+      this->transformFeature(shape, extent, cellsize);
 
 
-      //msDrawShadeSymbol(shape, 0, 1, -1,2, 1);
+      //drawShade(shape, 0, 1, -1,2, 1);
 
 
     if(theStyle->color < 0)
-      msDrawLineSymbol( shape, theStyle->symbol, theStyle->outlinecolor, theStyle->backgroundcolor, theStyle->sizescaled);
+      drawLine( shape, theStyle->symbol, theStyle->outlinecolor, theStyle->backgroundcolor, theStyle->sizescaled);
     else
 
-      msDrawShadeSymbol(shape, theStyle->symbol, 1, theStyle->backgroundcolor, theStyle->outlinecolor, theStyle->sizescaled);
+      drawShade(shape, theStyle->symbol, 1, theStyle->backgroundcolor, theStyle->outlinecolor, theStyle->sizescaled);
 
 
 
     if(overlay && theStyle->overlaysymbol >= 0) {
       if(theStyle->overlaycolor < 0)
-	msDrawLineSymbol(shape, theStyle->overlaysymbol, theStyle->overlayoutlinecolor, theStyle->overlaybackgroundcolor, theStyle->overlaysizescaled);
+	drawLine(shape, theStyle->overlaysymbol, theStyle->overlayoutlinecolor, theStyle->overlaybackgroundcolor, theStyle->overlaysizescaled);
 
     }
 
 	}
 
 	if(labelcache)
-	  msAddLabel(0, 0, shape->tileindex, shape->index, annopnt, shape->text, -1);
+	  addLabel(0, 0, shape->tileindex, shape->index, annopnt, shape->text, -1);
 	else
-	  msDrawLabel(annopnt, shape->text, &theStyle->label);
+	  drawLabel(annopnt, shape->text, &theStyle->label);
       }
     }
 
 /* ------------------------------------------------------------------------------- */
 /*       Draw a single marker symbol of the specified size and color               */
 /* ------------------------------------------------------------------------------- */
-void ossimGdVectorSource::msDrawMarkerSymbol(ossimVectorPoint *p, int sy, int fc, int bc, int oc, double sz)
+void ossimGdVectorSource::drawMarker(ossimVectorPoint *p, int sy, int fc, int bc, int oc, double sz)
 {
 //  symbolObj *symbol;
   int offset_x, offset_y, x, y;
   return;
 }
 
-void ossimGdVectorSource::msTransformShape(ossimVectorFeature *shape, ossimVectorRect extent, double cellsize)
+void ossimGdVectorSource::transformFeature(ossimVectorFeature *shape, ossimVectorRect extent, double cellsize)
 {
   int i,j,k; /* loop counters */
 
   if(shape->type == OV_SHAPE_LINE || shape->type == OV_SHAPE_POLYGON) { // remove co-linear vertices
   
     for(i=0; i<shape->numlines; i++) { // for each part
-      
+      //cout << shape->line[i].point[0].x << "::" << shape->line[i].point[0].y << endl;
+
       shape->line[i].point[0].x = OV_MAP2IMAGE_X(shape->line[i].point[0].x, extent.minx, cellsize);
       shape->line[i].point[0].y = OV_MAP2IMAGE_Y(shape->line[i].point[0].y, extent.maxy, cellsize);
-      
+
+      //cout << shape->line[i].point[0].x << "::" << shape->line[i].point[0].y << endl;
+      //cout << extent.maxy << endl;
+
+   
       for(j=1, k=1; j < shape->line[i].numpoints; j++ ) {
 	
 	shape->line[i].point[k].x = OV_MAP2IMAGE_X(shape->line[i].point[j].x, extent.minx, cellsize);
 
 #define NUM_SCANLINES 5
 
-void ossimGdVectorSource::msGetMarkerSize(/*FIXME ossimVectorStyle *style,*/ int *width, int *height)
-{
-/*FIXME*/
-  //if(style->symbol == 0) 
- {
-    *width = 1;
-    *height = 1;
-    return;
-  }
-}
 
 
-int ossimGdVectorSource::msSaveImage(const char* filename)
+
+int ossimGdVectorSource::saveImage(const char* filename)
 {
   FILE *stream;
   if(filename != NULL && strlen(filename) > 0) {
     ** Change stdout mode to binary on win32 platforms
     */
     if(_setmode( _fileno(stdout), _O_BINARY) == -1) {
-      printf( "Unable to change stdout to binary mode. msSaveImage()");
+      printf( "Unable to change stdout to binary mode. saveImage()");
       return 1;
     }
 #endif
 }
 
 
-int ossimGdVectorSource::msDrawLabelCache()
+int ossimGdVectorSource::drawLabelCache()
 {
   ossimVectorPoint p;
   int i, j, l;
     if(strlen(cachePtr->str) == 0)
       continue; 
 
-    if(msGetLabelSize(cachePtr->str, labelPtr, &r) == -1)
+    if(getLabelSize(cachePtr->str, labelPtr, &r) == -1)
       return(-1);
 
     if(labelPtr->autominfeaturesize && ((r.maxx-r.minx) > cachePtr->featuresize))
     draw_marker = marker_offset_x = marker_offset_y = 0;
     if((type == OV_LAYER_ANNOTATION || type == OV_LAYER_POINT) && (classPtr->color >= 0 || classPtr->outlinecolor > 0 || classPtr->symbol > 0)) { // there *is* a marker
 
-      msGetMarkerSize(&marker_width, &marker_height);
+
+      marker_width = 1;marker_height = 1;
       marker_offset_x = OV_NINT(marker_width/2.0);
       marker_offset_y = OV_NINT(marker_height/2.0);      
 
 
 	for(j=0; j<2; j++) { 
 
-	  cachePtr->poly->msFreeShape();
+	  cachePtr->poly->destroy();
 	  cachePtr->status = 1;
 
 	  if(j == 1) {
 	  p = this->get_metrics(&(cachePtr->point), position, r, (marker_offset_x + labelPtr->offsetx), (marker_offset_y + labelPtr->offsety), labelPtr->angle, labelPtr->buffer, cachePtr->poly);
 
 	  if(draw_marker)
-	    this->msRectToPolygon(marker_rect, cachePtr->poly); // save marker bounding polygon
+	    this->rectToPolygon(marker_rect, cachePtr->poly); // save marker bounding polygon
 
 	  if(!labelPtr->partials) { // check against image first
 	    if(labelInImage(img->sx, img->sy, cachePtr->poly, labelPtr->buffer) == 0) {
  {
 	for(j=0; j<=7; j++) { 
 
-	  cachePtr->poly->msFreeShape();
+	  cachePtr->poly->destroy();
 	  cachePtr->status = 1;
 
 	  p = this->get_metrics(&(cachePtr->point), j, r, (marker_offset_x + labelPtr->offsetx), (marker_offset_y + labelPtr->offsety), labelPtr->angle, labelPtr->buffer, cachePtr->poly);
 
 	  if(draw_marker)
-	    this->msRectToPolygon(marker_rect, cachePtr->poly); // save marker bounding polygon
+	    this->rectToPolygon(marker_rect, cachePtr->poly); // save marker bounding polygon
 
 	  if(!labelPtr->partials) { // check against image first
 	    if(this->labelInImage(img->sx, img->sy, cachePtr->poly, labelPtr->buffer) == 0) {
         p = get_metrics(&(cachePtr->point), labelPtr->position, r, (marker_offset_x + labelPtr->offsetx), (marker_offset_y + labelPtr->offsety), labelPtr->angle, labelPtr->buffer, cachePtr->poly);
 
       if(draw_marker)
-	this->msRectToPolygon(marker_rect, cachePtr->poly); 
+	this->rectToPolygon(marker_rect, cachePtr->poly); 
 
       if(!labelPtr->force) { // no need to check anything else
 
       continue; 
 
     if(draw_marker) { 
-      msDrawMarkerSymbol(&(cachePtr->point), classPtr->symbol, classPtr->color, classPtr->backgroundcolor, classPtr->outlinecolor, classPtr->sizescaled);
-      if(classPtr->overlaysymbol >= 0) msDrawMarkerSymbol(&(cachePtr->point), classPtr->overlaysymbol, classPtr->overlaycolor, classPtr->overlaybackgroundcolor, classPtr->overlayoutlinecolor, classPtr->overlaysizescaled);
+      drawMarker(&(cachePtr->point), classPtr->symbol, classPtr->color, classPtr->backgroundcolor, classPtr->outlinecolor, classPtr->sizescaled);
+      if(classPtr->overlaysymbol >= 0) drawMarker(&(cachePtr->point), classPtr->overlaysymbol, classPtr->overlaycolor, classPtr->overlaybackgroundcolor, classPtr->overlayoutlinecolor, classPtr->overlaysizescaled);
     }
 
     if(labelPtr->backgroundcolor >= 0)
   int i;
   ossimVectorFeature temp;
 
-  temp.msInitShape();
+  temp.init();
   temp.msAddLine(&shape->line[0]);
 
   if(label->backgroundshadowcolor >= 0) {
       temp.line[0].point[i].x += label->backgroundshadowsizex;
       temp.line[0].point[i].y += label->backgroundshadowsizey;
     }
-    msImageFilledPolygon(&temp, label->backgroundshadowcolor);
+    imageFilledPolygon(&temp, label->backgroundshadowcolor);
     for(i=0; i<temp.line[0].numpoints; i++) {
       temp.line[0].point[i].x -= label->backgroundshadowsizex;
       temp.line[0].point[i].y -= label->backgroundshadowsizey;
     }
   }
 
-  msImageFilledPolygon(&temp, label->backgroundcolor);
+  imageFilledPolygon(&temp, label->backgroundcolor);
 
-  temp.msFreeShape();
+  temp.destroy();
 }
 
 
   return 0;
 }
 
-void ossimGdVectorSource::msRectToPolygon(ossimVectorRect rect, ossimVectorFeature *poly)
+void ossimGdVectorSource::rectToPolygon(ossimVectorRect rect, ossimVectorFeature *poly)
 {
   ossimVectorLine line={0,NULL};
 
 }
 
 
-int ossimGdVectorSource::msGetLabelSize(char *str, ossimVectorLabel *label, ossimVectorRect *rect) 
+int ossimGdVectorSource::getLabelSize(char *str, ossimVectorLabel *label, ossimVectorRect *rect) 
 {
 /*
   if(label->type == OV_TRUETYPE) {
     if(!font) {
       if(label->font) 
           msSetError(OV_TTFERR, "Requested font (%s) not found.", 
-                     "msGetLabelSize()", label->font);
+                     "getLabelSize()", label->font);
       else
           msSetError(OV_TTFERR, "Requested font (NULL) not found.", 
-                     "msGetLabelSize()" );
+                     "getLabelSize()" );
       return(-1);
     }
 
     error = gdImageStringFT(NULL, bbox, 0, font, label->sizescaled, 0, 0, 0, str);
 #endif
     if(error) {
-      msSetError(OV_TTFERR, error, "msGetLabelSize()");
+      msSetError(OV_TTFERR, error, "getLabelSize()");
       return(-1);
     }
 
     rect->maxx = bbox[2];
     rect->maxy = bbox[1];
 #else
-    msSetError(OV_TTFERR, "TrueType font support is not available.", "msGetLabelSize()");
+    msSetError(OV_TTFERR, "TrueType font support is not available.", "getLabelSize()");
     return(-1);
 #endif
   } else 
     unsigned char **token=NULL;
     int t, num_tokens, max_token_length=0;
 
-    if((fontPtr = msGetBitmapFont(label->size)) == NULL)
+    if((fontPtr = getBitmapFont(label->size)) == NULL)
       return(-1);
 
     if(label->wrap != '\0') {
   return(0);
 }
 
-gdFontPtr ossimGdVectorSource::msGetBitmapFont(int size)
+gdFontPtr ossimGdVectorSource::getBitmapFont(int size)
 {
 
 return gdFontSmall;
     return(gdFontGiant);
     break;
   default:
-    msSetError(OV_GDERR,"Invalid bitmap font. Must be one of tiny, small, medium, large or giant." , "msGetBitmapFont()");
+    msSetError(OV_GDERR,"Invalid bitmap font. Must be one of tiny, small, medium, large or giant." , "getBitmapFont()");
     return(NULL);
   }
 */
 }
 
 
-int ossimGdVectorSource::msAddLabel(int layeridx, int classidx, int tileidx, int shapeidx, ossimVectorPoint point, char *str, double featuresize)
+int ossimGdVectorSource::addLabel(int layeridx, int classidx, int tileidx, int shapeidx, ossimVectorPoint point, char *str, double featuresize)
 {
   int i;
   char wrap[2];
   if(label_cache.numlabels == label_cache.cachesize) { /* just add it to the end */
     label_cache.labels = (ossimVectorLabelCacheMember *) realloc(label_cache.labels, sizeof(ossimVectorLabelCacheMember)*(label_cache.cachesize+OV_LABELCACHEINCREMENT));
     if(!label_cache.labels) {
-      printf("Realloc() error. msAddLabel()");
+      printf("Realloc() error. addLabel()");
       return(-1);
     }
     label_cache.cachesize += OV_LABELCACHEINCREMENT;
   label_cache.labels[i].point.x = OV_NINT(label_cache.labels[i].point.x);
   label_cache.labels[i].point.y = OV_NINT(label_cache.labels[i].point.y);
 
-  label_cache.labels[i].str = strdup(str);
+  label_cache.labels[i].str = str;
 
   // GD/Freetype recognizes \r\n as a true line wrap so we must turn the wrap character into that pattern
 /*  if(map->layers[layeridx]._class[classidx].label.type != OV_BITMAP && map->layers[layeridx]._class[classidx].label.wrap != '\0') {
   label_cache.labels[i].featuresize = featuresize;
 
   label_cache.labels[i].poly = (ossimVectorFeature *) malloc(sizeof(ossimVectorFeature));
-  label_cache.labels[i].poly->msInitShape();
+  label_cache.labels[i].poly->init();
 
   label_cache.labels[i].status = 0;
 
     if(label_cache.nummarkers == label_cache.markercachesize) { /* just add it to the end */
       label_cache.markers = (ossimVectorMarkerCacheMember *) realloc(label_cache.markers, sizeof(ossimVectorMarkerCacheMember)*(label_cache.cachesize+OV_LABELCACHEINCREMENT));
       if(!label_cache.markers) {
-	printf( "Realloc() error. msAddLabel()");
+	printf( "Realloc() error. addLabel()");
 	return(-1);
       }
       label_cache.markercachesize+=OV_LABELCACHEINCREMENT;
     i = label_cache.nummarkers;
 
     label_cache.markers[i].poly = (ossimVectorFeature *) malloc(sizeof(ossimVectorFeature));
-    label_cache.markers[i].poly->msInitShape();
+    label_cache.markers[i].poly->init();
+    w = 1; h = 1;
 
-    msGetMarkerSize( &w, &h);
     rect.minx = OV_NINT(point.x - .5 * w);
     rect.miny = OV_NINT(point.y - .5 * h);
     rect.maxx = rect.minx + (w-1);
     rect.maxy = rect.miny + (h-1);
-    msRectToPolygon(rect, label_cache.markers[i].poly);
+    rectToPolygon(rect, label_cache.markers[i].poly);
     label_cache.markers[i].id = label_cache.numlabels;
 
     label_cache.nummarkers++;
     int t, num_tokens;
     gdFontPtr fontPtr;
 
-    if((fontPtr = msGetBitmapFont(label->size)) == NULL)
+    if((fontPtr = getBitmapFont(label->size)) == NULL)
       return(-1);
 
     if(label->wrap != '\0') {
 
 
 
-void ossimGdVectorSource::msDrawLineSymbol(ossimVectorFeature *p, int sy, int fc, int bc, double sz)
+void ossimGdVectorSource::drawLine(ossimVectorFeature *p, int sy, int fc, int bc, double sz)
 {
   int i, j;
 //  symbolObj *symbol;
     return;
 
   if(sy == 0) { // just draw a single width line
-    msImagePolyline(p, fc);
+    imagePolyline(p, fc);
     return;
   }
 /*
     gdImageSetStyle(img, styleDashed, k);
 
     if(!brush && !symbol->img)
-      msImagePolyline(img, p, gdStyled);
+      imagePolyline(img, p, gdStyled);
     else 
-      msImagePolyline(img, p, gdStyledBrushed);
+      imagePolyline(img, p, gdStyledBrushed);
   } else {
     if(!brush && !symbol->img)
-      msImagePolyline(img, p, fc);
+      imagePolyline(img, p, fc);
     else
-      msImagePolyline(img, p, gdBrushed);
+      imagePolyline(img, p, gdBrushed);
   }
 */
 
 /* ------------------------------------------------------------------------------- */
 /*       Draw a shade symbol of the specified size and color                       */
 /* ------------------------------------------------------------------------------- */
-void ossimGdVectorSource::msDrawShadeSymbol(ossimVectorFeature *p, int sy, int fc, int bc, int oc, double sz)
+void ossimGdVectorSource::drawShade(ossimVectorFeature *p, int sy, int fc, int bc, int oc, double sz)
 {
 //  symbolObj *symbol;
   int i;
   
   if(sy == 0) { /* simply draw a single pixel of the specified color */
     if(fc>-1)
-      msImageFilledPolygon(p, fc);
+      imageFilledPolygon(p, fc);
     if(oc>-1)
-      msImagePolyline(p, oc);
+      imagePolyline(p, oc);
     return;
   }
 
   if(fc<0) {
     if(oc>-1)
-      msImagePolyline(p, oc);
+      imagePolyline(p, oc);
     return;
   }
 /*
 #endif    
 
     gdImageSetTile(img, tile);
-    msImageFilledPolygon(img,p,gdTiled);
+    imageFilledPolygon(img,p,gdTiled);
     if(oc>-1)
-      msImagePolyline(img, p, oc);
+      imagePolyline(img, p, oc);
     gdImageDestroy(tile);
 #endif
 
   case(OV_SYMBOL_PIXMAP):
     
     gdImageSetTile(img, symbol->img);
-    msImageFilledPolygon(img, p, gdTiled);
+    imageFilledPolygon(img, p, gdTiled);
     if(oc>-1)
-      msImagePolyline(img, p, oc);
+      imagePolyline(img, p, oc);
 
     break;
   case(OV_SYMBOL_ELLIPSE):    
     y = OV_NINT(symbol->sizey*scale)+1;
 
     if((x <= 1) && (y <= 1)) { 
-      msImageFilledPolygon(img, p, fc);
+      imageFilledPolygon(img, p, fc);
       if(oc>-1)
-        msImagePolyline(img, p, oc);
+        imagePolyline(img, p, oc);
       return;
     }
 
 
  
     gdImageSetTile(img, tile);
-    msImageFilledPolygon(img,p,gdTiled);
+    imageFilledPolygon(img,p,gdTiled);
     if(oc>-1)
-      msImagePolyline(img, p, oc);
+      imagePolyline(img, p, oc);
     gdImageDestroy(tile);
 
     break;
     y = OV_NINT(symbol->sizey*scale)+1;
 
     if((x <= 1) && (y <= 1)) { 
-      msImageFilledPolygon(img, p, fc);
+      imageFilledPolygon(img, p, fc);
       if(oc>-1)
-        msImagePolyline(img, p, oc);
+        imagePolyline(img, p, oc);
       return;
     }
 
 
    
     gdImageSetTile(img, tile);
-    msImageFilledPolygon(img, p, gdTiled);
+    imageFilledPolygon(img, p, gdTiled);
     if(oc>-1)
-      msImagePolyline(img, p, oc);
+      imagePolyline(img, p, oc);
 
     break;
   default:
 
 
 
-void ossimGdVectorSource::msImageScanline(int x1, int x2, int y, int c)
+void ossimGdVectorSource::imageScanline(int x1, int x2, int y, int c)
 {
   int x;
 
     gdImageSetPixel(img, x, y, c);
 }
 
-void ossimGdVectorSource::msImagePolyline(ossimVectorFeature *p, int c)
+void ossimGdVectorSource::imagePolyline(ossimVectorFeature *p, int c)
 {
   int i, j;
   
 
 
 
-void ossimGdVectorSource::msImageFilledCircle(ossimVectorPoint *p, int r, int c)
-{
-  int y;
-  int ymin, ymax, xmin, xmax;
-  double dx, dy;
-
-  ymin = OV_MAX((p->y - r), 0);
-  ymax = OV_MIN((p->y + r), (gdImageSY(img)-1));
-
-  for(y=ymin; y<=ymax; y++) {
-    dy = OV_ABS(p->y - y);
-    dx = sqrt((r*r) - (dy*dy));
-
-    xmin = OV_MAX((p->x - dx), 0);
-    xmax = OV_MIN((p->x + dx), (gdImageSX(img)-1));
-
-    msImageScanline(xmin, xmax, y, c);
-  }
-
-  return;
-}
-
-void ossimGdVectorSource::msImageFilledPolygon(ossimVectorFeature *p, int c)
+void ossimGdVectorSource::imageFilledPolygon(ossimVectorFeature *p, int c)
 {
   float *slope;
   ossimVectorPoint point1, point2, testpoint1, testpoint2;
     
     /* Great, now we can draw the spans */
     for(i=0; i < nfound; i += 2)
-      msImageScanline(xintersect[i], xintersect[i+1], y, c);
+      imageScanline(xintersect[i], xintersect[i+1], y, c);
   } /* End of scanline loop */
   
   /* Finally, draw all of the horizontal edges */
     for(i=0; i<p->line[j].numpoints; i++, l++) {
       point2 = p->line[j].point[i];
       if(horiz[l])
-	msImageScanline(point1.x, point2.x, point2.y, c);
+	imageScanline(point1.x, point2.x, point2.y, c);
       point1 = point2;
     }
   }

File ossimGdVectorSource.h

 
 ~ossimGdVectorSource();
 
-int msDrawShape( ossimVectorFeature *shape, int overlay,ossimVectorRect extent,double cellsize);
+int drawFeature( ossimVectorFeature *feature, int overlay,ossimVectorRect extent,double cellsize);
 
-void msClipPolygonRect(ossimVectorFeature *shape, ossimVectorRect rect);
+void clipPolygonRect(ossimVectorFeature *feature, ossimVectorRect rect);
 
-void msTransformShape(ossimVectorFeature *shape, ossimVectorRect extent, double cellsize);
+void transformFeature(ossimVectorFeature *feature, ossimVectorRect extent, double cellsize);
 
 double dist(ossimVectorPoint a, ossimVectorPoint b);
 /*FIXME*/
-int msAddLabel(int layeridx, int classidx, int tileidx, int shapeidx, ossimVectorPoint point, char *str, double featuresize);
+int addLabel(int layeridx, int classidx, int tileidx, int shapeidx, ossimVectorPoint point, char *str, double featuresize);
 
-int msSaveImage(const char* filename);
+int saveImage(const char* filename);
 
-int msDrawLabel(ossimVectorPoint labelPnt, char *str, ossimVectorLabel *label);
+int drawLabel(ossimVectorPoint labelPnt, char *str, ossimVectorLabel *label);
 
-void msDrawLineSymbol(ossimVectorFeature *p, int sy, int fc, int bc, double sz);
+void drawLine(ossimVectorFeature *feature, int sy, int fc, int bc, double sz);
 
-void msDrawShadeSymbol(ossimVectorFeature *p, int sy, int fc, int bc, int oc, double sz);