コード例 #1
0
ファイル: ogrdwglayer.cpp プロジェクト: Mavrx-inc/gdal
OGRDWGLayer::OGRDWGLayer( OGRDWGDataSource *poDSIn )

{
    this->poDS = poDSIn;

    iNextFID = 0;

    poFeatureDefn = new OGRFeatureDefn( "entities" );
    SetDescription( poFeatureDefn->GetName() );
    poFeatureDefn->Reference();

    poDS->AddStandardFields( poFeatureDefn );

    if( !poDS->InlineBlocks() )
    {
        OGRFieldDefn  oScaleField( "BlockScale", OFTRealList );
        poFeatureDefn->AddFieldDefn( &oScaleField );

        OGRFieldDefn  oBlockAngleField( "BlockAngle", OFTReal );
        poFeatureDefn->AddFieldDefn( &oBlockAngleField );
    }

/* -------------------------------------------------------------------- */
/*      Find the *Paper_Space block, which seems to contain all the     */
/*      regular entities.                                               */
/* -------------------------------------------------------------------- */
    OdDbBlockTablePtr pTable = poDS->GetDB()->getBlockTableId().safeOpenObject();
    OdDbSymbolTableIteratorPtr pBlkIter = pTable->newIterator();

    for (pBlkIter->start(); ! pBlkIter->done(); pBlkIter->step())
    {
        m_poBlock = pBlkIter->getRecordId().safeOpenObject();

        if( EQUAL(m_poBlock->getName(),"*Model_Space") )
            break;
        else
            m_poBlock = NULL;
    }

    ResetReading();
}
コード例 #2
0
OGRDXFWriterLayer::OGRDXFWriterLayer( OGRDXFWriterDS *poDS, VSILFILE *fp )

{
    this->fp = fp;
    this->poDS = poDS;

    nNextAutoID = 1;
    bWriteHatch = CSLTestBoolean(CPLGetConfigOption("DXF_WRITE_HATCH", "YES"));

    poFeatureDefn = new OGRFeatureDefn( "entities" );
    poFeatureDefn->Reference();

    OGRFieldDefn  oLayerField( "Layer", OFTString );
    poFeatureDefn->AddFieldDefn( &oLayerField );

    OGRFieldDefn  oClassField( "SubClasses", OFTString );
    poFeatureDefn->AddFieldDefn( &oClassField );

    OGRFieldDefn  oExtendedField( "ExtendedEntity", OFTString );
    poFeatureDefn->AddFieldDefn( &oExtendedField );

    OGRFieldDefn  oLinetypeField( "Linetype", OFTString );
    poFeatureDefn->AddFieldDefn( &oLinetypeField );

    OGRFieldDefn  oEntityHandleField( "EntityHandle", OFTString );
    poFeatureDefn->AddFieldDefn( &oEntityHandleField );

    OGRFieldDefn  oTextField( "Text", OFTString );
    poFeatureDefn->AddFieldDefn( &oTextField );

    OGRFieldDefn  oBlockField( "BlockName", OFTString );
    poFeatureDefn->AddFieldDefn( &oBlockField );
    
    OGRFieldDefn  oScaleField( "BlockScale", OFTRealList );
    poFeatureDefn->AddFieldDefn( &oScaleField );
    
    OGRFieldDefn  oBlockAngleField( "BlockAngle", OFTReal );
    poFeatureDefn->AddFieldDefn( &oBlockAngleField );
}