- Main Page
- Related Pages
- Modules
- Classes
- Files

# SpatialGeometryConverter.h

Go to the documentation of this file.

    00001 /*
    00002 * Copyright (C) 2004-2006  Autodesk, Inc.
    00003 *
    00004 * This library is free software; you can redistribute it and/or
    00005 * modify it under the terms of version 2.1 of the GNU Lesser
    00006 * General Public License as published by the Free Software Foundation.
    00007 *
    00008 * This library is distributed in the hope that it will be useful,
    00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00011 * Lesser General Public License for more details.
    00012 *
    00013 * You should have received a copy of the GNU Lesser General Public
    00014 * License along with this library; if not, write to the Free Software
    00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    00016 */
    00017
    00018 #ifndef FDOSPATIALGEOMETRYCONVERTER_H
    00019 #define FDOSPATIALGEOMETRYCONVERTER_H
    00020
    00021 #ifdef _WIN32
    00022 #pragma once
    00023 #endif //_WIN32
    00024
    00025 // This class shows how to use the Geometry API to analyse a geometry in detail.
    00026 // This example copies a geometry while applying a trivial transformation
    00027 // (swapping X and Y ordinates) to each ordinate.  It can also convert between
    00028 // dimensionalities.
    00029 class FdoSpatialGeometryConverter
    00030 {
    00031 public:
    00032     FDO_SPATIAL_API FdoSpatialGeometryConverter() {};
    00033     FDO_SPATIAL_API virtual ~FdoSpatialGeometryConverter() {};
    00034
    00035 public:
    00036     FDO_SPATIAL_API FdoIGeometry * ConvertOrdinates(
    00037         FdoIGeometry * geometry,
    00038         bool applyTargetDimensionality=false,
    00039         FdoInt32 targetDimensionality = 0,
    00040         double padValueZ = 0.0,
    00041         double padValueM = 0.0);
    00042
    00043     FDO_SPATIAL_API virtual void ConvertPosition(
    00044         double &x,
    00045         double &y) = 0;
    00046
    00047     FDO_SPATIAL_API virtual void ConvertPosition(
    00048         double &x,
    00049         double &y,
    00050         double &z) = 0;
    00051
    00052 protected:
    00053
    00054     void ConvertOrdinates(
    00055         FdoInt32 inputDim,
    00056         FdoInt32 numPositions,
    00057         const double * inputOrds,
    00058         double padValueZ,
    00059         double padValueM,
    00060         FdoInt32 outputDim,
    00061         double * outputOrds);
    00062
    00063     FdoILinearRing * ConvertOrdinates(
    00064         FdoILinearRing * ring,
    00065         FdoInt32 outputDim,
    00066         double padValueZ,
    00067         double padValueM);
    00068
    00069     FdoCurveSegmentCollection * ConvertOrdinates(
    00070         FdoCurveSegmentCollection * csc,
    00071         FdoInt32 outputDim,
    00072         double padValueZ,
    00073         double padValueM);
    00074
    00075     FdoICurveSegmentAbstract * ConvertOrdinates(
    00076         FdoICurveSegmentAbstract * cs,
    00077         FdoInt32 outputDim,
    00078         double padValueZ,
    00079         double padValueM);
    00080
    00081     double * AllocateOrdinates(FdoInt32 numOrdinates);
    00082
    00083     FdoInt32 DimensionalityToNumOrdinates(FdoInt32 dimensionality);
    00084 };
    00085
    00086 #endif

Please send us your comment about this page