📄 mitab_capi.cpp
字号:
poPen = ((TABEllipse *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Text ) poPen = ((TABText *) poFeature); if( poPen != NULL ) { return poPen->GetPenColor_wyl(); } return 0x000000;}/************************************************************************//* mitab_c_get_pen_width() *//************************************************************************//** * Get an object's pen width property. Applies only to polyline, region, * rectangle, arc and ellipse objects. * * @param feature the mitab_feature object. * @return the pen as defined in the MIF specs: 1-7 for pixel * width, or 11-2047 for width in points (10 + (point_width*10)). */int MITAB_STDCALLmitab_c_get_pen_width( mitab_feature feature ) { TABFeature *poFeature = (TABFeature *) feature; ITABFeaturePen *poPen = NULL; if( poFeature->GetFeatureClass() == TABFC_Polyline ) poPen = ((TABPolyline *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Region ) poPen = ((TABRegion *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Rectangle ) poPen = ((TABRectangle *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Arc ) poPen = ((TABArc *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Ellipse ) poPen = ((TABEllipse *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Text ) poPen = ((TABText *) poFeature); if( poPen != NULL ) { return poPen->GetPenWidthMIF(); } return 0;}/************************************************************************//* mitab_c_get_pen_pattern() *//************************************************************************//** * Get an object's pen pattern property. Applies only to polyline, region, * rectangle, arc and ellipse objects. * * @param feature the mitab_feature object. * @return the pen pattern number (2 is default solid pen). */int MITAB_STDCALLmitab_c_get_pen_pattern( mitab_feature feature ) { TABFeature *poFeature = (TABFeature *) feature; ITABFeaturePen *poPen = NULL; if( poFeature->GetFeatureClass() == TABFC_Polyline ) poPen = ((TABPolyline *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Region ) poPen = ((TABRegion *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Rectangle ) poPen = ((TABRectangle *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Arc ) poPen = ((TABArc *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Ellipse ) poPen = ((TABEllipse *) poFeature); if( poFeature->GetFeatureClass() == TABFC_Text ) poPen = ((TABText *) poFeature); if( poPen != NULL ) { return poPen->GetPenPattern_wyl(); } return 0x000000;}/************************************************************************//* mitab_c_set_symbol() *//************************************************************************//** * Set an object's symbol properties. Applies only to point objects and * multipoint. * * See the MIF specs for more details on the meaning and valid values of * each parameter. * * @param feature the mitab_feature object. * @param symbol_no the symbol number (valid range: 32 to 67) * @param symbol_size the symbol size in pixels (valid range 1 to 48) * @param symbol_color the symbol color (24 bits RGB value) */void MITAB_STDCALLmitab_c_set_symbol( mitab_feature feature, int symbol_no, int symbol_size, int symbol_color ){ TABPoint *poFeature = (TABPoint *) feature; if(( poFeature->GetFeatureClass() == TABFC_Point ) || ( poFeature->GetFeatureClass() == TABFC_FontPoint ) || ( poFeature->GetFeatureClass() == TABFC_CustomPoint ) || ( poFeature->GetFeatureClass() == TABFC_MultiPoint )) { poFeature->SetSymbolNo( symbol_no ); poFeature->SetSymbolSize( symbol_size ); poFeature->SetSymbolColor( symbol_color ); }} /************************************************************************//* mitab_c_get_symbol_color() *//************************************************************************//** * Get an object's symbol color property. Applies only to point and * multipoint objects. * * @param feature the mitab_feature object. * @return the symbol color (24 bits RGB value). */int MITAB_STDCALLmitab_c_get_symbol_color( mitab_feature feature ) { TABPoint *poFeature = (TABPoint *) feature; if(( poFeature->GetFeatureClass() == TABFC_Point ) || ( poFeature->GetFeatureClass() == TABFC_MultiPoint )) { return poFeature->GetSymbolColor(); } return 0x000000;}/************************************************************************//* mitab_c_get_symbol_no() *//************************************************************************//** * Get an object's symbol number property. Applies only to point and * multipoint objects. * * @param feature the mitab_feature object. * @return the symbol number (valid range: 32 to 67) */int MITAB_STDCALLmitab_c_get_symbol_no( mitab_feature feature ) { TABPoint *poFeature = (TABPoint *) feature; if(( poFeature->GetFeatureClass() == TABFC_Point ) || ( poFeature->GetFeatureClass() == TABFC_MultiPoint )) { return poFeature->GetSymbolNo(); } return 0;}/************************************************************************//* mitab_c_get_symbol_size() *//************************************************************************//** * Get an object's symbol size property. Applies only to point and * multipoint objects. * * @param feature the mitab_feature object. * @return the symbol size in pixels (valid range 1 to 48) */int MITAB_STDCALLmitab_c_get_symbol_size( mitab_feature feature ) { TABPoint *poFeature = (TABPoint *) feature; if(( poFeature->GetFeatureClass() == TABFC_Point ) || ( poFeature->GetFeatureClass() == TABFC_MultiPoint )) { return poFeature->GetSymbolSize(); } return 1;}/************************************************************************//* mitab_c_get_type() *//************************************************************************//** * Return a mitab_feature's object type * * @param feature the mitab_feature object. * @return the feature type, one of TABFC_NoGeom (0), TABFC_Point (1), * TABFC_FontPoint (2), TABFC_CustomPoint (3), TABFC_Text (4), * TABFC_Polyline (5), TABFC_Arc (6), TABFC_Region (7), * TABFC_Rectangle (8), TABFC_Ellipse (9) or TABFC_MultiPoint (10). */int MITAB_STDCALL mitab_c_get_type( mitab_feature feature ){ TABFeature *poFeature = (TABFeature *) feature; if (poFeature) return poFeature->GetFeatureClass(); return 0;}/************************************************************************//* mitab_c_get_parts() *//************************************************************************//** * Return the number of parts (rings or polyline segments) in an object. * * @param feature the mitab_feature object. * @return the number of parts (in a region or polyline) or 0 if the object's * geometry was not set. For all object types other than polyline * region, returns 1 if object geometry is set. */int MITAB_STDCALL mitab_c_get_parts( mitab_feature feature ){ int numParts = 0; if (_mitab_c_get_feature_info( feature, INFO_NUMPARTS, &numParts, NULL, NULL ) == 0) { return numParts; } return 0;}/************************************************************************//* mitab_c_region_isinteriorring() *//************************************************************************//** * Return a false if te ring is the first of a polygon. * * @param feature the mitab_feature object. * @param requestedringindex the requested ring index * * @return true or false depends on the part number of the ring in the polygon, * true if it's not the first part of a polygon. If the feature is not * a region the return value will be false. */int MITAB_DLL MITAB_STDCALL mitab_c_is_interior_ring( mitab_feature feature, int requestedringindex ){ TABFeature *poFeature = (TABFeature *) feature; if( poFeature->GetFeatureClass() == TABFC_Region ) { TABRegion *poRegion = (TABRegion *) poFeature; return poRegion->IsInteriorRing( requestedringindex ); } return 0;}/************************************************************************//* mitab_c_get_vertex_count() *//************************************************************************//** * Return the number of points in a part of a mitab_feature object. * * @param feature the mitab_feature object. * @param part the part number we are interested in. Use 0 for objects which * cannot have multiple parts. * @return the number of points in that feature's part or 0 if the object * has no geometry or the part number is invalid. */int MITAB_STDCALLmitab_c_get_vertex_count( mitab_feature feature, int part ){ int numPoints = 0; if (_mitab_c_get_feature_info( feature, INFO_NUMPOINTS, &part, &numPoints, NULL ) == 0) { return numPoints; } return 0;}/************************************************************************//* mitab_c_get_vertex_x() *//************************************************************************//** * Return the X coordinate of a point in a part of a mitab_feature object. * * @param feature the mitab_feature object. * @param part the part number we are interested in. Use 0 for objects which * cannot have multiple parts. * @param point the point number, with 0 being the first point. * @return the X coordinate of the specified point or if the object has no * geometry or the part or the point number is invalid. */double MITAB_STDCALLmitab_c_get_vertex_x( mitab_feature feature, int part, int vertex ){ double dX = 0.0; if (_mitab_c_get_feature_info( feature, INFO_XVERTEX, &part, &vertex, &dX ) == 0) { return dX; } return 0.0;}/************************************************************************//* mitab_c_get_vertex_x() *//************************************************************************//** * Return the Y coordinate of a point in a part of a mitab_feature object. * * @param feature the mitab_feature object. * @param part the part number we are interested in. Use 0 for objects which * cannot have multiple parts. * @param point the point number, with 0 being the first point. * @return the Y coordinate of the specified point or if the object has no * geometry or the part or the point number is invalid. */double MITAB_STDCALLmitab_c_get_vertex_y( mitab_feature feature, int part, int vertex ){ double dY = 0.0; if (_mitab_c_get_feature_info( feature, INFO_YVERTEX, &part, &vertex, &dY ) == 0) { return dY; } return 0.0;}/************************************************************************//* mitab_c_get_field_count() *//************************************************************************//** * Return the number of attribute f
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -