4e5a81c493
- modifiche varie per gestire GLOB, LOC e GRID sui dati geometrici - aggiornamenti e miglirie varie - eliminate alcune funzioni lua ormai obsolete (ArcXY e CircleXY).
125 lines
3.3 KiB
C++
125 lines
3.3 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : AuxTools.cpp Data : 07.01.15 Versione : 1.6a1
|
|
// Contenuto : Funzioni ausiliarie.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 07.01.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#include "stdafx.h"
|
|
#include "AuxTools.h"
|
|
#include "/EgtDev/Include/EgkExtText.h"
|
|
#include "/EgtDev/Include/EInConst.h"
|
|
#include "/EgtDev/Include/EGnStringUtils.h"
|
|
|
|
using namespace std ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
const char*
|
|
__stdcall SepToString( int nSep)
|
|
{
|
|
switch ( nSep) {
|
|
default :
|
|
case SEP_STD : return "'ST'" ;
|
|
case SEP_TG : return "'TG'" ;
|
|
case SEP_PERP : return "'PR'" ;
|
|
case SEP_MINDIST : return "'MD'" ;
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
int
|
|
__stdcall StringToSep( const string& sSep)
|
|
{
|
|
string sTmp = sSep ;
|
|
ToUpper( sTmp) ;
|
|
if ( sTmp == "ST")
|
|
return SEP_STD ;
|
|
else if ( sTmp == "TG")
|
|
return SEP_TG ;
|
|
else if ( sTmp == "PR")
|
|
return SEP_PERP ;
|
|
else if ( sTmp == "MD")
|
|
return SEP_MINDIST ;
|
|
// default
|
|
return SEP_STD ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
const char*
|
|
__stdcall RefTypeToString( int nRefType)
|
|
{
|
|
switch ( nRefType) {
|
|
case RTY_GLOB : return "'GLOB'" ;
|
|
default :
|
|
case RTY_LOC : return "'LOC'" ;
|
|
case RTY_GRID : return "'GRID'" ;
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
int
|
|
__stdcall StringToRefType( const string& sRefType)
|
|
{
|
|
string sTmp = sRefType ;
|
|
ToUpper( sTmp) ;
|
|
if ( sTmp == "GLOB")
|
|
return RTY_GLOB ;
|
|
else if ( sTmp == "LOC")
|
|
return RTY_LOC ;
|
|
else if ( sTmp == "GRID")
|
|
return RTY_GRID ;
|
|
// default
|
|
return RTY_LOC ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
const char*
|
|
__stdcall ETxtInsPosToString( int nETxtInsPos)
|
|
{
|
|
switch ( nETxtInsPos) {
|
|
case ETXT_IPTL : return "'TL'" ;
|
|
case ETXT_IPTC : return "'TC'" ;
|
|
case ETXT_IPTR : return "'TR'" ;
|
|
case ETXT_IPML : return "'ML'" ;
|
|
case ETXT_IPMC : return "'MC'" ;
|
|
case ETXT_IPMR : return "'MR'" ;
|
|
default :
|
|
case ETXT_IPBL : return "'BL'" ;
|
|
case ETXT_IPBC : return "'BC'" ;
|
|
case ETXT_IPBR : return "'BR'" ;
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
int
|
|
__stdcall ETxtInsPosToString( const string& sETxtInsPos)
|
|
{
|
|
string sInsPos = sETxtInsPos ;
|
|
ToUpper( sInsPos) ;
|
|
if ( sInsPos == "TL")
|
|
return ETXT_IPTL ;
|
|
else if ( sInsPos == "TC")
|
|
return ETXT_IPTC ;
|
|
else if ( sInsPos == "TR")
|
|
return ETXT_IPTR ;
|
|
else if ( sInsPos == "ML")
|
|
return ETXT_IPML ;
|
|
else if ( sInsPos == "MC")
|
|
return ETXT_IPMC ;
|
|
else if ( sInsPos == "MR")
|
|
return ETXT_IPMR ;
|
|
else if ( sInsPos == "BL")
|
|
return ETXT_IPBL ;
|
|
else if ( sInsPos == "BC")
|
|
return ETXT_IPBC ;
|
|
else if ( sInsPos == "BR")
|
|
return ETXT_IPBR ;
|
|
// default
|
|
return ETXT_IPBL ;
|
|
} |