本文整理汇总了C++中VALIDATE_POINTER1函数的典型用法代码示例。如果您正苦于以下问题:C++ VALIDATE_POINTER1函数的具体用法?C++ VALIDATE_POINTER1怎么用?C++ VALIDATE_POINTER1使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VALIDATE_POINTER1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OGR_L_Dereference
int OGR_L_Dereference( OGRLayerH hLayer )
{
VALIDATE_POINTER1( hLayer, "OGR_L_Dereference", 0 );
return ((OGRLayer *) hLayer)->Dereference();
}
示例2: GDALCloneColorTable
/**
* \brief Make a copy of a color table.
*
* This function is the same as the C++ method GDALColorTable::Clone()
*/
GDALColorTableH CPL_STDCALL GDALCloneColorTable( GDALColorTableH hTable )
{
VALIDATE_POINTER1( hTable, "GDALCloneColorTable", NULL );
return (GDALColorTableH) ((GDALColorTable *) hTable)->Clone();
}
示例3: GDALTPSTransform
int GDALTPSTransform( void *pTransformArg, int bDstToSrc,
int nPointCount,
double *x, double *y,
CPL_UNUSED double *z,
int *panSuccess )
{
VALIDATE_POINTER1( pTransformArg, "GDALTPSTransform", 0 );
int i;
TPSTransformInfo *psInfo = (TPSTransformInfo *) pTransformArg;
for( i = 0; i < nPointCount; i++ )
{
double xy_out[2];
if( bDstToSrc )
{
psInfo->poReverse->get_point( x[i], y[i], xy_out );
x[i] = xy_out[0];
y[i] = xy_out[1];
}
else
{
psInfo->poForward->get_point( x[i], y[i], xy_out );
x[i] = xy_out[0];
y[i] = xy_out[1];
}
panSuccess[i] = TRUE;
}
return TRUE;
}
示例4: OGR_G_Length
double OGR_G_Length( OGRGeometryH hGeom )
{
VALIDATE_POINTER1( hGeom, "OGR_G_GetLength", 0 );
double dfLength;
OGRwkbGeometryType eType = wkbFlatten(((OGRGeometry *) hGeom)->getGeometryType());
if( OGR_GT_IsCurve(eType) )
{
dfLength = ((OGRCurve *) hGeom)->get_Length();
}
else if( OGR_GT_IsSubClassOf(eType, wkbMultiCurve) ||
eType == wkbGeometryCollection )
{
dfLength = ((OGRGeometryCollection *) hGeom)->get_Length();
}
else
{
CPLError( CE_Warning, CPLE_AppDefined,
"OGR_G_Length() called against a non-curve geometry type." );
dfLength = 0.0;
}
return dfLength;
}
示例5: OSRImportFromXML
/**
* \brief Import coordinate system from XML format (GML only currently).
*
* This function is the same as OGRSpatialReference::importFromXML().
*/
OGRErr OSRImportFromXML(OGRSpatialReferenceH hSRS, const char *pszXML)
{
VALIDATE_POINTER1(hSRS, "OSRImportFromXML", CE_Failure);
return ((OGRSpatialReference*) hSRS)->importFromXML(pszXML);
}
示例6: GDALCreateSimilarGCPTransformer
static
void* GDALCreateSimilarGCPTransformer( void *hTransformArg, double dfRatioX, double dfRatioY )
{
int i = 0;
GDAL_GCP *pasGCPList = NULL;
GCPTransformInfo *psInfo = (GCPTransformInfo *) hTransformArg;
VALIDATE_POINTER1( hTransformArg, "GDALCreateSimilarGCPTransformer", NULL );
if( dfRatioX == 1.0 && dfRatioY == 1.0 )
{
/* We can just use a ref count, since using the source transformation */
/* is thread-safe */
CPLAtomicInc(&(psInfo->nRefCount));
}
else
{
pasGCPList = GDALDuplicateGCPs( psInfo->nGCPCount, psInfo->pasGCPList );
for(i=0;i<psInfo->nGCPCount;i++)
{
pasGCPList[i].dfGCPPixel /= dfRatioX;
pasGCPList[i].dfGCPLine /= dfRatioY;
}
/* As remove_outliers modifies the provided GCPs we don't need to reapply it */
psInfo = (GCPTransformInfo *) GDALCreateGCPTransformer(
psInfo->nGCPCount, pasGCPList, psInfo->nOrder, psInfo->bReversed );
GDALDeinitGCPs( psInfo->nGCPCount, pasGCPList );
CPLFree( pasGCPList );
}
return psInfo;
}
示例7: OGR_G_GetPoints
int OGR_G_GetPoints( OGRGeometryH hGeom,
void* pabyX, int nXStride,
void* pabyY, int nYStride,
void* pabyZ, int nZStride)
{
VALIDATE_POINTER1( hGeom, "OGR_G_GetPoints", 0 );
switch( wkbFlatten(((OGRGeometry *) hGeom)->getGeometryType()) )
{
case wkbPoint:
{
if (pabyX) *((double*)pabyX) = ((OGRPoint *)hGeom)->getX();
if (pabyY) *((double*)pabyY) = ((OGRPoint *)hGeom)->getY();
if (pabyZ) *((double*)pabyZ) = ((OGRPoint *)hGeom)->getZ();
return 1;
}
break;
case wkbLineString:
case wkbCircularString:
{
OGRLineString* poLS = (OGRLineString *) hGeom;
poLS->getPoints(pabyX, nXStride, pabyY, nYStride, pabyZ, nZStride);
return poLS->getNumPoints();
}
break;
default:
CPLError(CE_Failure, CPLE_NotSupported, "Incompatible geometry for operation");
return 0;
break;
}
}
示例8: OGR_L_SetNextByIndex
OGRErr OGR_L_SetNextByIndex( OGRLayerH hLayer, long nIndex )
{
VALIDATE_POINTER1( hLayer, "OGR_L_SetNextByIndex", OGRERR_INVALID_HANDLE );
return ((OGRLayer *)hLayer)->SetNextByIndex( nIndex );
}
示例9: OGR_L_GetNextFeature
OGRFeatureH OGR_L_GetNextFeature( OGRLayerH hLayer )
{
VALIDATE_POINTER1( hLayer, "OGR_L_GetNextFeature", NULL );
return (OGRFeatureH) ((OGRLayer *)hLayer)->GetNextFeature();
}
示例10: OGR_L_SetAttributeFilter
OGRErr OGR_L_SetAttributeFilter( OGRLayerH hLayer, const char *pszQuery )
{
VALIDATE_POINTER1( hLayer, "OGR_L_SetAttributeFilter", OGRERR_INVALID_HANDLE );
return ((OGRLayer *) hLayer)->SetAttributeFilter( pszQuery );
}
示例11: OGR_L_GetFeature
OGRFeatureH OGR_L_GetFeature( OGRLayerH hLayer, long nFeatureId )
{
VALIDATE_POINTER1( hLayer, "OGR_L_GetFeature", NULL );
return (OGRFeatureH) ((OGRLayer *)hLayer)->GetFeature( nFeatureId );
}
示例12: OGR_L_GetExtent
OGRErr OGR_L_GetExtent( OGRLayerH hLayer, OGREnvelope *psExtent, int bForce )
{
VALIDATE_POINTER1( hLayer, "OGR_L_GetExtent", OGRERR_INVALID_HANDLE );
return ((OGRLayer *) hLayer)->GetExtent( psExtent, bForce );
}
示例13: OGR_L_GetFeatureCount
int OGR_L_GetFeatureCount( OGRLayerH hLayer, int bForce )
{
VALIDATE_POINTER1( hLayer, "OGR_L_GetFeature", 0 );
return ((OGRLayer *) hLayer)->GetFeatureCount(bForce);
}
示例14: OGR_L_GetRefCount
int OGR_L_GetRefCount( OGRLayerH hLayer )
{
VALIDATE_POINTER1( hLayer, "OGR_L_GetRefCount", 0 );
return ((OGRLayer *) hLayer)->GetRefCount();
}
示例15: VALIDATE_POINTER1
const char *OGR_L_GetGeometryColumn( OGRLayerH hLayer )
{
VALIDATE_POINTER1( hLayer, "OGR_L_GetGeometryColumn", NULL );
return ((OGRLayer *) hLayer)->GetGeometryColumn();
}